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: Configure mixed_instances_policy instance_distribution on_demand_base_capacity and spot_max_price argument zero values #7821

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Mar 6, 2019

Closes #7368

Additional References:

The mixed_instances_policy configuration block instance_distribution configuration block on_demand_base_capacity argument was erroneously omitted from the API requests when configured to 0. This has been fixed.

The mixed_instances_policy configuration block instance_distribution configuration block spot_max_price argument now allows unconfiguring the value via an empty string as of AWS Go SDK 1.17.5. This has been added and verified.

Output from acceptance testing:

--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups (208.32s)
--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity (380.94s)
--- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (57.41s)
--- PASS: TestAccAWSAutoScalingGroup_basic (277.63s)
--- PASS: TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier (79.47s)
--- PASS: TestAccAWSAutoScalingGroup_emptyAvailabilityZones (58.64s)
--- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (172.07s)
--- PASS: TestAccAWSAutoScalingGroup_importBasic (237.78s)
--- PASS: TestAccAWSAutoScalingGroup_initialLifecycleHook (694.88s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate (44.01s)
--- PASS: TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile (52.89s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate_update (142.34s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy (80.87s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy (83.04s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity (113.14s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity (80.93s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy (141.63s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools (114.38s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice (76.59s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName (49.45s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version (80.60s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType (78.31s)
--- PASS: TestAccAWSAutoScalingGroup_namePrefix (56.71s)
--- PASS: TestAccAWSAutoScalingGroup_serviceLinkedRoleARN (82.65s)
--- PASS: TestAccAWSAutoScalingGroup_suspendingProcesses (211.74s)
--- PASS: TestAccAWSAutoScalingGroup_tags (347.60s)
--- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (75.88s)
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (77.10s)
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (383.31s)
--- PASS: TestAccAWSAutoScalingGroup_withMetrics (55.06s)
--- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (142.28s)

…ance_distribution on_demand_base_capacity and spot_max_price argument zero values

References:

* #7368
* https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_InstancesDistribution.html
* https://github.com/aws/aws-sdk-go/releases/tag/v1.17.5

The `mixed_instances_policy` configuration block `instance_distribution` configuration block `on_demand_base_capacity` argument was erroneously omitted from the API requests when configured to 0. This has been fixed.

The `mixed_instances_policy` configuration block `instance_distribution` configuration block `spot_max_price` argument now allows unconfiguring the value via an empty string as of AWS Go SDK 1.17.5. This has been added and verified.

Output from acceptance testing:

```
--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups (208.32s)
--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity (380.94s)
--- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (57.41s)
--- PASS: TestAccAWSAutoScalingGroup_basic (277.63s)
--- PASS: TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier (79.47s)
--- PASS: TestAccAWSAutoScalingGroup_emptyAvailabilityZones (58.64s)
--- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (172.07s)
--- PASS: TestAccAWSAutoScalingGroup_importBasic (237.78s)
--- PASS: TestAccAWSAutoScalingGroup_initialLifecycleHook (694.88s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate (44.01s)
--- PASS: TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile (52.89s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate_update (142.34s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy (80.87s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy (83.04s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity (113.14s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity (80.93s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy (141.63s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools (114.38s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice (76.59s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName (49.45s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version (80.60s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType (78.31s)
--- PASS: TestAccAWSAutoScalingGroup_namePrefix (56.71s)
--- PASS: TestAccAWSAutoScalingGroup_serviceLinkedRoleARN (82.65s)
--- PASS: TestAccAWSAutoScalingGroup_suspendingProcesses (211.74s)
--- PASS: TestAccAWSAutoScalingGroup_tags (347.60s)
--- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (75.88s)
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (77.10s)
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (383.31s)
--- PASS: TestAccAWSAutoScalingGroup_withMetrics (55.06s)
--- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (142.28s)
```
@bflad bflad added bug Addresses a defect in current functionality. service/autoscaling Issues and PRs that pertain to the autoscaling service. labels Mar 6, 2019
@bflad bflad requested a review from a team March 6, 2019 02:55
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Mar 6, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

LGTM

@bflad bflad added this to the v2.1.0 milestone Mar 6, 2019
@bflad bflad merged commit 32e85c1 into master Mar 6, 2019
@bflad bflad deleted the b-aws_autoscaling_group-mip-id-zero-values branch March 6, 2019 21:03
bflad added a commit that referenced this pull request Mar 6, 2019
@bflad
Copy link
Contributor Author

bflad commented Mar 8, 2019

This has been released in version 2.1.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

1 similar comment
@bflad
Copy link
Contributor Author

bflad commented Mar 8, 2019

This has been released in version 2.1.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 31, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
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/autoscaling Issues and PRs that pertain to the autoscaling service. size/XS 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.

aws_autoscaling_group bug - fail to set OnDemandBaseCapacity value to zero
2 participants