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

Normalize aws_ecs_task_definition healthCheck #38872

Merged

Conversation

t0yv0
Copy link
Contributor

@t0yv0 t0yv0 commented Aug 14, 2024

Description

Prevent perma-diff on task definitions that define a health check.

The change extends the diff normalization to consider task definitions that differ only in healthCheck fields being set to default values or unset as equivalent.

Affected resources: aws_ecs_task_definition

Relations

Relates #11526

References

This should go a long way toward closing #11526 though there might be still some residual scenarios that require additional normalization. 11526 has many scenarios listed.

Output from Acceptance Testing

% make testacc TESTS=TestAccXXX PKG=ec2

...

Prevent perma-diff on task definitions that define a health check.

The change extends the diff normalization to consider task definitions that differ only in healthCheck fields being set
to default values or unset as equivalent.

Affected resources: aws_ecs_task_definition
@t0yv0 t0yv0 requested a review from a team as a code owner August 14, 2024 19:43
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. needs-triage Waiting for first response or review from a maintainer. labels Aug 14, 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 @t0yv0 👋

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

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Aug 15, 2024
@ewbankkit
Copy link
Contributor

Defaults are defined here.

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Aug 15, 2024
@ewbankkit ewbankkit self-assigned this Aug 15, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 15, 2024
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-short TESTARGS='-run=TestAccECSTaskDefinition_' PKG=ecs ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
Running acceptance tests with -short flag
TF_ACC=1 go1.22.6 test ./internal/service/ecs/... -v -short -count 1 -parallel 3  -run=TestAccECSTaskDefinition_ -timeout 360m
=== RUN   TestAccECSTaskDefinition_basic
=== PAUSE TestAccECSTaskDefinition_basic
=== RUN   TestAccECSTaskDefinition_scratchVolume
=== PAUSE TestAccECSTaskDefinition_scratchVolume
=== RUN   TestAccECSTaskDefinition_configuredAtLaunch
=== PAUSE TestAccECSTaskDefinition_configuredAtLaunch
=== 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
    task_definition_test.go:609: 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
