Fix launch_configuration error when using ebs which is encrypted

This commit is contained in:
Sargurunathan Mohan 2016-05-03 06:31:41 -07:00 committed by James Nugent
parent 175f7bb436
commit a5825f907b
1 changed files with 4 additions and 1 deletions

View File

@ -334,13 +334,16 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface
bd := v.(map[string]interface{})
ebs := &autoscaling.Ebs{
DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)),
Encrypted: aws.Bool(bd["encrypted"].(bool)),
}
if v, ok := bd["snapshot_id"].(string); ok && v != "" {
ebs.SnapshotId = aws.String(v)
}
if v, ok := bd["encrypted"].(bool); ok && v {
ebs.Encrypted = aws.Bool(v)
}
if v, ok := bd["volume_size"].(int); ok && v != 0 {
ebs.VolumeSize = aws.Int64(int64(v))
}