Skip to content

Commit

Permalink
Support ena_support
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrownus committed Jul 30, 2018
1 parent 9ca23fd commit bfacfe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aws/resource_aws_ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down Expand Up @@ -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{}
Expand Down Expand Up @@ -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,
},
}
}
3 changes: 3 additions & 0 deletions aws/resource_aws_ami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
},
Expand Down Expand Up @@ -231,6 +233,7 @@ resource "aws_ami" "foo" {
device_name = "/dev/sda1"
snapshot_id = "${aws_ebs_snapshot.foo.id}"
}
ena_support = true
}
`, rInt)
}
Expand Down

0 comments on commit bfacfe9

Please sign in to comment.