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

added placement group as an option for autoscaling groups #3704

Merged
merged 7 commits into from
Dec 4, 2015
Merged
Changes from 1 commit
Commits
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
12 changes: 12 additions & 0 deletions builtin/providers/aws/resource_aws_autoscaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Set: schema.HashString,
},

"placement_group": &schema.Schema{
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},

Copy link
Contributor

Choose a reason for hiding this comment

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

I just think the addition to the schema should be really simple:

TypeString
Optional

This goes as per the fact the docs says that the input is a string and can be empty

"load_balancers": &schema.Schema{
Type: schema.TypeSet,
Optional: true,
Expand Down Expand Up @@ -175,6 +182,11 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{})
autoScalingGroupOpts.HealthCheckGracePeriod = aws.Int64(int64(v.(int)))
}

if v, ok := d.GetOk("placement_group"); ok && v.(*schema.Set).Len() > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

USing availability_zones is not quite right for the placement_group. The health_check_type is a closer match to the system

autoScalingGroupOpts.PlacementGroup = expandStringList(
v.(*schema.Set).List())
}

if v, ok := d.GetOk("load_balancers"); ok && v.(*schema.Set).Len() > 0 {
autoScalingGroupOpts.LoadBalancerNames = expandStringList(
v.(*schema.Set).List())
Expand Down