#airship (2019-09)

airship

Home of Airship ECS Modules ( https://github.com/blinkist/terraform-aws-airship-ecs-service / https://github.com/blinkist/terraform-aws-airship-ecs-cluster )

Archive: https://archive.sweetops.com/airship/

2019-09-23

Morten Hjorth Fæster avatar
Morten Hjorth Fæster

Hello - I believe there is a problem with scaling in services in https://github.com/blinkist/terraform-aws-airship-ecs-service ; scale out works as expected but scaling in fails with an empty error message when triggered. There is little more details here https://github.com/blinkist/terraform-aws-airship-ecs-service/issues/79 . I have created the pull request https://github.com/blinkist/terraform-aws-airship-ecs-service/pull/78 which sets a metric_lower_bound for scaling in events and a metric_upper_bound for scaling out. This seem to fix the problem in our case at least.

blinkist/terraform-aws-airship-ecs-service

Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

Problems scaling in services · Issue #79 · blinkist/terraform-aws-airship-ecs-service

what We are consistently seeing that scale down events are not respected as Cloudwatch reports an error with an empty string as error message. We need scale downs to work to ensure we can gain true…

Fixing autoscaling for ECS services: The previous policy did scale up… by faester · Pull Request #78 · blinkist/terraform-aws-airship-ecs-service

… correctly but caused an exception with an empty error message, when scale downs were attempted.

:100:1
maarten avatar
maarten

Thanks Morten, I’ve merged it.

blinkist/terraform-aws-airship-ecs-service

Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

Problems scaling in services · Issue #79 · blinkist/terraform-aws-airship-ecs-service

what We are consistently seeing that scale down events are not respected as Cloudwatch reports an error with an empty string as error message. We need scale downs to work to ensure we can gain true…

Fixing autoscaling for ECS services: The previous policy did scale up… by faester · Pull Request #78 · blinkist/terraform-aws-airship-ecs-service

… correctly but caused an exception with an empty error message, when scale downs were attempted.

Release notes from terraform-aws-airship-ecs-service avatar
Release notes from terraform-aws-airship-ecs-service
10:17:40 AM

0.9.9.0: Health port variable (#80) health check port as variable for alb_handling

health port as variable

blinkist/terraform-aws-airship-ecs-service

Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

Release notes from terraform-aws-airship-ecs-service avatar
Release notes from terraform-aws-airship-ecs-service
10:17:40 AM

0.9.9.1: Fixing autoscaling for ECS services: The previous policy did scale up… … correctly but caused an exception with an empty error message, when scale downs were attempted. (<a class=”issue-link js-issue-link” data-error-text=”Failed to load issue title” data-id=”496833286” data-permission-text=”Issue title is private” data-url=”https://github.com/blinkist/terraform-aws-airship-ecs-service/issues/78” data-hovercard-type=”pull_request” data-hovercard-url=”/blinkist/terraform-aws-airship-ecs-service/pull/78/hovercard”…

blinkist/terraform-aws-airship-ecs-service

Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

Fixing autoscaling for ECS services: The previous policy did scale up… by faester · Pull Request #78 · blinkist/terraform-aws-airship-ecs-service

… correctly but caused an exception with an empty error message, when scale downs were attempted.

2019-09-20

maarten avatar
maarten

Hi @IvanM, I can take a look. What is your use-case, have both internal and external lb connected ?

IvanM avatar
IvanM

My use case is to have one Fargate service running and one NLB that will be listening on multiple ports - that means multiple target groups

2019-09-16

Release notes from terraform-aws-airship-ecs-cluster avatar
Release notes from terraform-aws-airship-ecs-cluster
08:23:50 AM

0.6.1: Removed the default use of detailed monitoring. (#17) Reduces CloudWatch costs for metrics by 80%

blinkist/terraform-aws-airship-ecs-cluster

Terraform module which creates an ECS Cluster with integrated instance scaling and EFS mounting capability - blinkist/terraform-aws-airship-ecs-cluster

Rolf M. Harksen avatar
Rolf M. Harksen

@maarten Hi Maarten I created a pull request regarding to Scheduled tasks. I wonder if you would like to use it. I created it because we have a situation, where we have multiple clusters, with the same service in each cluster. Therfore we needed an unique name for the cloudwatch event rule: https://github.com/blinkist/terraform-aws-airship-ecs-service/pull/77

Scheduled task name by Rolf88 · Pull Request #77 · blinkist/terraform-aws-airship-ecs-service

In case you need the same service name in multiple clusters. In case event rule can’t be named the same as the service.

2019-09-08

IvanM avatar
IvanM

guys I would have a PR for the https://github.com/blinkist/terraform-aws-airship-ecs-service however, I can’t push to new branch Who should I contact in order to push it?

blinkist/terraform-aws-airship-ecs-service

Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

1
Maciek Strömich avatar
Maciek Strömich

fork, push to a branch in your repo, create pr against your repo

:--1:1

2019-09-05

Release notes from terraform-aws-airship-ecs-service avatar
Release notes from terraform-aws-airship-ecs-service
11:32:42 AM
blinkist/terraform-aws-airship-ecs-service

Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

2
IvanM avatar
IvanM

Guys is there pls a way how to in blinkist/airship-ecs-service/aws enable to access ECR from Fargate service in public subnets?

I have a fargate service without ALB/NLB in public subnets. I see that it does not assign public IP - I guess that is the issue

IvanM avatar
IvanM

even if I assign ALB and have it deployed in public subnet I still can’t pull image from ECR

2019-09-04

Thang Man avatar
Thang Man

hello everyone, I am finding a way to do CI/CD for the ECS services created by the Airship module. Ideally, I would like to make it work with Gitlab CI. Looking forward to hearing your suggestions/experience. Thanks!

IvanM avatar
IvanM

Hey guys I’m having an issue with ecs service

module "prod-ecs-cluster" {
  source  = "blinkist/airship-ecs-cluster/aws"
  version = "0.5.1"

  name                    = "production"
  create_roles            = false
  create_autoscalinggroup = false
  tags                    = "${var.prod-account-tags}"
}

module "prod_xxx_fargate" {
  source  = "blinkist/airship-ecs-service/aws"
  version = "0.9.8"

  name            = "heartbeat"
  region          = "eu-west-1"
  fargate_enabled = true

  ecs_cluster_id = "${data.aws_ssm_parameter.prod_ecs_cluster_id.value}"

  awsvpc_enabled            = true
  awsvpc_subnets            = "${split(",", data.aws_ssm_parameter.prod_private_subnets.value)}"
  awsvpc_security_group_ids = ["${aws_security_group.prod_heartbeat.id}"]
  load_balancing_type = "none"
  load_balancing_properties_route53_record_type = "NONE"
  container_cpu                = "512"
  container_memory             = "1024"
  container_memory_reservation = "1024"
  container_name               = "heartbeat"
  capacity_properties_desired_capacity     = "1"
  capacity_properties_desired_min_capacity = "1"
  capacity_properties_desired_max_capacity = "1"
  bootstrap_container_image                = "[XXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXX/heartbeat:latest](http://XXXX\.dkr\.ecr\.eu\-west\-1\.amazonaws\.com/XXXX/heartbeat:latest)"
  tags                                     = "${var.prod-tags}"
}

When applying I get this error

module.prod_heartbeat_fargate.aws_cloudwatch_event_target.scheduled_task: Creating...
  arn:                                                             "" => "arn:aws:ecs:eu-west-1:XXXX:cluster/production"
  ecs_target.#:                                                    "" => "1"
  ecs_target.0.group:                                              "" => "default"
  ecs_target.0.launch_type:                                        "" => "FARGATE"
  ecs_target.0.network_configuration.#:                            "" => "1"
  ecs_target.0.network_configuration.0.assign_public_ip:           "" => "false"
  ecs_target.0.network_configuration.0.security_groups.#:          "" => "1"
  ecs_target.0.network_configuration.0.security_groups.2188918090: "" => "sg-01fc127021b5c06e2"
  ecs_target.0.network_configuration.0.subnets.#:                  "" => "3"
  ecs_target.0.network_configuration.0.subnets.1208029751:         "" => "subnet-009c1eef5052c165e"
  ecs_target.0.network_configuration.0.subnets.1240492469:         "" => "subnet-016c5d63421f2b356"
  ecs_target.0.network_configuration.0.subnets.3423134812:         "" => "subnet-0b7f0f0a1f22789ec"
  ecs_target.0.task_count:                                         "" => "1"
  ecs_target.0.task_definition_arn:                                "" => "arn:aws:ecs:eu-west-1:XXXX:task-definition/production-heartbeat:1"
  rule:                                                            "" => "heartbeat_scheduled_task"
  target_id:                                                       "" => "<computed>"
Releasing state lock. This may take a few moments...

Error: Error applying plan:

1 error occurred:
        * module.prod_heartbeat_fargate.aws_cloudwatch_event_target.scheduled_task: 1 error occurred:
        * aws_cloudwatch_event_target.scheduled_task: Creating CloudWatch Event Target failed: ValidationException: RoleArn is required for target arn:aws:ecs:eu-west-1:XXXX:cluster/production.
        status code: 400, request id: ab07b8c1-342d-4b5b-a00d-604cfe95de5c


IvanM avatar
IvanM

as a solution I reverted back to blinkist/airship-ecs-service/aws v 0.9.4 and set

load_balancing_properties_lb_arn                = "aXXXX"
Mads Hvelplund avatar
Mads Hvelplund

i can reproduce your bug report with this snippet. i’ll try to fix it.

Mads Hvelplund avatar
Mads Hvelplund

@IvanM & @joshmyers: I think I found the problem. stuff related to scheduled tasks added in PR #73 was being created even for non-scheduled tasks. I can run your example now with my fix. I’ll go over it a final time and create a pull request with the fix.

joshmyers avatar
joshmyers

Awesome :)

Mads Hvelplund avatar
Mads Hvelplund

let’s not celebrate until you can see it works I’ve sent you a link to the PR

IvanM avatar
IvanM

cool!

joshmyers avatar
joshmyers

@IvanM See my comment above

:--1:1
Mads Hvelplund avatar
Mads Hvelplund

i’ll take a look now

2019-09-03

joshmyers avatar
joshmyers
joshmyers avatar
joshmyers
Scheduled task support by mhvelplund · Pull Request #73 · blinkist/terraform-aws-airship-ecs-service

I added support for deploying ECS scheduled tasks based on CloudWatch event rules, and I updated the website documentation.

joshmyers avatar
joshmyers

Any ideas @Mads Hvelplund?

Mads Hvelplund avatar
Mads Hvelplund

I’ll have a look tomorrow after work.

    keyboard_arrow_up