navapbc / template-infra

A template to set up foundational infrastructure for your application in AWS
Apache License 2.0
9 stars 2 forks source link

Add AWS defaults to container definitions to produce clean tf plan #603

Closed lorenyu closed 1 month ago

lorenyu commented 1 month ago

Ticket

Resolves https://github.com/navapbc/template-infra/issues/600

Changes

see title

Context for reviewers

Unclear when this started happening, it's possible it's related to when we upgraded either terraform or when we upgraded the AWS provider, but in any case the terraform plan in the service layer is always showing a diff now even after applying any changes. This change adds some AWS default parameters to container_definitions.json to cause the plan to show a clean diff.

Testing

Developed and tested on platform test in https://github.com/navapbc/platform-test/pull/97

rocketnova commented 1 month ago

@aligg

Is it intentional that the host and container port are the same? Otherwise lgtm, albeit I have less context.

Yes. The container port matches the host port and the ALB connects to that port. So I believe it looks like this:

alb:443 -> ecs:host_port -> container:container_port

By default it would be:

alb:443 -> ecs:8000 -> container:8000