-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/aws_ecs_task_definition: add track_latest attribute #30154
r/aws_ecs_task_definition: add track_latest attribute #30154
Conversation
Community NoteVoting for Prioritization
For Submitters
|
9688611
to
02ba2b5
Compare
02ba2b5
to
19cac33
Compare
19cac33
to
559f8f9
Compare
559f8f9
to
06120d3
Compare
06120d3
to
a38dfc0
Compare
why can't merge? |
Pinging @ewbankkit and @jar-b who have approved recently changes to ECS related PRs. The original reviewer of this PR seems to be gone. Can someone from HashiCorp take over, thank you. |
a38dfc0
to
6fb0b20
Compare
Trying other people: can @YakDriver , @gdavison have a look at this ready PR to hopefully accept it? It would be wonderful! |
% make testacc TESTARGS='-run=TestAccECSTaskDefinition_trackLatest\|TestAccECSTaskDefinition_basic' PKG=ecs ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 20 -run=TestAccECSTaskDefinition_trackLatest\|TestAccECSTaskDefinition_basic -timeout 360m === RUN TestAccECSTaskDefinition_basic === PAUSE TestAccECSTaskDefinition_basic === RUN TestAccECSTaskDefinition_trackLatest === PAUSE TestAccECSTaskDefinition_trackLatest === CONT TestAccECSTaskDefinition_basic === CONT TestAccECSTaskDefinition_trackLatest --- PASS: TestAccECSTaskDefinition_trackLatest (22.28s) --- PASS: TestAccECSTaskDefinition_basic (34.45s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ecs 44.837s
Thanks @ewbankkit for coming on the PR! |
+1 Thanks @ewbankkit for taking over it and writing the tests!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccECSTaskDefinition_' PKG=ecs ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 3 -run=TestAccECSTaskDefinition_ -timeout 360m
=== RUN TestAccECSTaskDefinition_basic
=== PAUSE TestAccECSTaskDefinition_basic
=== RUN TestAccECSTaskDefinition_scratchVolume
=== PAUSE TestAccECSTaskDefinition_scratchVolume
=== RUN TestAccECSTaskDefinition_DockerVolume_basic
=== PAUSE TestAccECSTaskDefinition_DockerVolume_basic
=== RUN TestAccECSTaskDefinition_DockerVolume_minimal
=== PAUSE TestAccECSTaskDefinition_DockerVolume_minimal
=== RUN TestAccECSTaskDefinition_runtimePlatform
=== PAUSE TestAccECSTaskDefinition_runtimePlatform
=== RUN TestAccECSTaskDefinition_Fargate_runtimePlatform
=== PAUSE TestAccECSTaskDefinition_Fargate_runtimePlatform
=== RUN TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch
=== PAUSE TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch
=== RUN TestAccECSTaskDefinition_EFSVolume_minimal
=== PAUSE TestAccECSTaskDefinition_EFSVolume_minimal
=== RUN TestAccECSTaskDefinition_EFSVolume_basic
=== PAUSE TestAccECSTaskDefinition_EFSVolume_basic
=== RUN TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal
=== PAUSE TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal
=== RUN TestAccECSTaskDefinition_EFSVolume_transitEncryption
=== PAUSE TestAccECSTaskDefinition_EFSVolume_transitEncryption
=== RUN TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled
=== PAUSE TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled
=== RUN TestAccECSTaskDefinition_EFSVolume_accessPoint
=== PAUSE TestAccECSTaskDefinition_EFSVolume_accessPoint
=== RUN TestAccECSTaskDefinition_fsxWinFileSystem
=== PAUSE TestAccECSTaskDefinition_fsxWinFileSystem
=== RUN TestAccECSTaskDefinition_DockerVolume_taskScoped
=== PAUSE TestAccECSTaskDefinition_DockerVolume_taskScoped
=== RUN TestAccECSTaskDefinition_service
=== PAUSE TestAccECSTaskDefinition_service
=== RUN TestAccECSTaskDefinition_taskRoleARN
=== PAUSE TestAccECSTaskDefinition_taskRoleARN
=== RUN TestAccECSTaskDefinition_networkMode
=== PAUSE TestAccECSTaskDefinition_networkMode
=== RUN TestAccECSTaskDefinition_ipcMode
=== PAUSE TestAccECSTaskDefinition_ipcMode
=== RUN TestAccECSTaskDefinition_pidMode
=== PAUSE TestAccECSTaskDefinition_pidMode
=== RUN TestAccECSTaskDefinition_constraint
=== PAUSE TestAccECSTaskDefinition_constraint
=== RUN TestAccECSTaskDefinition_changeVolumesForcesNewResource
=== PAUSE TestAccECSTaskDefinition_changeVolumesForcesNewResource
=== RUN TestAccECSTaskDefinition_arrays
=== PAUSE TestAccECSTaskDefinition_arrays
=== RUN TestAccECSTaskDefinition_Fargate_basic
=== PAUSE TestAccECSTaskDefinition_Fargate_basic
=== RUN TestAccECSTaskDefinition_Fargate_ephemeralStorage
=== PAUSE TestAccECSTaskDefinition_Fargate_ephemeralStorage
=== RUN TestAccECSTaskDefinition_executionRole
=== PAUSE TestAccECSTaskDefinition_executionRole
=== RUN TestAccECSTaskDefinition_disappears
=== PAUSE TestAccECSTaskDefinition_disappears
=== RUN TestAccECSTaskDefinition_tags
=== PAUSE TestAccECSTaskDefinition_tags
=== RUN TestAccECSTaskDefinition_proxy
=== PAUSE TestAccECSTaskDefinition_proxy
=== RUN TestAccECSTaskDefinition_inferenceAccelerator
=== PAUSE TestAccECSTaskDefinition_inferenceAccelerator
=== RUN TestAccECSTaskDefinition_invalidContainerDefinition
=== PAUSE TestAccECSTaskDefinition_invalidContainerDefinition
=== RUN TestAccECSTaskDefinition_trackLatest
=== PAUSE TestAccECSTaskDefinition_trackLatest
=== CONT TestAccECSTaskDefinition_basic
=== CONT TestAccECSTaskDefinition_Fargate_ephemeralStorage
=== CONT TestAccECSTaskDefinition_taskRoleARN
--- PASS: TestAccECSTaskDefinition_Fargate_ephemeralStorage (23.25s)
=== CONT TestAccECSTaskDefinition_EFSVolume_basic
--- PASS: TestAccECSTaskDefinition_taskRoleARN (23.52s)
=== CONT TestAccECSTaskDefinition_service
--- PASS: TestAccECSTaskDefinition_basic (36.74s)
=== CONT TestAccECSTaskDefinition_DockerVolume_taskScoped
--- PASS: TestAccECSTaskDefinition_DockerVolume_taskScoped (18.32s)
=== CONT TestAccECSTaskDefinition_fsxWinFileSystem
--- PASS: TestAccECSTaskDefinition_EFSVolume_basic (32.54s)
=== CONT TestAccECSTaskDefinition_EFSVolume_accessPoint
--- PASS: TestAccECSTaskDefinition_EFSVolume_accessPoint (32.86s)
=== CONT TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled
--- PASS: TestAccECSTaskDefinition_service (84.63s)
=== CONT TestAccECSTaskDefinition_EFSVolume_transitEncryption
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled (28.90s)
=== CONT TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryption (28.91s)
=== CONT TestAccECSTaskDefinition_Fargate_basic
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal (29.02s)
=== CONT TestAccECSTaskDefinition_runtimePlatform
--- PASS: TestAccECSTaskDefinition_Fargate_basic (25.36s)
=== CONT TestAccECSTaskDefinition_arrays
--- PASS: TestAccECSTaskDefinition_runtimePlatform (19.62s)
=== CONT TestAccECSTaskDefinition_EFSVolume_minimal
--- PASS: TestAccECSTaskDefinition_arrays (20.57s)
=== CONT TestAccECSTaskDefinition_changeVolumesForcesNewResource
--- PASS: TestAccECSTaskDefinition_EFSVolume_minimal (30.42s)
=== CONT TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch
--- PASS: TestAccECSTaskDefinition_changeVolumesForcesNewResource (37.74s)
=== CONT TestAccECSTaskDefinition_constraint
--- PASS: TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch (24.19s)
=== CONT TestAccECSTaskDefinition_Fargate_runtimePlatform
--- PASS: TestAccECSTaskDefinition_Fargate_runtimePlatform (22.74s)
=== CONT TestAccECSTaskDefinition_pidMode
--- PASS: TestAccECSTaskDefinition_constraint (23.63s)
=== CONT TestAccECSTaskDefinition_ipcMode
--- PASS: TestAccECSTaskDefinition_pidMode (22.29s)
=== CONT TestAccECSTaskDefinition_DockerVolume_basic
--- PASS: TestAccECSTaskDefinition_ipcMode (21.52s)
=== CONT TestAccECSTaskDefinition_scratchVolume
--- PASS: TestAccECSTaskDefinition_scratchVolume (22.43s)
=== CONT TestAccECSTaskDefinition_proxy
--- PASS: TestAccECSTaskDefinition_DockerVolume_basic (22.56s)
=== CONT TestAccECSTaskDefinition_trackLatest
--- PASS: TestAccECSTaskDefinition_trackLatest (20.32s)
=== CONT TestAccECSTaskDefinition_invalidContainerDefinition
--- PASS: TestAccECSTaskDefinition_invalidContainerDefinition (3.35s)
=== CONT TestAccECSTaskDefinition_inferenceAccelerator
--- PASS: TestAccECSTaskDefinition_proxy (37.63s)
=== CONT TestAccECSTaskDefinition_disappears
--- PASS: TestAccECSTaskDefinition_inferenceAccelerator (26.68s)
=== CONT TestAccECSTaskDefinition_tags
--- PASS: TestAccECSTaskDefinition_disappears (31.05s)
=== CONT TestAccECSTaskDefinition_executionRole
--- PASS: TestAccECSTaskDefinition_executionRole (25.20s)
=== CONT TestAccECSTaskDefinition_DockerVolume_minimal
--- PASS: TestAccECSTaskDefinition_tags (68.27s)
=== CONT TestAccECSTaskDefinition_networkMode
--- PASS: TestAccECSTaskDefinition_DockerVolume_minimal (31.69s)
--- PASS: TestAccECSTaskDefinition_networkMode (28.82s)
--- PASS: TestAccECSTaskDefinition_fsxWinFileSystem (3392.37s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ecs 3458.414s
@GerardSoleCa Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.37.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Do I understand correctly that no test was written to verify that an external bump of task definition revision and subsequent |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This PR allows users to make the task definitions track always the latest one if
track_latest
is set to true.The rationale for this Pull Request is that in some projects/environments/teams, Task Definitions can be updated outside Terraform. For example, a CI/CD process could bumps the Docker Tag version by creates a new TaskDefinition using the previous one as a base template, within the process, it might move the previous TaskDefinition to inactive. Because of this, when Terraform is executed again it cannot track the changes and forces a new resource creation.
With this Pull Request, we would allow users to track always the changes against the latest TaskDefinition, so, if all the fields are the same, Terraform won't promote any change.
In fact, while checking the code, I've seen that "family" is considered to be the ID of the resource, but when reading it, it was readed by "arn". The "family" doesn't contain a revision (version), while "arn" contains the revision.
References
Here are some references to people updating the version outside terraform:
Output from Acceptance Testing
The test scenario would be:
If someone thinks this pull is interesting, and wants to guide me with the tests, I'd highly appreciate!