conditionally set InstanceInitiatedShutdownBehavior
This commit is contained in:
parent
30572212f2
commit
8d5fe93152
|
@ -150,7 +150,6 @@ func resourceAwsInstance() *schema.Resource {
|
|||
"instance_initiated_shutdown_behavior": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "stop",
|
||||
},
|
||||
|
||||
"monitoring": &schema.Schema{
|
||||
|
@ -926,7 +925,10 @@ func buildAwsInstanceOpts(
|
|||
EBSOptimized: aws.Bool(d.Get("ebs_optimized").(bool)),
|
||||
ImageID: aws.String(d.Get("ami").(string)),
|
||||
InstanceType: aws.String(d.Get("instance_type").(string)),
|
||||
InstanceInitiatedShutdownBehavior: aws.String(d.Get("instance_initiated_shutdown_behavior").(string)),
|
||||
}
|
||||
|
||||
if v := d.Get("instance_initiated_shutdown_behavior").(string); v != "" {
|
||||
opts.InstanceInitiatedShutdownBehavior = aws.String(v)
|
||||
}
|
||||
|
||||
opts.Monitoring = &ec2.RunInstancesMonitoringEnabled{
|
||||
|
|
Loading…
Reference in New Issue