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

r/ecs - Add support for FARGATE Windows Containers and ARM based Containers #22016

Merged
merged 3 commits into from
Dec 7, 2021
Merged

Conversation

ChrisMcKee
Copy link
Contributor

@ChrisMcKee ChrisMcKee commented Dec 2, 2021

Adds platform runtime properties and validation based on https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html

  runtime_platform {
    operating_system_family = "WINDOWS_SERVER_2019_CORE"
    cpu_architecture = "X86_64"
  }

Adds documentation for new fields (but no new examples; I'd happily add examples for windows fargate if its wanted, I didn't want to bloat the document)

Community Note

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

Closes #21706
Closes #22033

Output from acceptance testing:

make testacc TESTS=TestAccECSTaskDefinition_withRuntimePlatform PKG=ecs
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSTaskDefinition_withRuntimePlatform' -timeout 180m
=== RUN   TestAccECSTaskDefinition_withRuntimePlatform
=== PAUSE TestAccECSTaskDefinition_withRuntimePlatform
=== CONT  TestAccECSTaskDefinition_withRuntimePlatform
--- PASS: TestAccECSTaskDefinition_withRuntimePlatform (14.22s)
PASS
ok  


make testacc TESTS=TestAccECSTaskDefinition_Fargate_withRuntimePlatform PKG=ecs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSTaskDefinition_Fargate_withRuntimePlatform' -timeout 180m
=== RUN   TestAccECSTaskDefinition_Fargate_withRuntimePlatform
=== PAUSE TestAccECSTaskDefinition_Fargate_withRuntimePlatform
=== CONT  TestAccECSTaskDefinition_Fargate_withRuntimePlatform
--- PASS: TestAccECSTaskDefinition_Fargate_withRuntimePlatform (14.57s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecs        14.620s
...

@github-actions github-actions bot added service/ecs Issues and PRs that pertain to the ecs service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/M Managed by automation to categorize the size of a PR. labels Dec 2, 2021
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 @ChrisMcKee 👋

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 CONTRIBUTING 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! 😃

@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Dec 2, 2021
@ChrisMcKee ChrisMcKee marked this pull request as ready for review December 2, 2021 17:46
@ChrisMcKee ChrisMcKee changed the title [wip]Add support for FARGATE Windows Containers and ARM based Containers Add support for FARGATE Windows Containers and ARM based Containers Dec 2, 2021
@ChrisMcKee ChrisMcKee changed the title Add support for FARGATE Windows Containers and ARM based Containers r/ecs - Add support for FARGATE Windows Containers and ARM based Containers Dec 2, 2021
internal/service/ecs/task_definition.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Dec 2, 2021
@ChrisMcKee
Copy link
Contributor Author

make testacc TESTS=TestAccECSTaskDefinition_withRuntimePlatform PKG=ecs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSTaskDefinition_withRuntimePlatform' -timeout 180m
=== RUN   TestAccECSTaskDefinition_withRuntimePlatform
=== PAUSE TestAccECSTaskDefinition_withRuntimePlatform
=== CONT  TestAccECSTaskDefinition_withRuntimePlatform
--- PASS: TestAccECSTaskDefinition_withRuntimePlatform (24.44s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecs        24.483s


make testacc TESTS=TestAccECSTaskDefinition_Fargate_withRuntimePlatform PKG=ecs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSTaskDefinition_Fargate_withRuntimePlatform' -timeout 180m
=== RUN   TestAccECSTaskDefinition_Fargate_withRuntimePlatform
=== PAUSE TestAccECSTaskDefinition_Fargate_withRuntimePlatform
=== CONT  TestAccECSTaskDefinition_Fargate_withRuntimePlatform
--- PASS: TestAccECSTaskDefinition_Fargate_withRuntimePlatform (14.03s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecs        14.075s

The time on the first ones higher as I ran the thing in US West (forgot to set my region env)

@ChrisMcKee
Copy link
Contributor Author

Installed the provider locally after the change and updated my test wireup

Definition outputs fine
task definition diff

validations correct
validation test

single runtime_platform restriction

@DrFaust92 DrFaust92 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 Dec 2, 2021
internal/service/ecs/task_definition.go Outdated Show resolved Hide resolved
internal/service/ecs/task_definition.go Outdated Show resolved Hide resolved
internal/service/ecs/task_definition.go Outdated Show resolved Hide resolved
internal/service/ecs/task_definition_test.go Show resolved Hide resolved
internal/service/ecs/task_definition_test.go Show resolved Hide resolved
```
  runtime_platform {
    operating_system_family  = "LINUX"
    cpu_architecture         = "X86_64"
  }
```
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Dec 6, 2021
@ChrisMcKee
Copy link
Contributor Author

ChrisMcKee commented Dec 6, 2021

I squashed / cleaned up the pr and corrected some the action results that don't seem to be repeated when a prs updated in the checks here. So thats all green now
image

Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTS=TestAccECSTaskDefinition_ PKG=ecs                                                
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSTaskDefinition_' -timeout 180m
=== RUN   TestAccECSTaskDefinition_basic
=== PAUSE TestAccECSTaskDefinition_basic
=== RUN   TestAccECSTaskDefinition_withScratchVolume
=== PAUSE TestAccECSTaskDefinition_withScratchVolume
=== RUN   TestAccECSTaskDefinition_withDockerVolume
=== PAUSE TestAccECSTaskDefinition_withDockerVolume
=== RUN   TestAccECSTaskDefinition_withDockerVolumeMinimal
=== PAUSE TestAccECSTaskDefinition_withDockerVolumeMinimal
=== RUN   TestAccECSTaskDefinition_withRuntimePlatform
=== PAUSE TestAccECSTaskDefinition_withRuntimePlatform
=== RUN   TestAccECSTaskDefinition_Fargate_withRuntimePlatform
=== PAUSE TestAccECSTaskDefinition_Fargate_withRuntimePlatform
=== RUN   TestAccECSTaskDefinition_Fargate_withRuntimePlatformWithoutArch
=== PAUSE TestAccECSTaskDefinition_Fargate_withRuntimePlatformWithoutArch
=== RUN   TestAccECSTaskDefinition_withEFSVolumeMinimal
=== PAUSE TestAccECSTaskDefinition_withEFSVolumeMinimal
=== RUN   TestAccECSTaskDefinition_withEFSVolume
=== PAUSE TestAccECSTaskDefinition_withEFSVolume
=== RUN   TestAccECSTaskDefinition_withTransitEncryptionEFSVolume
=== PAUSE TestAccECSTaskDefinition_withTransitEncryptionEFSVolume
=== RUN   TestAccECSTaskDefinition_withEFSAccessPoint
=== PAUSE TestAccECSTaskDefinition_withEFSAccessPoint
=== RUN   TestAccECSTaskDefinition_withFSxWinFileSystem
=== PAUSE TestAccECSTaskDefinition_withFSxWinFileSystem
=== RUN   TestAccECSTaskDefinition_withTaskScopedDockerVolume
=== PAUSE TestAccECSTaskDefinition_withTaskScopedDockerVolume
=== RUN   TestAccECSTaskDefinition_withECSService
=== PAUSE TestAccECSTaskDefinition_withECSService
=== RUN   TestAccECSTaskDefinition_withTaskRoleARN
=== PAUSE TestAccECSTaskDefinition_withTaskRoleARN
=== RUN   TestAccECSTaskDefinition_withNetworkMode
=== PAUSE TestAccECSTaskDefinition_withNetworkMode
=== RUN   TestAccECSTaskDefinition_withIPCMode
=== PAUSE TestAccECSTaskDefinition_withIPCMode
=== RUN   TestAccECSTaskDefinition_withPidMode
=== PAUSE TestAccECSTaskDefinition_withPidMode
=== RUN   TestAccECSTaskDefinition_constraint
=== PAUSE TestAccECSTaskDefinition_constraint
=== RUN   TestAccECSTaskDefinition_changeVolumesForcesNewResource
=== PAUSE TestAccECSTaskDefinition_changeVolumesForcesNewResource
=== RUN   TestAccECSTaskDefinition_arrays
=== PAUSE TestAccECSTaskDefinition_arrays
=== RUN   TestAccECSTaskDefinition_fargate
=== PAUSE TestAccECSTaskDefinition_fargate
=== 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
=== CONT  TestAccECSTaskDefinition_basic
=== CONT  TestAccECSTaskDefinition_withNetworkMode
=== CONT  TestAccECSTaskDefinition_executionRole
=== CONT  TestAccECSTaskDefinition_withECSService
=== CONT  TestAccECSTaskDefinition_inferenceAccelerator
=== CONT  TestAccECSTaskDefinition_proxy
=== CONT  TestAccECSTaskDefinition_tags
=== CONT  TestAccECSTaskDefinition_withEFSVolume
=== CONT  TestAccECSTaskDefinition_disappears
=== CONT  TestAccECSTaskDefinition_withTaskRoleARN
=== CONT  TestAccECSTaskDefinition_withTaskScopedDockerVolume
=== CONT  TestAccECSTaskDefinition_withFSxWinFileSystem
=== CONT  TestAccECSTaskDefinition_withEFSAccessPoint
=== CONT  TestAccECSTaskDefinition_Fargate_ephemeralStorage
=== CONT  TestAccECSTaskDefinition_fargate
=== CONT  TestAccECSTaskDefinition_arrays
=== CONT  TestAccECSTaskDefinition_changeVolumesForcesNewResource
=== CONT  TestAccECSTaskDefinition_constraint
=== CONT  TestAccECSTaskDefinition_withRuntimePlatform
=== CONT  TestAccECSTaskDefinition_withTransitEncryptionEFSVolume
--- PASS: TestAccECSTaskDefinition_Fargate_ephemeralStorage (48.15s)
=== CONT  TestAccECSTaskDefinition_withPidMode
--- PASS: TestAccECSTaskDefinition_arrays (48.34s)
=== CONT  TestAccECSTaskDefinition_withIPCMode
--- PASS: TestAccECSTaskDefinition_inferenceAccelerator (48.40s)
=== CONT  TestAccECSTaskDefinition_withDockerVolume
--- PASS: TestAccECSTaskDefinition_withRuntimePlatform (49.05s)
=== CONT  TestAccECSTaskDefinition_withDockerVolumeMinimal
--- PASS: TestAccECSTaskDefinition_withTaskScopedDockerVolume (49.75s)
=== CONT  TestAccECSTaskDefinition_withEFSVolumeMinimal
--- PASS: TestAccECSTaskDefinition_withTaskRoleARN (52.59s)
=== CONT  TestAccECSTaskDefinition_withScratchVolume
--- PASS: TestAccECSTaskDefinition_constraint (52.77s)
=== CONT  TestAccECSTaskDefinition_Fargate_withRuntimePlatformWithoutArch
--- PASS: TestAccECSTaskDefinition_withNetworkMode (52.81s)
=== CONT  TestAccECSTaskDefinition_Fargate_withRuntimePlatform
--- PASS: TestAccECSTaskDefinition_executionRole (53.41s)
--- PASS: TestAccECSTaskDefinition_withEFSVolume (61.99s)
--- PASS: TestAccECSTaskDefinition_proxy (63.02s)
--- PASS: TestAccECSTaskDefinition_withTransitEncryptionEFSVolume (63.48s)
--- PASS: TestAccECSTaskDefinition_fargate (65.93s)
--- PASS: TestAccECSTaskDefinition_withEFSAccessPoint (68.91s)
--- PASS: TestAccECSTaskDefinition_disappears (69.03s)
--- PASS: TestAccECSTaskDefinition_basic (74.58s)
--- PASS: TestAccECSTaskDefinition_changeVolumesForcesNewResource (75.26s)
--- PASS: TestAccECSTaskDefinition_withDockerVolume (32.76s)
--- PASS: TestAccECSTaskDefinition_withDockerVolumeMinimal (32.29s)
--- PASS: TestAccECSTaskDefinition_withScratchVolume (29.29s)
--- PASS: TestAccECSTaskDefinition_withIPCMode (33.55s)
--- PASS: TestAccECSTaskDefinition_withPidMode (33.93s)
--- PASS: TestAccECSTaskDefinition_Fargate_withRuntimePlatform (29.90s)
--- PASS: TestAccECSTaskDefinition_Fargate_withRuntimePlatformWithoutArch (30.10s)
--- PASS: TestAccECSTaskDefinition_withEFSVolumeMinimal (38.15s)
--- PASS: TestAccECSTaskDefinition_tags (90.74s)
--- PASS: TestAccECSTaskDefinition_withECSService (133.30s)
--- PASS: TestAccECSTaskDefinition_withFSxWinFileSystem (3138.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecs	3141.532s

@ewbankkit
Copy link
Contributor

@ChrisMcKee Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 546507e into hashicorp:main Dec 7, 2021
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 7, 2021
@github-actions
Copy link

This functionality has been released in v3.69.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!

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service. size/XL 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
4 participants