Skip to content
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

ecs/task_definition: Add configuredAtLaunch argument #36533

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mcarroll1
Copy link

@mcarroll1 mcarroll1 commented Mar 22, 2024

Description

This PR adds the configuredAtLaunch argument to the ecs_task_definition resource. This does not complete the EBS volume support for ECS Fargate, as this only handles the task definition. However, this feature in isolation does provide stability to the ecs_task_definition resource if you are currently configuring that field manually.

I intend to raise a separate PR for the ecs_service side, but that will take longer so I'm separating the PRs. I hope this means we can have a stable release of this configuredAtLaunch feature in isolation, as that would be helpful with my use case.

I worked on this with @chelzackey-els

Relations

Relates #35279

References

Credit to @epiehl-it for commenting the original issue with some starter code: epiehl-it@4d8f188

Output from Acceptance Testing

% make testacc TESTS='TestAccECSTaskDefinition_' PKG=ecs TESTARGS=-short
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSTaskDefinition_' -short -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_EBSVolumeConfiguredAtLaunch
=== PAUSE TestAccECSTaskDefinition_EBSVolumeConfiguredAtLaunch
=== 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
    task_definition_test.go:586: skipping long-running test in short mode
--- SKIP: TestAccECSTaskDefinition_fsxWinFileSystem (0.00s)
=== 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_taskRoleARN
=== CONT  TestAccECSTaskDefinition_inferenceAccelerator
=== CONT  TestAccECSTaskDefinition_EFSVolume_minimal
=== CONT  TestAccECSTaskDefinition_service
=== CONT  TestAccECSTaskDefinition_DockerVolume_taskScoped
=== CONT  TestAccECSTaskDefinition_EFSVolume_accessPoint
=== CONT  TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled
=== CONT  TestAccECSTaskDefinition_EFSVolume_transitEncryption
=== CONT  TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal
=== CONT  TestAccECSTaskDefinition_EFSVolume_basic
=== CONT  TestAccECSTaskDefinition_EBSVolumeConfiguredAtLaunch
=== CONT  TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch
=== CONT  TestAccECSTaskDefinition_Fargate_runtimePlatform
=== CONT  TestAccECSTaskDefinition_runtimePlatform
=== CONT  TestAccECSTaskDefinition_scratchVolume
=== CONT  TestAccECSTaskDefinition_DockerVolume_minimal
=== CONT  TestAccECSTaskDefinition_Fargate_ephemeralStorage
=== CONT  TestAccECSTaskDefinition_trackLatest
=== CONT  TestAccECSTaskDefinition_invalidContainerDefinition
--- PASS: TestAccECSTaskDefinition_invalidContainerDefinition (9.08s)
=== CONT  TestAccECSTaskDefinition_DockerVolume_basic
--- PASS: TestAccECSTaskDefinition_DockerVolume_taskScoped (142.76s)
=== CONT  TestAccECSTaskDefinition_tags
--- PASS: TestAccECSTaskDefinition_Fargate_ephemeralStorage (153.75s)
=== CONT  TestAccECSTaskDefinition_proxy
--- PASS: TestAccECSTaskDefinition_trackLatest (171.31s)
=== CONT  TestAccECSTaskDefinition_disappears
--- PASS: TestAccECSTaskDefinition_inferenceAccelerator (171.32s)
--- PASS: TestAccECSTaskDefinition_runtimePlatform (171.32s)
=== CONT  TestAccECSTaskDefinition_executionRole
=== CONT  TestAccECSTaskDefinition_constraint
--- PASS: TestAccECSTaskDefinition_Fargate_runtimePlatform (171.33s)
=== CONT  TestAccECSTaskDefinition_Fargate_basic
--- PASS: TestAccECSTaskDefinition_EBSVolumeConfiguredAtLaunch (171.33s)
=== CONT  TestAccECSTaskDefinition_arrays
--- PASS: TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch (171.33s)
=== CONT  TestAccECSTaskDefinition_changeVolumesForcesNewResource
--- PASS: TestAccECSTaskDefinition_DockerVolume_basic (162.28s)
=== CONT  TestAccECSTaskDefinition_networkMode
--- PASS: TestAccECSTaskDefinition_DockerVolume_minimal (171.49s)
=== CONT  TestAccECSTaskDefinition_pidMode
--- PASS: TestAccECSTaskDefinition_scratchVolume (171.50s)
=== CONT  TestAccECSTaskDefinition_ipcMode
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled (260.41s)
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal (268.14s)
--- PASS: TestAccECSTaskDefinition_EFSVolume_basic (269.20s)
--- PASS: TestAccECSTaskDefinition_EFSVolume_minimal (269.32s)
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryption (270.95s)
--- PASS: TestAccECSTaskDefinition_basic (276.31s)
--- PASS: TestAccECSTaskDefinition_arrays (134.74s)
--- PASS: TestAccECSTaskDefinition_proxy (170.41s)
--- PASS: TestAccECSTaskDefinition_taskRoleARN (325.07s)
--- PASS: TestAccECSTaskDefinition_Fargate_basic (158.77s)
--- PASS: TestAccECSTaskDefinition_EFSVolume_accessPoint (334.76s)
--- PASS: TestAccECSTaskDefinition_disappears (170.68s)
--- PASS: TestAccECSTaskDefinition_changeVolumesForcesNewResource (175.93s)
--- PASS: TestAccECSTaskDefinition_constraint (180.75s)
--- PASS: TestAccECSTaskDefinition_pidMode (198.36s)
--- PASS: TestAccECSTaskDefinition_networkMode (198.82s)
--- PASS: TestAccECSTaskDefinition_executionRole (199.55s)
--- PASS: TestAccECSTaskDefinition_ipcMode (200.54s)
--- PASS: TestAccECSTaskDefinition_tags (237.42s)
--- PASS: TestAccECSTaskDefinition_service (415.04s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecs	420.152s

...

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ecs Issues and PRs that pertain to the ecs service. size/M Managed by automation to categorize the size of a PR. labels Mar 22, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 22, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @mcarroll1 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@mcarroll1 mcarroll1 marked this pull request as ready for review March 22, 2024 19:53
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 25, 2024
@ziggythehamster
Copy link
Contributor

This seems to have been implemented at some point:

@mbsimonovic
Copy link

This seems to have been implemented at some point:

a few days ago 5289211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants