providers/aws: only set instance tenancy if its set

/cc @clint
This commit is contained in:
Mitchell Hashimoto 2015-03-18 20:48:39 +01:00
parent c57325fc5f
commit 50c49396f4
1 changed files with 3 additions and 1 deletions

View File

@ -264,7 +264,9 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
placement := &ec2.Placement{ placement := &ec2.Placement{
AvailabilityZone: aws.String(d.Get("availability_zone").(string)), AvailabilityZone: aws.String(d.Get("availability_zone").(string)),
Tenancy: aws.String(d.Get("tenancy").(string)), }
if v := d.Get("tenancy").(string); v != "" {
placement.Tenancy = aws.String(v)
} }
iam := &ec2.IAMInstanceProfileSpecification{ iam := &ec2.IAMInstanceProfileSpecification{