AWS instance resource now supports tenancy

This commit is contained in:
sneha somwanshi 2014-11-04 16:38:30 +05:30
parent 75472ecb8e
commit 750a36c51e
2 changed files with 9 additions and 0 deletions

View File

@ -124,6 +124,12 @@ func resourceAwsInstance() *schema.Resource {
ForceNew: true,
Optional: true,
},
"tenancy": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"tags": tagsSchema(),
},
}
@ -156,6 +162,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
UserData: []byte(userData),
EbsOptimized: d.Get("ebs_optimized").(bool),
IamInstanceProfile: d.Get("iam_instance_profile").(string),
Tenancy: d.Get("tenancy").(string),
}
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("ebs_optimized", instance.EbsOptimized)
d.Set("tags", tagsToMap(instance.Tags))
d.Set("tenancy", instance.Tenancy)
// Determine whether we're referring to security groups with
// IDs or names. We use a heuristic to figure this out. By default,

View File

@ -287,6 +287,7 @@ resource "aws_instance" "foo" {
instance_type = "m1.small"
subnet_id = "${aws_subnet.foo.id}"
associate_public_ip_address = true
tenancy = "dedicated"
}
`