=== RUN   TestAccECSTaskDefinition_unknownContainerDefinitions
=== PAUSE TestAccECSTaskDefinition_unknownContainerDefinitions
=== RUN   TestAccECSTaskDefinition_v5590ContainerDefinitionsRegression
=== PAUSE TestAccECSTaskDefinition_v5590ContainerDefinitionsRegression
=== RUN   TestAccECSTaskDefinition_containerDefinitionEmptyPortMappings
=== PAUSE TestAccECSTaskDefinition_containerDefinitionEmptyPortMappings
=== RUN   TestAccECSTaskDefinition_containerDefinitionDockerLabels
=== PAUSE TestAccECSTaskDefinition_containerDefinitionDockerLabels
=== RUN   TestAccECSTaskDefinition_containerDefinitionNullPortMapping
=== PAUSE TestAccECSTaskDefinition_containerDefinitionNullPortMapping
=== CONT  TestAccECSTaskDefinition_basic
=== CONT  TestAccECSTaskDefinition_pidMode
=== CONT  TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal
--- PASS: TestAccECSTaskDefinition_pidMode (12.34s)
=== CONT  TestAccECSTaskDefinition_proxy
--- PASS: TestAccECSTaskDefinition_basic (18.98s)
=== CONT  TestAccECSTaskDefinition_containerDefinitionNullPortMapping
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryptionMinimal (20.42s)
=== CONT  TestAccECSTaskDefinition_containerDefinitionDockerLabels
--- PASS: TestAccECSTaskDefinition_containerDefinitionNullPortMapping (8.89s)
=== CONT  TestAccECSTaskDefinition_containerDefinitionEmptyPortMappings
--- PASS: TestAccECSTaskDefinition_containerDefinitionDockerLabels (8.79s)
=== CONT  TestAccECSTaskDefinition_v5590ContainerDefinitionsRegression
--- PASS: TestAccECSTaskDefinition_proxy (23.56s)
=== CONT  TestAccECSTaskDefinition_unknownContainerDefinitions
--- PASS: TestAccECSTaskDefinition_unknownContainerDefinitions (13.43s)
=== CONT  TestAccECSTaskDefinition_trackLatest
--- PASS: TestAccECSTaskDefinition_trackLatest (12.14s)
=== CONT  TestAccECSTaskDefinition_invalidContainerDefinition
--- PASS: TestAccECSTaskDefinition_invalidContainerDefinition (1.71s)
=== CONT  TestAccECSTaskDefinition_inferenceAccelerator
--- PASS: TestAccECSTaskDefinition_inferenceAccelerator (11.84s)
=== CONT  TestAccECSTaskDefinition_runtimePlatform
--- PASS: TestAccECSTaskDefinition_runtimePlatform (14.06s)
=== CONT  TestAccECSTaskDefinition_EFSVolume_basic
--- PASS: TestAccECSTaskDefinition_EFSVolume_basic (22.17s)
=== CONT  TestAccECSTaskDefinition_EFSVolume_minimal
--- PASS: TestAccECSTaskDefinition_v5590ContainerDefinitionsRegression (92.56s)
=== CONT  TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch
--- PASS: TestAccECSTaskDefinition_EFSVolume_minimal (21.53s)
=== CONT  TestAccECSTaskDefinition_Fargate_runtimePlatform
--- PASS: TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch (11.39s)
=== CONT  TestAccECSTaskDefinition_DockerVolume_basic
--- PASS: TestAccECSTaskDefinition_Fargate_runtimePlatform (12.16s)
=== CONT  TestAccECSTaskDefinition_DockerVolume_minimal
--- PASS: TestAccECSTaskDefinition_DockerVolume_basic (11.99s)
=== CONT  TestAccECSTaskDefinition_configuredAtLaunch
=== CONT  TestAccECSTaskDefinition_Fargate_ephemeralStorage
--- PASS: TestAccECSTaskDefinition_containerDefinitionEmptyPortMappings (126.76s)
--- PASS: TestAccECSTaskDefinition_DockerVolume_minimal (10.88s)
=== CONT  TestAccECSTaskDefinition_service
--- PASS: TestAccECSTaskDefinition_configuredAtLaunch (11.05s)
=== CONT  TestAccECSTaskDefinition_tags
--- PASS: TestAccECSTaskDefinition_Fargate_ephemeralStorage (10.76s)
=== CONT  TestAccECSTaskDefinition_disappears
--- PASS: TestAccECSTaskDefinition_disappears (15.63s)
=== CONT  TestAccECSTaskDefinition_ipcMode
--- PASS: TestAccECSTaskDefinition_tags (35.12s)
=== CONT  TestAccECSTaskDefinition_executionRole
--- PASS: TestAccECSTaskDefinition_ipcMode (11.63s)
=== CONT  TestAccECSTaskDefinition_networkMode
--- PASS: TestAccECSTaskDefinition_executionRole (11.80s)
=== CONT  TestAccECSTaskDefinition_EFSVolume_accessPoint
--- PASS: TestAccECSTaskDefinition_networkMode (11.40s)
=== CONT  TestAccECSTaskDefinition_taskRoleARN
--- PASS: TestAccECSTaskDefinition_taskRoleARN (11.56s)
=== CONT  TestAccECSTaskDefinition_DockerVolume_taskScoped
--- PASS: TestAccECSTaskDefinition_DockerVolume_taskScoped (8.54s)
=== CONT  TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled
--- PASS: TestAccECSTaskDefinition_EFSVolume_accessPoint (24.48s)
=== CONT  TestAccECSTaskDefinition_arrays
--- PASS: TestAccECSTaskDefinition_arrays (10.88s)
=== CONT  TestAccECSTaskDefinition_Fargate_basic
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryptionDisabled (19.52s)
=== CONT  TestAccECSTaskDefinition_EFSVolume_transitEncryption
--- PASS: TestAccECSTaskDefinition_Fargate_basic (13.75s)
=== CONT  TestAccECSTaskDefinition_changeVolumesForcesNewResource
--- PASS: TestAccECSTaskDefinition_EFSVolume_transitEncryption (19.67s)
=== CONT  TestAccECSTaskDefinition_scratchVolume
--- PASS: TestAccECSTaskDefinition_service (109.67s)
=== CONT  TestAccECSTaskDefinition_constraint
--- PASS: TestAccECSTaskDefinition_changeVolumesForcesNewResource (17.78s)
--- PASS: TestAccECSTaskDefinition_scratchVolume (11.07s)
--- PASS: TestAccECSTaskDefinition_constraint (12.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecs	282.957s

@ewbankkit
Copy link
Contributor

@t0yv0 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 1b0ede5 into hashicorp:main Aug 15, 2024
34 checks passed
@github-actions github-actions bot added this to the v5.63.0 milestone Aug 15, 2024
Copy link

This functionality has been released in v5.63.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 15, 2024
Copy link

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 Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service. 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.

2 participants