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

resource/aws_ecs_service: Add customizable timeouts for Create and Update #25641

Merged
merged 5 commits into from
Jul 4, 2022

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Jul 1, 2022

Adds customizable timeouts for Create and Update operations on aws_ecs_service. In some cases, when wait_for_steady_state is set, deployment takes longer than the default timeout. Allow practitioners to adjust the timeout and extend the default to 20 minutes.

Also fixes various error handling problems that cause "unexpected new value" errors.

Closes #16012
Closes #24565
Closes #24018
Closes #16184
Closes #17118
Closes #18329

Output from acceptance testing:

$ make testacc PKG=ecs TESTS=TestAccECSService_

--- PASS: TestAccECSService_DaemonSchedulingStrategy_basic (98.31s)
--- PASS: TestAccECSService_DeploymentValues_basic (108.75s)
--- PASS: TestAccECSService_DeploymentValues_minZeroMaxOneHundred (125.64s)
--- PASS: TestAccECSService_iamRole (130.64s)
--- PASS: TestAccECSService_deploymentCircuitBreaker (130.70s)
--- PASS: TestAccECSService_DeploymentControllerType_external (132.98s)
--- PASS: TestAccECSService_clusterName (133.57s)
--- PASS: TestAccECSService_Tags_managed (141.17s)
--- PASS: TestAccECSService_PlacementStrategy_missing (13.86s)
--- PASS: TestAccECSService_executeCommand (173.84s)
--- PASS: TestAccECSService_DaemonSchedulingStrategy_setDeploymentMinimum (73.36s)
--- PASS: TestAccECSService_basic (183.62s)
--- PASS: TestAccECSService_ServiceRegistries_container (215.13s)
--- PASS: TestAccECSService_ServiceRegistries_basic (216.72s)
--- PASS: TestAccECSService_Tags_propagate (229.28s)
--- PASS: TestAccECSService_replicaSchedulingStrategy (133.26s)
--- PASS: TestAccECSService_Tags_basic (265.50s)
--- PASS: TestAccECSService_PlacementConstraints_emptyExpression (137.36s)
--- PASS: TestAccECSService_LaunchTypeFargate_waitForSteadyState (203.04s)
--- PASS: TestAccECSService_multipleTargetGroups (339.13s)
--- PASS: TestAccECSService_LaunchTypeEC2_network (228.26s)
--- PASS: TestAccECSService_alb (361.70s)
--- PASS: TestAccECSService_ServiceRegistries_changes (364.16s)
--- PASS: TestAccECSService_DeploymentControllerType_codeDeploy (372.84s)
--- PASS: TestAccECSService_PlacementStrategy_unnormalized (148.74s)
--- PASS: TestAccECSService_PlacementConstraints_basic (217.29s)
--- PASS: TestAccECSService_CapacityProviderStrategy_multiple (188.42s)
--- PASS: TestAccECSService_LaunchTypeFargate_basic (293.72s)
--- PASS: TestAccECSService_renamedCluster (208.23s)
--- PASS: TestAccECSService_familyAndRevision (217.71s)
--- PASS: TestAccECSService_loadBalancerChanges (434.49s)
--- PASS: TestAccECSService_LaunchTypeFargate_platformVersion (308.12s)
--- PASS: TestAccECSService_LaunchTypeFargate_updateWaitForSteadyState (320.23s)
--- PASS: TestAccECSService_CapacityProviderStrategy_forceNewDeployment (237.30s)
--- PASS: TestAccECSService_forceNewDeployment (148.89s)
--- PASS: TestAccECSService_DeploymentControllerType_codeDeployUpdateDesiredCountAndHealthCheckGracePeriod (542.11s)
--- PASS: TestAccECSService_healthCheckGracePeriodSeconds (359.93s)
--- PASS: TestAccECSService_PlacementStrategy_basic (186.44s)
--- PASS: TestAccECSService_CapacityProviderStrategy_basic (272.52s)
--- PASS: TestAccECSService_disappears (228.96s)
--- PASS: TestAccECSService_basicImport (269.20s)
--- PASS: TestAccECSService_CapacityProviderStrategy_update (437.10s)

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/ecs Issues and PRs that pertain to the ecs service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels Jul 1, 2022
@ewbankkit ewbankkit self-assigned this Jul 1, 2022
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 TESTARGS='-run=TestAccECSService_' PKG=ecs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecs/... -v -count 1 -parallel 2  -run=TestAccECSService_ -timeout 180m
=== RUN   TestAccECSService_basic
=== PAUSE TestAccECSService_basic
=== RUN   TestAccECSService_basicImport
=== PAUSE TestAccECSService_basicImport
=== RUN   TestAccECSService_disappears
=== PAUSE TestAccECSService_disappears
=== RUN   TestAccECSService_PlacementStrategy_unnormalized
=== PAUSE TestAccECSService_PlacementStrategy_unnormalized
=== RUN   TestAccECSService_CapacityProviderStrategy_basic
=== PAUSE TestAccECSService_CapacityProviderStrategy_basic
=== RUN   TestAccECSService_CapacityProviderStrategy_forceNewDeployment
=== PAUSE TestAccECSService_CapacityProviderStrategy_forceNewDeployment
=== RUN   TestAccECSService_CapacityProviderStrategy_update
=== PAUSE TestAccECSService_CapacityProviderStrategy_update
=== RUN   TestAccECSService_CapacityProviderStrategy_multiple
=== PAUSE TestAccECSService_CapacityProviderStrategy_multiple
=== RUN   TestAccECSService_familyAndRevision
=== PAUSE TestAccECSService_familyAndRevision
=== RUN   TestAccECSService_renamedCluster
=== PAUSE TestAccECSService_renamedCluster
=== RUN   TestAccECSService_healthCheckGracePeriodSeconds
=== PAUSE TestAccECSService_healthCheckGracePeriodSeconds
=== RUN   TestAccECSService_iamRole
=== PAUSE TestAccECSService_iamRole
=== RUN   TestAccECSService_DeploymentControllerType_codeDeploy
=== PAUSE TestAccECSService_DeploymentControllerType_codeDeploy
=== RUN   TestAccECSService_DeploymentControllerType_codeDeployUpdateDesiredCountAndHealthCheckGracePeriod
=== PAUSE TestAccECSService_DeploymentControllerType_codeDeployUpdateDesiredCountAndHealthCheckGracePeriod
=== RUN   TestAccECSService_DeploymentControllerType_external
=== PAUSE TestAccECSService_DeploymentControllerType_external
=== RUN   TestAccECSService_DeploymentValues_basic
=== PAUSE TestAccECSService_DeploymentValues_basic
=== RUN   TestAccECSService_DeploymentValues_minZeroMaxOneHundred
=== PAUSE TestAccECSService_DeploymentValues_minZeroMaxOneHundred
=== RUN   TestAccECSService_deploymentCircuitBreaker
=== PAUSE TestAccECSService_deploymentCircuitBreaker
=== RUN   TestAccECSService_loadBalancerChanges
=== PAUSE TestAccECSService_loadBalancerChanges
=== RUN   TestAccECSService_clusterName
=== PAUSE TestAccECSService_clusterName
=== RUN   TestAccECSService_alb
=== PAUSE TestAccECSService_alb
=== RUN   TestAccECSService_multipleTargetGroups
=== PAUSE TestAccECSService_multipleTargetGroups
=== RUN   TestAccECSService_forceNewDeployment
=== PAUSE TestAccECSService_forceNewDeployment
=== RUN   TestAccECSService_PlacementStrategy_basic
=== PAUSE TestAccECSService_PlacementStrategy_basic
=== RUN   TestAccECSService_PlacementStrategy_missing
=== PAUSE TestAccECSService_PlacementStrategy_missing
=== RUN   TestAccECSService_PlacementConstraints_basic
=== PAUSE TestAccECSService_PlacementConstraints_basic
=== RUN   TestAccECSService_PlacementConstraints_emptyExpression
=== PAUSE TestAccECSService_PlacementConstraints_emptyExpression
=== RUN   TestAccECSService_LaunchTypeFargate_basic
=== PAUSE TestAccECSService_LaunchTypeFargate_basic
=== RUN   TestAccECSService_LaunchTypeFargate_platformVersion
=== PAUSE TestAccECSService_LaunchTypeFargate_platformVersion
=== RUN   TestAccECSService_LaunchTypeFargate_waitForSteadyState
=== PAUSE TestAccECSService_LaunchTypeFargate_waitForSteadyState
=== RUN   TestAccECSService_LaunchTypeFargate_updateWaitForSteadyState
=== PAUSE TestAccECSService_LaunchTypeFargate_updateWaitForSteadyState
=== RUN   TestAccECSService_LaunchTypeEC2_network
=== PAUSE TestAccECSService_LaunchTypeEC2_network
=== RUN   TestAccECSService_DaemonSchedulingStrategy_basic
=== PAUSE TestAccECSService_DaemonSchedulingStrategy_basic
=== RUN   TestAccECSService_DaemonSchedulingStrategy_setDeploymentMinimum
=== PAUSE TestAccECSService_DaemonSchedulingStrategy_setDeploymentMinimum
=== RUN   TestAccECSService_replicaSchedulingStrategy
=== PAUSE TestAccECSService_replicaSchedulingStrategy
=== RUN   TestAccECSService_ServiceRegistries_basic
=== PAUSE TestAccECSService_ServiceRegistries_basic
=== RUN   TestAccECSService_ServiceRegistries_container
=== PAUSE TestAccECSService_ServiceRegistries_container
=== RUN   TestAccECSService_ServiceRegistries_changes
=== PAUSE TestAccECSService_ServiceRegistries_changes
=== RUN   TestAccECSService_Tags_basic
=== PAUSE TestAccECSService_Tags_basic
=== RUN   TestAccECSService_Tags_managed
=== PAUSE TestAccECSService_Tags_managed
=== RUN   TestAccECSService_Tags_propagate
=== PAUSE TestAccECSService_Tags_propagate
=== RUN   TestAccECSService_executeCommand
=== PAUSE TestAccECSService_executeCommand
=== CONT  TestAccECSService_basic
=== CONT  TestAccECSService_multipleTargetGroups
--- PASS: TestAccECSService_basic (85.08s)
=== CONT  TestAccECSService_iamRole
--- PASS: TestAccECSService_iamRole (58.27s)
=== CONT  TestAccECSService_alb
--- PASS: TestAccECSService_multipleTargetGroups (266.06s)
=== CONT  TestAccECSService_clusterName
--- PASS: TestAccECSService_clusterName (83.07s)
=== CONT  TestAccECSService_loadBalancerChanges
--- PASS: TestAccECSService_alb (314.07s)
=== CONT  TestAccECSService_deploymentCircuitBreaker
--- PASS: TestAccECSService_loadBalancerChanges (191.09s)
=== CONT  TestAccECSService_DeploymentValues_minZeroMaxOneHundred
--- PASS: TestAccECSService_deploymentCircuitBreaker (84.22s)
=== CONT  TestAccECSService_DeploymentValues_basic
--- PASS: TestAccECSService_DeploymentValues_basic (74.27s)
=== CONT  TestAccECSService_DeploymentControllerType_external
--- PASS: TestAccECSService_DeploymentValues_minZeroMaxOneHundred (86.20s)
=== CONT  TestAccECSService_DeploymentControllerType_codeDeployUpdateDesiredCountAndHealthCheckGracePeriod
--- PASS: TestAccECSService_DeploymentControllerType_external (53.57s)
=== CONT  TestAccECSService_DeploymentControllerType_codeDeploy
--- PASS: TestAccECSService_DeploymentControllerType_codeDeploy (245.89s)
=== CONT  TestAccECSService_DaemonSchedulingStrategy_basic
--- PASS: TestAccECSService_DaemonSchedulingStrategy_basic (37.69s)
=== CONT  TestAccECSService_executeCommand
--- PASS: TestAccECSService_DeploymentControllerType_codeDeployUpdateDesiredCountAndHealthCheckGracePeriod (389.24s)
=== CONT  TestAccECSService_Tags_propagate
--- PASS: TestAccECSService_executeCommand (108.13s)
=== CONT  TestAccECSService_ServiceRegistries_basic
--- PASS: TestAccECSService_Tags_propagate (102.52s)
=== CONT  TestAccECSService_replicaSchedulingStrategy
--- PASS: TestAccECSService_replicaSchedulingStrategy (93.28s)
=== CONT  TestAccECSService_DaemonSchedulingStrategy_setDeploymentMinimum
--- PASS: TestAccECSService_ServiceRegistries_basic (154.54s)
=== CONT  TestAccECSService_CapacityProviderStrategy_update
--- PASS: TestAccECSService_DaemonSchedulingStrategy_setDeploymentMinimum (37.06s)
=== CONT  TestAccECSService_healthCheckGracePeriodSeconds
--- PASS: TestAccECSService_healthCheckGracePeriodSeconds (320.43s)
=== CONT  TestAccECSService_renamedCluster
--- PASS: TestAccECSService_CapacityProviderStrategy_update (389.03s)
=== CONT  TestAccECSService_familyAndRevision
--- PASS: TestAccECSService_renamedCluster (85.79s)
=== CONT  TestAccECSService_CapacityProviderStrategy_multiple
--- PASS: TestAccECSService_familyAndRevision (82.94s)
=== CONT  TestAccECSService_LaunchTypeFargate_basic
--- PASS: TestAccECSService_LaunchTypeFargate_basic (157.77s)
=== CONT  TestAccECSService_LaunchTypeEC2_network
--- PASS: TestAccECSService_LaunchTypeEC2_network (89.93s)
=== CONT  TestAccECSService_LaunchTypeFargate_updateWaitForSteadyState
--- PASS: TestAccECSService_LaunchTypeFargate_updateWaitForSteadyState (181.00s)
=== CONT  TestAccECSService_LaunchTypeFargate_waitForSteadyState
--- PASS: TestAccECSService_LaunchTypeFargate_waitForSteadyState (197.72s)
=== CONT  TestAccECSService_ServiceRegistries_container
--- PASS: TestAccECSService_CapacityProviderStrategy_multiple (805.72s)
=== CONT  TestAccECSService_Tags_managed
--- PASS: TestAccECSService_ServiceRegistries_container (170.08s)
=== CONT  TestAccECSService_Tags_basic
--- PASS: TestAccECSService_Tags_managed (61.58s)
=== CONT  TestAccECSService_ServiceRegistries_changes
--- PASS: TestAccECSService_Tags_basic (100.65s)
=== CONT  TestAccECSService_LaunchTypeFargate_platformVersion
--- PASS: TestAccECSService_ServiceRegistries_changes (279.67s)
=== CONT  TestAccECSService_PlacementStrategy_unnormalized
--- PASS: TestAccECSService_PlacementStrategy_unnormalized (84.15s)
=== CONT  TestAccECSService_PlacementStrategy_missing
--- PASS: TestAccECSService_PlacementStrategy_missing (0.86s)
=== CONT  TestAccECSService_PlacementConstraints_emptyExpression
--- PASS: TestAccECSService_PlacementConstraints_emptyExpression (75.16s)
=== CONT  TestAccECSService_CapacityProviderStrategy_forceNewDeployment
--- PASS: TestAccECSService_CapacityProviderStrategy_forceNewDeployment (204.33s)
=== CONT  TestAccECSService_PlacementConstraints_basic
--- PASS: TestAccECSService_PlacementConstraints_basic (73.24s)
=== CONT  TestAccECSService_CapacityProviderStrategy_basic
--- PASS: TestAccECSService_LaunchTypeFargate_platformVersion (811.14s)
=== CONT  TestAccECSService_forceNewDeployment
--- PASS: TestAccECSService_forceNewDeployment (77.79s)
=== CONT  TestAccECSService_disappears
--- PASS: TestAccECSService_CapacityProviderStrategy_basic (250.73s)
=== CONT  TestAccECSService_PlacementStrategy_basic
--- PASS: TestAccECSService_PlacementStrategy_basic (113.40s)
=== CONT  TestAccECSService_basicImport
--- PASS: TestAccECSService_disappears (188.60s)
--- PASS: TestAccECSService_basicImport (218.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecs	3826.078s

@ewbankkit ewbankkit removed their assignment Jul 1, 2022
@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Jul 1, 2022
@gdavison gdavison merged commit 9af6805 into main Jul 4, 2022
@gdavison gdavison deleted the ecs-service-timeout branch July 4, 2022 19:23
@github-actions github-actions bot added this to the v4.22.0 milestone Jul 4, 2022
github-actions bot pushed a commit that referenced this pull request Jul 4, 2022
@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This functionality has been released in v4.22.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 Aug 7, 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 Aug 7, 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
2 participants