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_autoscaling_group: Fix autoscaling groups stuck in pending instance refresh #21777

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Nov 15, 2021

When an instance refresh is triggered, an empty checkpoint_percentages array is sent, causing the refresh to hang.

Closes #21656

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAutoScalingGroup_' PKG_NAME=internal/service/autoscaling

--- PASS: TestAccAutoScalingGroup_Name_generated (82.71s)
--- PASS: TestAccAutoScalingGroup_serviceLinkedRoleARN (92.82s)
--- PASS: TestAccAutoScalingGroup_namePrefix (98.25s)
--- PASS: TestAccAutoScalingGroup_withMetrics (135.95s)
--- PASS: TestAccAutoScalingGroup_vpcUpdates (152.26s)
--- PASS: TestAccAutoScalingGroup_maxInstanceLifetime (164.74s)
--- PASS: TestAccAutoScalingGroup_withPlacementGroup (184.06s)
--- PASS: TestAccAutoScalingGroup_classicVPCZoneIdentifier (60.14s)
--- PASS: TestAccAutoScalingGroup_enablingMetrics (205.51s)
--- PASS: TestAccAutoScalingGroup_ALB_targetGroups (226.85s)
--- PASS: TestAccAutoScalingGroup_launchTemplate (83.09s)
--- PASS: TestAccAutoScalingGroup_terminationPolicies (227.02s)
--- PASS: TestAccAutoScalingGroup_LaunchTemplate_iamInstanceProfile (91.73s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicy_capacityRebalance (84.62s)
--- PASS: TestAccAutoScalingGroup_mixedInstancesPolicy (94.62s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandAllocationStrategy (82.09s)
--- PASS: TestAccAutoScalingGroup_withLoadBalancer (316.11s)
--- PASS: TestAccAutoScalingGroup_targetGroupARNs (247.27s)
--- PASS: TestAccAutoScalingGroup_tags (324.58s)
--- PASS: TestAccAutoScalingGroup_initialLifecycleHook (255.66s)
--- PASS: TestAccAutoScalingGroup_suspendingProcesses (340.38s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_start (252.40s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_updateToZeroOnDemandBaseCapacity (125.79s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotAllocationStrategy (68.93s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandPercentageAboveBaseCapacity (123.95s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_triggers (285.23s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_basic (292.85s)
--- PASS: TestAccAutoScalingGroup_LaunchTemplate_update (236.38s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_launchTemplateName (81.55s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceTypeWithLaunchTemplateSpecification (67.28s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandBaseCapacity (183.85s)
--- PASS: TestAccAutoScalingGroup_WithLoadBalancer_toTargetGroup (417.13s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotInstancePools (125.47s)
--- PASS: TestAccAutoScalingGroup_launchTempPartitionNum (69.82s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_version (102.93s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotMaxPrice (120.79s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceType (107.33s)
--- PASS: TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity (393.42s)
--- PASS: TestAccAutoScalingGroup_basic (560.43s)
--- PASS: TestAccAutoScalingGroup_loadBalancers (385.28s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weightedCapacity (235.15s)
--- PASS: TestAccAutoScalingGroup_warmPool (508.48s)

@github-actions github-actions bot added service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. and removed tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/autoscaling Issues and PRs that pertain to the autoscaling service. labels Nov 15, 2021
@gdavison gdavison marked this pull request as ready for review November 15, 2021 22:30
@github-actions github-actions bot added service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 16, 2021
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=TestAccAutoScalingGroup_' PKG_NAME=internal/service/autoscaling
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/autoscaling/... -v -count 1 -parallel 20 -run=TestAccAutoScalingGroup_ -timeout 180m
=== RUN   TestAccAutoScalingGroup_basic
=== PAUSE TestAccAutoScalingGroup_basic
=== RUN   TestAccAutoScalingGroup_Name_generated
=== PAUSE TestAccAutoScalingGroup_Name_generated
=== RUN   TestAccAutoScalingGroup_namePrefix
=== PAUSE TestAccAutoScalingGroup_namePrefix
=== RUN   TestAccAutoScalingGroup_terminationPolicies
=== PAUSE TestAccAutoScalingGroup_terminationPolicies
=== RUN   TestAccAutoScalingGroup_tags
=== PAUSE TestAccAutoScalingGroup_tags
=== RUN   TestAccAutoScalingGroup_vpcUpdates
=== PAUSE TestAccAutoScalingGroup_vpcUpdates
=== RUN   TestAccAutoScalingGroup_withLoadBalancer
=== PAUSE TestAccAutoScalingGroup_withLoadBalancer
=== RUN   TestAccAutoScalingGroup_WithLoadBalancer_toTargetGroup
=== PAUSE TestAccAutoScalingGroup_WithLoadBalancer_toTargetGroup
=== RUN   TestAccAutoScalingGroup_withPlacementGroup
=== PAUSE TestAccAutoScalingGroup_withPlacementGroup
=== RUN   TestAccAutoScalingGroup_enablingMetrics
=== PAUSE TestAccAutoScalingGroup_enablingMetrics
=== RUN   TestAccAutoScalingGroup_suspendingProcesses
=== PAUSE TestAccAutoScalingGroup_suspendingProcesses
=== RUN   TestAccAutoScalingGroup_withMetrics
=== PAUSE TestAccAutoScalingGroup_withMetrics
=== RUN   TestAccAutoScalingGroup_serviceLinkedRoleARN
=== PAUSE TestAccAutoScalingGroup_serviceLinkedRoleARN
=== RUN   TestAccAutoScalingGroup_maxInstanceLifetime
=== PAUSE TestAccAutoScalingGroup_maxInstanceLifetime
=== RUN   TestAccAutoScalingGroup_ALB_targetGroups
=== PAUSE TestAccAutoScalingGroup_ALB_targetGroups
=== RUN   TestAccAutoScalingGroup_targetGroupARNs
=== PAUSE TestAccAutoScalingGroup_targetGroupARNs
=== RUN   TestAccAutoScalingGroup_initialLifecycleHook
=== PAUSE TestAccAutoScalingGroup_initialLifecycleHook
=== RUN   TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity
=== PAUSE TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_basic
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_basic
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_start
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_start
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_triggers
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_triggers
=== RUN   TestAccAutoScalingGroup_warmPool
=== PAUSE TestAccAutoScalingGroup_warmPool
=== RUN   TestAccAutoScalingGroup_classicVPCZoneIdentifier
=== PAUSE TestAccAutoScalingGroup_classicVPCZoneIdentifier
=== RUN   TestAccAutoScalingGroup_launchTemplate
=== PAUSE TestAccAutoScalingGroup_launchTemplate
=== RUN   TestAccAutoScalingGroup_LaunchTemplate_update
=== PAUSE TestAccAutoScalingGroup_LaunchTemplate_update
=== RUN   TestAccAutoScalingGroup_LaunchTemplate_iamInstanceProfile
=== PAUSE TestAccAutoScalingGroup_LaunchTemplate_iamInstanceProfile
=== RUN   TestAccAutoScalingGroup_loadBalancers
=== PAUSE TestAccAutoScalingGroup_loadBalancers
=== RUN   TestAccAutoScalingGroup_mixedInstancesPolicy
=== PAUSE TestAccAutoScalingGroup_mixedInstancesPolicy
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicy_capacityRebalance
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicy_capacityRebalance
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandAllocationStrategy
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandAllocationStrategy
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandBaseCapacity
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandBaseCapacity
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_updateToZeroOnDemandBaseCapacity
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_updateToZeroOnDemandBaseCapacity
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandPercentageAboveBaseCapacity
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandPercentageAboveBaseCapacity
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotAllocationStrategy
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotAllocationStrategy
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotInstancePools
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotInstancePools
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotMaxPrice
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotMaxPrice
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_launchTemplateName
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_launchTemplateName
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_version
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_version
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceType
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceType
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceTypeWithLaunchTemplateSpecification
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceTypeWithLaunchTemplateSpecification
=== RUN   TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weightedCapacity
=== PAUSE TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weightedCapacity
=== RUN   TestAccAutoScalingGroup_launchTempPartitionNum
=== PAUSE TestAccAutoScalingGroup_launchTempPartitionNum
=== CONT  TestAccAutoScalingGroup_basic
=== CONT  TestAccAutoScalingGroup_initialLifecycleHook
=== CONT  TestAccAutoScalingGroup_WithLoadBalancer_toTargetGroup
=== CONT  TestAccAutoScalingGroup_enablingMetrics
=== CONT  TestAccAutoScalingGroup_launchTempPartitionNum
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weightedCapacity
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceTypeWithLaunchTemplateSpecification
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceType
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_version
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_launchTemplateName
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotMaxPrice
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotInstancePools
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotAllocationStrategy
=== CONT  TestAccAutoScalingGroup_tags
=== CONT  TestAccAutoScalingGroup_withPlacementGroup
=== CONT  TestAccAutoScalingGroup_withMetrics
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandPercentageAboveBaseCapacity
=== CONT  TestAccAutoScalingGroup_suspendingProcesses
=== CONT  TestAccAutoScalingGroup_terminationPolicies
=== CONT  TestAccAutoScalingGroup_serviceLinkedRoleARN
--- PASS: TestAccAutoScalingGroup_serviceLinkedRoleARN (79.18s)
=== CONT  TestAccAutoScalingGroup_withLoadBalancer
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotAllocationStrategy (80.34s)
=== CONT  TestAccAutoScalingGroup_namePrefix
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_launchTemplateName (86.44s)
=== CONT  TestAccAutoScalingGroup_LaunchTemplate_update
--- PASS: TestAccAutoScalingGroup_launchTempPartitionNum (88.59s)
=== CONT  TestAccAutoScalingGroup_Name_generated
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceTypeWithLaunchTemplateSpecification (95.72s)
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_updateToZeroOnDemandBaseCapacity
--- PASS: TestAccAutoScalingGroup_withMetrics (129.41s)
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandBaseCapacity
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotInstancePools (136.11s)
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandAllocationStrategy
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceType (138.33s)
=== CONT  TestAccAutoScalingGroup_vpcUpdates
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandPercentageAboveBaseCapacity (138.58s)
=== CONT  TestAccAutoScalingGroup_MixedInstancesPolicy_capacityRebalance
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification_version (138.66s)
=== CONT  TestAccAutoScalingGroup_mixedInstancesPolicy
=== CONT  TestAccAutoScalingGroup_ALB_targetGroups
--- PASS: TestAccAutoScalingGroup_namePrefix (67.38s)
--- PASS: TestAccAutoScalingGroup_withPlacementGroup (155.78s)
=== CONT  TestAccAutoScalingGroup_targetGroupARNs
--- PASS: TestAccAutoScalingGroup_Name_generated (69.77s)
=== CONT  TestAccAutoScalingGroup_maxInstanceLifetime
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotMaxPrice (180.02s)
=== CONT  TestAccAutoScalingGroup_loadBalancers
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandAllocationStrategy (72.22s)
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_triggers
--- PASS: TestAccAutoScalingGroup_mixedInstancesPolicy (69.82s)
=== CONT  TestAccAutoScalingGroup_launchTemplate
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_updateToZeroOnDemandBaseCapacity (115.61s)
=== CONT  TestAccAutoScalingGroup_classicVPCZoneIdentifier
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicy_capacityRebalance (79.32s)
=== CONT  TestAccAutoScalingGroup_LaunchTemplate_iamInstanceProfile
--- PASS: TestAccAutoScalingGroup_terminationPolicies (220.84s)
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_basic
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weightedCapacity (227.80s)
=== CONT  TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity
--- PASS: TestAccAutoScalingGroup_enablingMetrics (238.09s)
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_start
--- PASS: TestAccAutoScalingGroup_launchTemplate (57.25s)
=== CONT  TestAccAutoScalingGroup_warmPool
--- PASS: TestAccAutoScalingGroup_maxInstanceLifetime (112.71s)
--- PASS: TestAccAutoScalingGroup_vpcUpdates (135.03s)
--- PASS: TestAccAutoScalingGroup_classicVPCZoneIdentifier (62.34s)
--- PASS: TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandBaseCapacity (157.97s)
--- PASS: TestAccAutoScalingGroup_initialLifecycleHook (289.38s)
--- PASS: TestAccAutoScalingGroup_LaunchTemplate_iamInstanceProfile (76.29s)
--- PASS: TestAccAutoScalingGroup_suspendingProcesses (302.51s)
--- PASS: TestAccAutoScalingGroup_basic (323.84s)
--- PASS: TestAccAutoScalingGroup_LaunchTemplate_update (240.95s)
--- PASS: TestAccAutoScalingGroup_ALB_targetGroups (193.71s)
--- PASS: TestAccAutoScalingGroup_targetGroupARNs (209.48s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_triggers (220.95s)
--- PASS: TestAccAutoScalingGroup_tags (460.31s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_basic (256.86s)
--- PASS: TestAccAutoScalingGroup_withLoadBalancer (404.39s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_start (250.93s)
--- PASS: TestAccAutoScalingGroup_WithLoadBalancer_toTargetGroup (491.47s)
--- PASS: TestAccAutoScalingGroup_loadBalancers (362.30s)
--- PASS: TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity (367.83s)
--- PASS: TestAccAutoScalingGroup_warmPool (591.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling	863.969s

@gdavison gdavison merged commit 786400f into main Nov 16, 2021
@gdavison gdavison deleted the autoscaling_instancerefresh_stuck branch November 16, 2021 19:12
@github-actions github-actions bot added this to the v3.66.0 milestone Nov 16, 2021
github-actions bot pushed a commit that referenced this pull request Nov 16, 2021
@github-actions
Copy link

This functionality has been released in v3.66.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 8, 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 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/autoscaling Issues and PRs that pertain to the autoscaling 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.

Instance refresh on AWS auto scaling group stuck on pending
2 participants