diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 71b8f1e5bd3..bc4f1421bb0 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -59,6 +59,7 @@ func resourceAwsAmiCreate(d *schema.ResourceData, meta interface{}) error { RootDeviceName: aws.String(d.Get("root_device_name").(string)), SriovNetSupport: aws.String(d.Get("sriov_net_support").(string)), VirtualizationType: aws.String(d.Get("virtualization_type").(string)), + EnaSupport: aws.Bool(d.Get("ena_support").(bool)), } if kernelId := d.Get("kernel_id").(string); kernelId != "" { @@ -196,6 +197,7 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { d.Set("root_snapshot_id", amiRootSnapshotId(image)) d.Set("sriov_net_support", image.SriovNetSupport) d.Set("virtualization_type", image.VirtualizationType) + d.Set("ena_support", image.EnaSupport) var ebsBlockDevs []map[string]interface{} var ephemeralBlockDevs []map[string]interface{} @@ -569,5 +571,10 @@ func resourceAwsAmiCommonSchema(computed bool) map[string]*schema.Schema { Computed: true, ForceNew: true, }, + "ena_support": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + }, } } diff --git a/aws/resource_aws_ami_test.go b/aws/resource_aws_ami_test.go index 14fdf0c3c05..af275c10f4c 100644 --- a/aws/resource_aws_ami_test.go +++ b/aws/resource_aws_ami_test.go @@ -32,6 +32,8 @@ func TestAccAWSAMI_basic(t *testing.T) { "aws_ami.foo", "name", fmt.Sprintf("tf-testing-%d", rInt)), resource.TestMatchResourceAttr( "aws_ami.foo", "root_snapshot_id", regexp.MustCompile("^snap-")), + resource.TestCheckResourceAttr( + "aws_ami.foo", "ena_support", "true"), ), }, }, @@ -231,6 +233,7 @@ resource "aws_ami" "foo" { device_name = "/dev/sda1" snapshot_id = "${aws_ebs_snapshot.foo.id}" } + ena_support = true } `, rInt) }