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

Add Attribute Based Instance-type Selection support to ASG Launch Template Override #24795

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e4c8004
autoscaling_group: add tests for 'instance_requirements'
cjerad Apr 29, 2022
e4caf63
autoscaling_group: add schema for 'instance_requirements'
cjerad Apr 29, 2022
27a662f
autoscaling_group: add expand functions for 'instance_requirements'
cjerad Apr 29, 2022
3d49137
autoscaling_group: add flatten functions for 'instance_requirements'
cjerad Apr 29, 2022
9d090dc
autoscaling_group: add docs for 'instance_requirements'
cjerad Apr 29, 2022
12556ae
autoscaling_group: add changelog entry
cjerad May 16, 2022
56c5d4d
Merge branch 'main' into HEAD
ewbankkit May 18, 2022
ddf0b34
'acctest.Providers' -> 'acctest.ProviderFactories'; organizations.
ewbankkit May 18, 2022
7718dea
r/aws_autoscaling_group: Alphabetize attributes.
ewbankkit May 18, 2022
8115801
r/aws_autoscaling_group: CRUD handlers in order.
ewbankkit May 18, 2022
126effd
r/aws_autoscaling_group: Add 'FindGroupByName' etc.
ewbankkit May 18, 2022
75b250c
r/aws_autoscaling_group: Start to tidy up resource Delete.
ewbankkit May 18, 2022
9e49fd5
r/aws_autoscaling_group: Start to tidy up resource Read.
ewbankkit May 18, 2022
2d6e7cf
Use 'FindGroupByName' in 'testAccCheckGroupExists' and 'testAccCheckG…
ewbankkit May 18, 2022
f7b182f
Reorder functions.
ewbankkit May 18, 2022
f613cb0
Remove duplicate 'FloatGreaterThan'.
ewbankkit May 18, 2022
39ed39c
r/aws_autoscaling_group: Start to tidy up acceptance tests.
ewbankkit May 18, 2022
64a4fc6
r/aws_autoscaling_group: 'TestAccAutoScalingGroup_basic' tests only R…
ewbankkit May 18, 2022
0e5b085
r/aws_autoscaling_group: Add 'TestAccAutoScalingGroup_disappears' (#1…
ewbankkit May 18, 2022
65de99d
r/aws_autoscaling_group: Standardize 'TestAccAutoScalingGroup_tags'.
ewbankkit May 18, 2022
d42bc35
r/aws_autoscaling_group: Add 'TestAccAutoScalingGroup_deprecatedTags'.
ewbankkit May 18, 2022
c7e6f65
r/aws_autoscaling_group: Add 'TestAccAutoScalingGroup_simple'.
ewbankkit May 18, 2022
7ba7786
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_termination…
ewbankkit May 19, 2022
b671853
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_vpcUpdates'.
ewbankkit May 19, 2022
e8afe44
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_withLoadBal…
ewbankkit May 19, 2022
71d8496
Add 'testAccGroupImportStep'.
ewbankkit May 19, 2022
6056422
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_WithLoadBal…
ewbankkit May 19, 2022
7c72af6
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_withPlaceme…
ewbankkit May 19, 2022
fc70e32
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_enablingMet…
ewbankkit May 19, 2022
f7cc8c2
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_withMetrics'.
ewbankkit May 19, 2022
4c48a41
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_suspendingP…
ewbankkit May 19, 2022
0610063
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_serviceLink…
ewbankkit May 19, 2022
c0fd0f0
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_initialLife…
ewbankkit May 19, 2022
a4fafa5
Remove 'TestAccAutoScalingGroup_classicVPCZoneIdentifier', functional…
ewbankkit May 19, 2022
d6f7ef6
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_launchTempl…
ewbankkit May 20, 2022
b9456b4
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_LaunchTempl…
ewbankkit May 20, 2022
98b21eb
Remove 'TestAccAutoScalingGroup_LaunchTemplate_iamInstanceProfile'.
ewbankkit May 20, 2022
322a96e
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_InstanceRef…
ewbankkit May 20, 2022
d13c253
Generate paginator for DescribeInstanceRefreshes.
ewbankkit May 21, 2022
dbae523
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_InstanceRef…
ewbankkit May 21, 2022
e14653d
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_InstanceRef…
ewbankkit May 21, 2022
3bfc998
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_loadBalance…
ewbankkit May 21, 2022
7a26a7d
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_targetGroups'.
ewbankkit May 21, 2022
2a4b933
r/aws_autoscaling_group: Fold 'TestAccAutoScalingGroup_targetGroupARN…
ewbankkit May 21, 2022
7278f8a
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_ALBTargetGr…
ewbankkit May 21, 2022
890c8ca
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_warmPool'.
ewbankkit May 21, 2022
6e30860
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_launchTempP…
ewbankkit May 22, 2022
1bca288
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_Destroy_whe…
ewbankkit May 22, 2022
3576330
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_mixedInstan…
ewbankkit May 22, 2022
8f6b1c9
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
d1c7793
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
eebedd5
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
0fe9987
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
ac8a758
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
5957b1f
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
ede2553
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
c32a88a
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
fc45adf
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
6ebc1f2
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 22, 2022
4cb5be9
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 23, 2022
9df5ac4
r/aws_autoscaling_group: Tidy up 'TestAccAutoScalingGroup_MixedInstan…
ewbankkit May 23, 2022
1f15a40
r/aws_autoscaling_group: Tidy up 'flattenWarmPoolConfiguration'.
ewbankkit May 23, 2022
664e1b5
d/aws_autoscaling_group: Alphabetize attributes.
ewbankkit May 23, 2022
e7159e2
d/aws_autoscaling_group: Tidy up acceptance tests.
ewbankkit May 23, 2022
83d4a1e
d/aws_autoscaling_groups: Tidy up acceptance tests.
ewbankkit May 23, 2022
751d058
r/aws_autoscaling_groups: 'flattenLaunchTemplateSpecificationMap' -> …
ewbankkit May 23, 2022
f826cb8
r/aws_autoscaling_groups: 'flattenASGEnabledMetrics' -> 'flattenEnabl…
ewbankkit May 23, 2022
be203dc
Add 'Context' as an optional parameter for Auto Scaling 'CreateAutoSc…
gjmveloso May 23, 2022
57fa24a
r/aws_autoscaling_groups: 'flattenASGSuspendedProcesses' -> 'flattenS…
ewbankkit May 23, 2022
bb8afd2
r/aws_autoscaling_groups: Tidy up setting 'vpc_zone_identifier'.
ewbankkit May 23, 2022
e3c7982
r/aws_autoscaling_group: Tidy up resource Delete.
ewbankkit May 24, 2022
92b22d6
r/aws_autoscaling_group: Remove unused code.
ewbankkit May 24, 2022
bdc9d6a
r/aws_autoscaling_groups: Add 'TestAccAutoScalingGroup_largeDesiredCa…
ewbankkit May 24, 2022
c5d1d4d
r/aws_autoscaling_groups: Start to tidy up resource Create.
ewbankkit May 24, 2022
c3d4cf0
r/aws_autoscaling_groups: Continue to tidy up resource Create.
ewbankkit May 24, 2022
5690258
r/aws_autoscaling_groups: Continue to tidy up resource Create.
ewbankkit May 24, 2022
baecbd4
r/aws_autoscaling_groups: Start to tidy up instance refresh.
ewbankkit May 24, 2022
abe5b06
r/aws_autoscaling_groups: Only call UpdateAutoScalingGroup if there i…
ewbankkit May 25, 2022
9117d1b
r/aws_autoscaling_groups: Start to tidy up load balancer and target g…
ewbankkit May 25, 2022
4a84163
Generate paginator for 'DescribeLoadBalancers'.
ewbankkit May 25, 2022
3c25710
Generate paginator for 'DescribeLoadBalancerTargetGroups'.
ewbankkit May 25, 2022
08f3e5a
Add LoadBalancerState and LoadBalancerTargetGroupState constant values.
ewbankkit May 25, 2022
3b6ca50
Add 'findLoadBalancerStates' and 'findLoadBalancerTargetGroupStates'.
ewbankkit May 25, 2022
1c2cc8c
r/aws_autoscaling_groups: Tidy up load balancer and target group atta…
ewbankkit May 25, 2022
74ef219
Generate paginator for 'DescribeWarmPool'.
ewbankkit May 25, 2022
db28c5d
r/aws_autoscaling_groups: Use paginated version of DescribeWarmPool.
ewbankkit May 25, 2022
3e7c3fa
r/aws_autoscaling_groups: Tidy up instance refresh.
ewbankkit May 25, 2022
4f9f3a5
Move ELB waiting functionality into 'group_waiting.go'.
ewbankkit May 25, 2022
28f1b9e
r/aws_autoscaling_groups: Tidy up expanders.
ewbankkit May 25, 2022
a2b5d53
Revert "Add 'Context' as an optional parameter for Auto Scaling 'Crea…
ewbankkit May 25, 2022
895fe52
Merge commit 'a2b5d5304417e603bcdbd3e1d82682a27ab7cdab' into tmp-pr24795
ewbankkit May 25, 2022
24e9e90
r/aws_autoscaling_group: Add 'context' argument.
ewbankkit May 25, 2022
d14360b
Add CHANGELOG entry (#24951).
ewbankkit May 25, 2022
c09a282
Merge branch 'main' into HEAD
ewbankkit May 25, 2022
ff0af56
'acctest.ConfigLatestAmazonLinuxHvmEbsAmi' -> 'acctest.ConfigLatestAm…
ewbankkit May 25, 2022
da7edfc
Fix terrafmt errors.
ewbankkit May 25, 2022
0fc0967
Fix semgrep 'aws-sdk-go-multiple-service-imports' errors.
ewbankkit May 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/24795.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_autoscaling_group: Add `mixed_instances_policy.launch_template.override.instance_requirements` argument
```
3 changes: 3 additions & 0 deletions .changelog/24951.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_autoscaling_group: Add `context` argument
```
2 changes: 1 addition & 1 deletion internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ resource "aws_security_group" "sg_for_lambda" {

func ConfigVPCWithSubnets(rName string, subnetCount int) string {
return ConfigCompose(
ConfigAvailableAZsNoOptIn(),
ConfigAvailableAZsNoOptInDefaultExclude(),
fmt.Sprintf(`
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
Expand Down
33 changes: 33 additions & 0 deletions internal/service/autoscaling/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,39 @@ const (
propagationTimeout = 2 * time.Minute
)

const (
DefaultEnabledMetricsGranularity = "1Minute"
)

const (
DefaultTerminationPolicy = "Default"
)

const (
DefaultWarmPoolMaxGroupPreparedCapacity = -1
)

const (
InstanceHealthStatusHealthy = "Healthy"
InstanceHealthStatusUnhealthy = "Unhealthy"
)

const (
LoadBalancerStateAdding = "Adding"
LoadBalancerStateAdded = "Added"
LoadBalancerStateInService = "InService"
LoadBalancerStateRemoving = "Removing"
LoadBalancerStateRemoved = "Removed"
)

const (
LoadBalancerTargetGroupStateAdding = "Adding"
LoadBalancerTargetGroupStateAdded = "Added"
LoadBalancerTargetGroupStateInService = "InService"
LoadBalancerTargetGroupStateRemoving = "Removing"
LoadBalancerTargetGroupStateRemoved = "Removed"
)

const (
PolicyTypePredictiveScaling = "PredictiveScaling"
PolicyTypeSimpleScaling = "SimpleScaling"
Expand Down
20 changes: 0 additions & 20 deletions internal/service/autoscaling/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ import (
"github.com/aws/aws-sdk-go/service/autoscaling"
)

func flattenASGEnabledMetrics(list []*autoscaling.EnabledMetric) []string {
strs := make([]string, 0, len(list))
for _, r := range list {
if r.Metric != nil {
strs = append(strs, *r.Metric)
}
}
return strs
}

func flattenASGSuspendedProcesses(list []*autoscaling.SuspendedProcess) []string {
strs := make([]string, 0, len(list))
for _, r := range list {
if r.ProcessName != nil {
strs = append(strs, *r.ProcessName)
}
}
return strs
}

// Takes the result of flatmap.Expand for an array of step adjustments and
// returns a []*autoscaling.StepAdjustment.
func ExpandStepAdjustments(configured []interface{}) ([]*autoscaling.StepAdjustment, error) {
Expand Down
21 changes: 0 additions & 21 deletions internal/service/autoscaling/flex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,6 @@ import (
"github.com/aws/aws-sdk-go/service/autoscaling"
)

func TestFlattenEnabledMetrics(t *testing.T) {
expanded := []*autoscaling.EnabledMetric{
{Granularity: aws.String("1Minute"), Metric: aws.String("GroupTotalInstances")},
{Granularity: aws.String("1Minute"), Metric: aws.String("GroupMaxSize")},
}

result := flattenASGEnabledMetrics(expanded)

if len(result) != 2 {
t.Fatalf("expected result had %d elements, but got %d", 2, len(result))
}

if result[0] != "GroupTotalInstances" {
t.Fatalf("expected id to be GroupTotalInstances, but was %s", result[0])
}

if result[1] != "GroupMaxSize" {
t.Fatalf("expected id to be GroupMaxSize, but was %s", result[1])
}
}

func TestExpandStepAdjustments(t *testing.T) {
expanded := []interface{}{
map[string]interface{}{
Expand Down
1 change: 1 addition & 0 deletions internal/service/autoscaling/generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:generate go run ../../generate/tags/main.go -GetTag -ListTags -ListTagsOp=DescribeTags -ListTagsInFiltIDName=auto-scaling-group -ServiceTagsSlice -TagOp=CreateOrUpdateTags -TagResTypeElem=ResourceType -TagType2=TagDescription -TagTypeAddBoolElem=PropagateAtLaunch -TagTypeIDElem=ResourceId -UntagOp=DeleteTags -UntagInNeedTagType -UntagInTagsElem=Tags -UpdateTags
//go:generate go run ../../generate/listpages/main.go -ListOps=DescribeInstanceRefreshes,DescribeLoadBalancers,DescribeLoadBalancerTargetGroups,DescribeWarmPool
// ONLY generate directives and package declaration! Do not add anything else to this file.

package autoscaling
Loading