AWS instance resource now supports tenancy
This commit is contained in:
parent
75472ecb8e
commit
750a36c51e
|
@ -124,6 +124,12 @@ func resourceAwsInstance() *schema.Resource {
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
"tenancy": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
ForceNew: true,
|
||||||
|
},
|
||||||
"tags": tagsSchema(),
|
"tags": tagsSchema(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -156,6 +162,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
UserData: []byte(userData),
|
UserData: []byte(userData),
|
||||||
EbsOptimized: d.Get("ebs_optimized").(bool),
|
EbsOptimized: d.Get("ebs_optimized").(bool),
|
||||||
IamInstanceProfile: d.Get("iam_instance_profile").(string),
|
IamInstanceProfile: d.Get("iam_instance_profile").(string),
|
||||||
|
Tenancy: d.Get("tenancy").(string),
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := d.Get("security_groups"); v != nil {
|
if v := d.Get("security_groups"); v != nil {
|
||||||
|
@ -330,6 +337,7 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.Set("subnet_id", instance.SubnetId)
|
d.Set("subnet_id", instance.SubnetId)
|
||||||
d.Set("ebs_optimized", instance.EbsOptimized)
|
d.Set("ebs_optimized", instance.EbsOptimized)
|
||||||
d.Set("tags", tagsToMap(instance.Tags))
|
d.Set("tags", tagsToMap(instance.Tags))
|
||||||
|
d.Set("tenancy", instance.Tenancy)
|
||||||
|
|
||||||
// Determine whether we're referring to security groups with
|
// Determine whether we're referring to security groups with
|
||||||
// IDs or names. We use a heuristic to figure this out. By default,
|
// IDs or names. We use a heuristic to figure this out. By default,
|
||||||
|
|
|
@ -287,6 +287,7 @@ resource "aws_instance" "foo" {
|
||||||
instance_type = "m1.small"
|
instance_type = "m1.small"
|
||||||
subnet_id = "${aws_subnet.foo.id}"
|
subnet_id = "${aws_subnet.foo.id}"
|
||||||
associate_public_ip_address = true
|
associate_public_ip_address = true
|
||||||
|
tenancy = "dedicated"
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue