provider/aws: Get and export ASG ARN value (#8503)

This commit is contained in:
Clint 2016-08-27 09:20:11 -05:00 committed by Radek Simko
parent 32f990b415
commit daac877c82
3 changed files with 9 additions and 0 deletions

View File

@ -176,6 +176,11 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Set: schema.HashString, Set: schema.HashString,
}, },
"arn": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"tag": autoscalingTagsSchema(), "tag": autoscalingTagsSchema(),
}, },
} }
@ -285,6 +290,7 @@ func resourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) e
d.Set("availability_zones", flattenStringList(g.AvailabilityZones)) d.Set("availability_zones", flattenStringList(g.AvailabilityZones))
d.Set("default_cooldown", g.DefaultCooldown) d.Set("default_cooldown", g.DefaultCooldown)
d.Set("arn", g.AutoScalingGroupARN)
d.Set("desired_capacity", g.DesiredCapacity) d.Set("desired_capacity", g.DesiredCapacity)
d.Set("health_check_grace_period", g.HealthCheckGracePeriod) d.Set("health_check_grace_period", g.HealthCheckGracePeriod)
d.Set("health_check_type", g.HealthCheckType) d.Set("health_check_type", g.HealthCheckType)

View File

@ -96,6 +96,8 @@ func TestAccAWSAutoScalingGroup_autoGeneratedName(t *testing.T) {
Check: resource.ComposeTestCheckFunc( Check: resource.ComposeTestCheckFunc(
resource.TestMatchResourceAttr( resource.TestMatchResourceAttr(
"aws_autoscaling_group.bar", "name", asgNameRegexp), "aws_autoscaling_group.bar", "name", asgNameRegexp),
resource.TestCheckResourceAttrSet(
"aws_autoscaling_group.bar", "arn"),
), ),
}, },
}, },

View File

@ -104,6 +104,7 @@ Tags support the following:
The following attributes are exported: The following attributes are exported:
* `id` - The autoscaling group name. * `id` - The autoscaling group name.
* `arn` - The ARN for this AutoScaling Group
* `availability_zones` - The availability zones of the autoscale group. * `availability_zones` - The availability zones of the autoscale group.
* `min_size` - The minimum size of the autoscale group * `min_size` - The minimum size of the autoscale group
* `max_size` - The maximum size of the autoscale group * `max_size` - The maximum size of the autoscale group