From 2b764de38384f743b98b0dae2bf10d07680a588e Mon Sep 17 00:00:00 2001 From: Jonathan Kinred Date: Wed, 3 Sep 2014 20:18:40 +1000 Subject: [PATCH] Allow building of EC2 instances with ebs_optimized flag --- builtin/providers/aws/resource_aws_instance.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index bd4d43add..ff509a669 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -112,6 +112,12 @@ func resourceAwsInstance() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + "ebs_optimized": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + }, + }, } } @@ -141,6 +147,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { PrivateIPAddress: d.Get("private_ip").(string), AssociatePublicIpAddress: associatePublicIPAddress, UserData: []byte(userData), + EbsOptimized: d.Get("ebs_optimized").(bool), } if v := d.Get("security_groups"); v != nil { @@ -307,6 +314,7 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { d.Set("private_dns", instance.PrivateDNSName) d.Set("private_ip", instance.PrivateIpAddress) d.Set("subnet_id", instance.SubnetId) + d.Set("ebs_optimized", instance.EbsOptimized) var deps []terraform.ResourceDependency