#airship (2020-06)
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/
2020-06-02

hey everyone Is there pls any update on porting https://github.com/blinkist/terraform-aws-airship-ecs-service to terraform 0.12?
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

or we should just stop praying for that?
2020-06-10

heh, I was coming to ask the same question

@Mads Hvelplund IS https://github.com/mhvelplund/terraform-aws-airship-ecs-service/tree/terraform12 your branch? How did it go?
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - mhvelplund/terraform-aws-airship-ecs-service

@Clayton Wheeler Just having a look at https://github.com/Genomenon/terraform-aws-airship-ecs-service/tree/terraform12
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - Genomenon/terraform-aws-airship-ecs-service

Would you mind me asking what functionality you have working?

I’d like to understand if it’s more important to have the current module fitted into 0.12 or have a cleaner design based on 0.13.

By the latter I assume you mean for_each and depends_on for modules etc?

yes

Would that change the design heavily?

Not a great lot

Doesn’t look like much would change there…

I’d have thought a push to 0.12 would be good, and maybe small changes for 0.13

@joshmyers the big change is that we won’t need a var.create, so the outputs are in some cases much easier to manage

True

Not touching alpha for a while though

oh hey, hmm, I got pulled away from that so I don’t have it quite in release-worthy shape yet like I’d hoped to, but a decent amount. The basics, definitely. I’ve only done a little bit of load balancing, and haven’t touched autoscaling, cron tasks, placement, or volumes at all. But running normal containers esp. with Fargate, using Secrets Manager and IAM, service discovery, repository credentials, that works.

Thanks

just pushed a few changes I had sitting around. I’ve been using it in its current state and it’s been working well for me.

That’s fine, I can take a look at the autoscaling and cron-tasks

Grand - thanks very much folks

I’m gonna be picking this up again for a project

Where do PRs go back into now?

I’ll copy master into a new 011 branch when i’m at home

from that moment it will be master to PR against

Awesome!


Shall I open a PR with what I’ve got?

https://github.com/blinkist/terraform-aws-airship-ecs-service/compare/master...Genomenon:terraform12 looks great @Mads Hvelplund + @Clayton Wheeler
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - blinkist/terraform-aws-airship-ecs-service

Wondering what folks are doing to deploy ECS tasks via CI/CD that services etc are managed with Terraform

2020-06-11

@Clayton Wheeler / @Mads Hvelplund / @maarten Looks like https://github.com/Genomenon/terraform-aws-airship-ecs-service/blob/master/modules/live_task_lookup/output.tf#L19 is broken in 0.12
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - Genomenon/terraform-aws-airship-ecs-service

TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158: Error: Error in function call
TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158:
TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158: on ../../modules/live_task_lookup/output.tf line 19, in locals:
TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158: 19: environment_coalesce = "${coalescelist(data.aws_ecs_container_definition.lookup.*.environment, list(map()))}"
TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158:
TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158: Call to function "map" failed: map requires an even number of two or more
TestExamplesComplete 2020-06-11T16:45:27+01:00 command.go:158: arguments, got 0.
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - Genomenon/terraform-aws-airship-ecs-service

@Clayton Wheeler are you using the live lookups?

Guessing not as https://github.com/Genomenon/terraform-aws-airship-ecs-service/blob/master/variables.tf#L235 is deprecated and no longer allowed
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible - Genomenon/terraform-aws-airship-ecs-service
2020-06-12

data "aws_ecs_task_definition" "default" {
task_definition = "${var.namespace}-${var.name}-${var.environment}-${var.pool}"
depends_on = [aws_ecs_task_definition.default]
}

For this reason there is the lambda live lookup

Which I’ve extracted in a separate lambda now so only one lambda is needed per region

Adding an explicit depends_on gets over the bootstrap issue so I’m not sure the live lookup stuff is necessary?

Bah, trying try(data.aws_ecs_container_definition.default.image, local.bootstrap_service_container_image)
causes a cyclical dependency