Merge pull request #1371 from hashicorp/b-aws-launch-config-forced-update

providers/aws: don't force update for existing launch configs
This commit is contained in:
Paul Hinze 2015-04-06 10:57:25 -05:00
commit 373f366193
1 changed files with 11 additions and 23 deletions

View File

@ -98,7 +98,7 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
Type: schema.TypeBool, Type: schema.TypeBool,
Optional: true, Optional: true,
ForceNew: true, ForceNew: true,
Default: false, Computed: true,
}, },
"placement_tenancy": &schema.Schema{ "placement_tenancy": &schema.Schema{
@ -174,7 +174,6 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
"ephemeral_block_device": &schema.Schema{ "ephemeral_block_device": &schema.Schema{
Type: schema.TypeSet, Type: schema.TypeSet,
Optional: true, Optional: true,
Computed: true,
ForceNew: true, ForceNew: true,
Elem: &schema.Resource{ Elem: &schema.Resource{
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
@ -433,28 +432,15 @@ func resourceAwsLaunchConfigurationRead(d *schema.ResourceData, meta interface{}
lc := describConfs.LaunchConfigurations[0] lc := describConfs.LaunchConfigurations[0]
d.Set("key_name", *lc.KeyName) d.Set("key_name", lc.KeyName)
d.Set("image_id", *lc.ImageID) d.Set("image_id", lc.ImageID)
d.Set("instance_type", *lc.InstanceType) d.Set("instance_type", lc.InstanceType)
d.Set("name", *lc.LaunchConfigurationName) d.Set("name", lc.LaunchConfigurationName)
if lc.IAMInstanceProfile != nil { d.Set("iam_instance_profile", lc.IAMInstanceProfile)
d.Set("iam_instance_profile", *lc.IAMInstanceProfile) d.Set("ebs_optimized", lc.EBSOptimized)
} else { d.Set("spot_price", lc.SpotPrice)
d.Set("iam_instance_profile", nil)
}
if lc.SpotPrice != nil {
d.Set("spot_price", *lc.SpotPrice)
} else {
d.Set("spot_price", nil)
}
if lc.SecurityGroups != nil {
d.Set("security_groups", lc.SecurityGroups) d.Set("security_groups", lc.SecurityGroups)
} else {
d.Set("security_groups", nil)
}
if err := readLCBlockDevices(d, &lc, ec2conn); err != nil { if err := readLCBlockDevices(d, &lc, ec2conn); err != nil {
return err return err
@ -494,6 +480,8 @@ func readLCBlockDevices(d *schema.ResourceData, lc *autoscaling.LaunchConfigurat
if err := d.Set("root_block_device", []interface{}{ibds["root"]}); err != nil { if err := d.Set("root_block_device", []interface{}{ibds["root"]}); err != nil {
return err return err
} }
} else {
d.Set("root_block_device", []interface{}{})
} }
return nil return nil