#airship - September 2019

September 2019
joshmyers
joshmyersabout 7 years ago
joshmyers
joshmyersabout 7 years ago
joshmyers
joshmyersabout 7 years ago
Any ideas @Mads Hvelplund?
Mads Hvelplund
Mads Hvelplundabout 7 years ago
I’ll have a look tomorrow after work.
Thang Man
Thang Manabout 7 years ago
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
IvanMabout 7 years ago(edited)
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                = "<http://XXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXX/heartbeat:latest|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


joshmyers
joshmyersabout 7 years ago(edited)
@IvanM See my comment above
Mads Hvelplund
Mads Hvelplundabout 7 years ago
i'll take a look now
rss
rssabout 7 years ago
IvanM
IvanMabout 7 years ago
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
IvanMabout 7 years ago
even if I assign ALB and have it deployed in public subnet I still can’t pull image from ECR
IvanM
IvanMabout 7 years ago
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?
Maciek Strömich
Maciek Strömichabout 7 years ago
fork, push to a branch in your repo, create pr against your repo
rss
rssabout 7 years ago
0.6.1: Removed the default use of detailed monitoring. (#17)
Reduces CloudWatch costs for metrics by 80%
Rolf M. Harksen
Rolf M. Harksenabout 7 years ago
@Maarten van der Hoef 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
IvanM
IvanMabout 7 years ago
Maarten van der Hoef
Maarten van der Hoefabout 7 years ago
Hi @IvanM, I can take a look. What is your use-case, have both internal and external lb connected ?
Morten Hjorth Fæster
Morten Hjorth Fæsterabout 7 years ago
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.
rss
rssabout 7 years ago
0.9.9.0: Health port variable (#80)
health check port as variable for alb_handling


health port as variable
rss
rssabout 7 years ago
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"...