-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Update Application Auto Scaling to support scaling an Amazon EC2 Spot fleet. #8697
Changes from all commits
bc733d8
a0d1a5e
03c881c
0e7b7af
1df6770
3700352
0b9fc76
cdb2ee0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,16 +47,16 @@ func resourceAwsAppautoscalingPolicy() *schema.Resource { | |
Required: true, | ||
}, | ||
"scalable_dimension": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "ecs:service:DesiredCount", | ||
ForceNew: true, | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: validateAppautoscalingScalableDimension, | ||
}, | ||
"service_namespace": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "ecs", | ||
ForceNew: true, | ||
Type: schema.TypeString, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are changing these from Optional to required, then we may need to verify that the default value from before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: validateAppautoscalingServiceNamespace, | ||
}, | ||
"adjustment_type": &schema.Schema{ | ||
Type: schema.TypeString, | ||
|
@@ -258,10 +258,6 @@ func getAwsAppautoscalingPutScalingPolicyInput(d *schema.ResourceData) (applicat | |
params.ServiceNamespace = aws.String(v.(string)) | ||
} | ||
|
||
if v, ok := d.GetOk("policy_type"); ok { | ||
params.PolicyType = aws.String(v.(string)) | ||
} | ||
|
||
if v, ok := d.GetOk("scalable_dimension"); ok { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is policy_type being removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is duplicated. |
||
params.ScalableDimension = aws.String(v.(string)) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,25 +20,6 @@ func resourceAwsAppautoscalingTarget() *schema.Resource { | |
Delete: resourceAwsAppautoscalingTargetDelete, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"name": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
ForceNew: true, | ||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { | ||
// https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873 | ||
value := v.(string) | ||
if len(value) > 255 { | ||
errors = append(errors, fmt.Errorf( | ||
"%q cannot be longer than 255 characters", k)) | ||
} | ||
return | ||
}, | ||
}, | ||
"arn": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"max_capacity": &schema.Schema{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we removing the name here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no |
||
Type: schema.TypeInt, | ||
Required: true, | ||
|
@@ -60,16 +41,16 @@ func resourceAwsAppautoscalingTarget() *schema.Resource { | |
ForceNew: true, | ||
}, | ||
"scalable_dimension": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "ecs:service:DesiredCount", | ||
ForceNew: true, | ||
Type: schema.TypeString, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the defaults in place from pre this PR correct here? Otherwise we are breaking backwards compatibility There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: validateAppautoscalingScalableDimension, | ||
}, | ||
"service_namespace": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "ecs", | ||
ForceNew: true, | ||
Type: schema.TypeString, | ||
Required: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the defaults in place from pre this PR correct here? Otherwise we are breaking backwards compatibility There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
ForceNew: true, | ||
ValidateFunc: validateAppautoscalingServiceNamespace, | ||
}, | ||
}, | ||
} | ||
|
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.
If we are changing these from Optional to required, then we may need to verify that the default value from before
ecs:service:DesiredCount
is actually correct - otherwise we are breaking backwards compatibilityThere 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.
ecs:service:DesiredCount
is still a valid value.