-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Adding Warm pool support in auto scaling group #18734
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @akshayjain1996 👋
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! 😃
f0816d0
to
bd2ab1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I have a few suggestions, but they're mostly style and consistency related.
input.MinSize = aws.Int64(int64(v.(int))) | ||
} | ||
|
||
if v, ok := m["max_group_prepared_capacity"]; ok && v.(int) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this can't be set to zero, it seems the warm pool cannot be removed from a autoscaling group without deleting the autoscaling group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I put in the wrong validation here. Min values for min size and max group prepared capacity are 0 and -1. I updated the validations (https://docs.aws.amazon.com/cli/latest/reference/autoscaling/put-warm-pool.html)
} | ||
|
||
// Wait for Warm pool to be gone. | ||
err := resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it could be handled with waiter. It would achieve the same, but is more uniform with other resources. See
terraform-provider-aws/aws/resource_aws_rds_global_cluster.go
Lines 445 to 465 in 0307213
func waitForRdsGlobalClusterDeletion(conn *rds.RDS, globalClusterID string) error { | |
stateConf := &resource.StateChangeConf{ | |
Pending: []string{ | |
"available", | |
"deleting", | |
}, | |
Target: []string{"deleted"}, | |
Refresh: rdsGlobalClusterRefreshFunc(conn, globalClusterID), | |
Timeout: 10 * time.Minute, | |
NotFoundChecks: 1, | |
} | |
log.Printf("[DEBUG] Waiting for RDS Global Cluster (%s) deletion", globalClusterID) | |
_, err := stateConf.WaitForState() | |
if isResourceNotFoundError(err) { | |
return nil | |
} | |
return err | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its possible a waiter may not work in this case if the state can't be used to determine if the warm pool removal is complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to use waiter.
6ba39f3
to
062c3d0
Compare
…er handle removal of this field from config
062c3d0
to
6466ee0
Compare
Hi Guys, Do you think this can be implement soon? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAutoScalingGroup_ -timeout 180m
=== RUN TestAccAWSAutoScalingGroup_basic
=== PAUSE TestAccAWSAutoScalingGroup_basic
=== RUN TestAccAWSAutoScalingGroup_namePrefix
=== PAUSE TestAccAWSAutoScalingGroup_namePrefix
=== RUN TestAccAWSAutoScalingGroup_autoGeneratedName
=== PAUSE TestAccAWSAutoScalingGroup_autoGeneratedName
=== RUN TestAccAWSAutoScalingGroup_terminationPolicies
=== PAUSE TestAccAWSAutoScalingGroup_terminationPolicies
=== RUN TestAccAWSAutoScalingGroup_tags
=== PAUSE TestAccAWSAutoScalingGroup_tags
=== RUN TestAccAWSAutoScalingGroup_VpcUpdates
=== PAUSE TestAccAWSAutoScalingGroup_VpcUpdates
=== RUN TestAccAWSAutoScalingGroup_WithLoadBalancer
=== PAUSE TestAccAWSAutoScalingGroup_WithLoadBalancer
=== RUN TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup
=== PAUSE TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup
=== RUN TestAccAWSAutoScalingGroup_withPlacementGroup
=== PAUSE TestAccAWSAutoScalingGroup_withPlacementGroup
=== RUN TestAccAWSAutoScalingGroup_enablingMetrics
=== PAUSE TestAccAWSAutoScalingGroup_enablingMetrics
=== RUN TestAccAWSAutoScalingGroup_suspendingProcesses
=== PAUSE TestAccAWSAutoScalingGroup_suspendingProcesses
=== RUN TestAccAWSAutoScalingGroup_withMetrics
=== PAUSE TestAccAWSAutoScalingGroup_withMetrics
=== RUN TestAccAWSAutoScalingGroup_serviceLinkedRoleARN
=== PAUSE TestAccAWSAutoScalingGroup_serviceLinkedRoleARN
=== RUN TestAccAWSAutoScalingGroup_MaxInstanceLifetime
=== PAUSE TestAccAWSAutoScalingGroup_MaxInstanceLifetime
=== RUN TestAccAWSAutoScalingGroup_ALB_TargetGroups
=== PAUSE TestAccAWSAutoScalingGroup_ALB_TargetGroups
=== RUN TestAccAWSAutoScalingGroup_TargetGroupArns
=== PAUSE TestAccAWSAutoScalingGroup_TargetGroupArns
=== RUN TestAccAWSAutoScalingGroup_initialLifecycleHook
=== PAUSE TestAccAWSAutoScalingGroup_initialLifecycleHook
=== RUN TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity
=== PAUSE TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity
=== RUN TestAccAWSAutoScalingGroup_InstanceRefresh_Basic
=== PAUSE TestAccAWSAutoScalingGroup_InstanceRefresh_Basic
=== RUN TestAccAWSAutoScalingGroup_InstanceRefresh_Start
=== PAUSE TestAccAWSAutoScalingGroup_InstanceRefresh_Start
=== RUN TestAccAWSAutoScalingGroup_InstanceRefresh_Triggers
=== PAUSE TestAccAWSAutoScalingGroup_InstanceRefresh_Triggers
=== RUN TestAccAWSAutoScalingGroup_WarmPool
=== PAUSE TestAccAWSAutoScalingGroup_WarmPool
=== RUN TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier
=== PAUSE TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier
=== RUN TestAccAWSAutoScalingGroup_launchTemplate
=== PAUSE TestAccAWSAutoScalingGroup_launchTemplate
=== RUN TestAccAWSAutoScalingGroup_launchTemplate_update
=== PAUSE TestAccAWSAutoScalingGroup_launchTemplate_update
=== RUN TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile
=== PAUSE TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile
=== RUN TestAccAWSAutoScalingGroup_LoadBalancers
=== PAUSE TestAccAWSAutoScalingGroup_LoadBalancers
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_CapacityRebalance
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_CapacityRebalance
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_UpdateToZeroOnDemandBaseCapacity
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_UpdateToZeroOnDemandBaseCapacity
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType_With_LaunchTemplateSpecification
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType_With_LaunchTemplateSpecification
=== RUN TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity
=== PAUSE TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity
=== RUN TestAccAWSAutoScalingGroup_launchTempPartitionNum
=== PAUSE TestAccAWSAutoScalingGroup_launchTempPartitionNum
=== CONT TestAccAWSAutoScalingGroup_basic
=== CONT TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier
=== CONT TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity
=== CONT TestAccAWSAutoScalingGroup_withMetrics
=== CONT TestAccAWSAutoScalingGroup_serviceLinkedRoleARN
=== CONT TestAccAWSAutoScalingGroup_InstanceRefresh_Triggers
=== CONT TestAccAWSAutoScalingGroup_MaxInstanceLifetime
=== CONT TestAccAWSAutoScalingGroup_WarmPool
=== CONT TestAccAWSAutoScalingGroup_initialLifecycleHook
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy
=== CONT TestAccAWSAutoScalingGroup_TargetGroupArns
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_UpdateToZeroOnDemandBaseCapacity
=== CONT TestAccAWSAutoScalingGroup_launchTempPartitionNum
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType_With_LaunchTemplateSpecification
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_CapacityRebalance
=== CONT TestAccAWSAutoScalingGroup_ALB_TargetGroups
--- PASS: TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier (41.75s)
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType_With_LaunchTemplateSpecification (58.65s)
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice
--- PASS: TestAccAWSAutoScalingGroup_withMetrics (60.11s)
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy (62.83s)
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity
--- PASS: TestAccAWSAutoScalingGroup_launchTempPartitionNum (68.63s)
=== CONT TestAccAWSAutoScalingGroup_WithLoadBalancer
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_CapacityRebalance (71.32s)
=== CONT TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile
--- PASS: TestAccAWSAutoScalingGroup_serviceLinkedRoleARN (84.40s)
=== CONT TestAccAWSAutoScalingGroup_suspendingProcesses
--- PASS: TestAccAWSAutoScalingGroup_MaxInstanceLifetime (87.09s)
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity (96.77s)
=== CONT TestAccAWSAutoScalingGroup_enablingMetrics
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version (99.10s)
=== CONT TestAccAWSAutoScalingGroup_withPlacementGroup
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_UpdateToZeroOnDemandBaseCapacity (100.83s)
=== CONT TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType (118.59s)
=== CONT TestAccAWSAutoScalingGroup_LoadBalancers
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools (59.31s)
=== CONT TestAccAWSAutoScalingGroup_launchTemplate_update
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy (35.81s)
=== CONT TestAccAWSAutoScalingGroup_terminationPolicies
--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups (139.70s)
=== CONT TestAccAWSAutoScalingGroup_VpcUpdates
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity (141.14s)
=== CONT TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy
--- PASS: TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile (81.52s)
=== CONT TestAccAWSAutoScalingGroup_tags
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity (95.83s)
=== CONT TestAccAWSAutoScalingGroup_launchTemplate
--- PASS: TestAccAWSAutoScalingGroup_TargetGroupArns (182.95s)
=== CONT TestAccAWSAutoScalingGroup_InstanceRefresh_Start
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy (43.61s)
=== CONT TestAccAWSAutoScalingGroup_InstanceRefresh_Basic
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice (141.88s)
=== CONT TestAccAWSAutoScalingGroup_autoGeneratedName
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate (42.72s)
=== CONT TestAccAWSAutoScalingGroup_namePrefix
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName (163.61s)
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (68.74s)
--- PASS: TestAccAWSAutoScalingGroup_basic (228.84s)
--- PASS: TestAccAWSAutoScalingGroup_InstanceRefresh_Triggers (232.91s)
--- PASS: TestAccAWSAutoScalingGroup_namePrefix (32.48s)
--- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (123.36s)
--- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (159.69s)
--- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (60.38s)
--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity (282.50s)
--- PASS: TestAccAWSAutoScalingGroup_suspendingProcesses (211.72s)
--- PASS: TestAccAWSAutoScalingGroup_initialLifecycleHook (332.89s)
--- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (259.47s)
--- PASS: TestAccAWSAutoScalingGroup_tags (214.54s)
--- PASS: TestAccAWSAutoScalingGroup_WarmPool (391.53s)
--- PASS: TestAccAWSAutoScalingGroup_InstanceRefresh_Basic (210.57s)
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (348.03s)
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (333.74s)
--- PASS: TestAccAWSAutoScalingGroup_LoadBalancers (325.60s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate_update (343.15s)
--- PASS: TestAccAWSAutoScalingGroup_InstanceRefresh_Start (359.03s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 542.039s
This has been released in version 3.37.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 for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Output from acceptance testing:
Notes
Min AWS SDK version - 1.38.16 ( #18702 )