Skip to content

Commit

Permalink
r/aws_ami_copy: Add 'throughput' attribute to 'ebs_block_device' block.
Browse files Browse the repository at this point in the history
Acceptance test output:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSAMICopy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAMICopy_ -timeout 120m
=== RUN   TestAccAWSAMICopy_basic
=== PAUSE TestAccAWSAMICopy_basic
=== RUN   TestAccAWSAMICopy_Description
=== PAUSE TestAccAWSAMICopy_Description
=== RUN   TestAccAWSAMICopy_EnaSupport
=== PAUSE TestAccAWSAMICopy_EnaSupport
=== RUN   TestAccAWSAMICopy_tags
=== PAUSE TestAccAWSAMICopy_tags
=== CONT  TestAccAWSAMICopy_basic
=== CONT  TestAccAWSAMICopy_tags
=== CONT  TestAccAWSAMICopy_EnaSupport
=== CONT  TestAccAWSAMICopy_Description
--- PASS: TestAccAWSAMICopy_EnaSupport (385.38s)
--- PASS: TestAccAWSAMICopy_basic (386.46s)
--- PASS: TestAccAWSAMICopy_Description (397.85s)
--- PASS: TestAccAWSAMICopy_tags (411.06s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	411.151s
  • Loading branch information
ewbankkit committed Dec 17, 2020
1 parent d3f796b commit 341590c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions aws/resource_aws_ami_copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func resourceAwsAmiCopy() *schema.Resource {
Computed: true,
},

"throughput": {
Type: schema.TypeInt,
Computed: true,
},

"volume_size": {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -215,17 +220,16 @@ func resourceAwsAmiCopyCreate(d *schema.ResourceData, meta interface{}) error {
return err
}

id := *res.ImageId
d.SetId(id)
d.SetId(aws.StringValue(res.ImageId))
d.Set("manage_ebs_snapshots", true)

if v := d.Get("tags").(map[string]interface{}); len(v) > 0 {
if err := keyvaluetags.Ec2CreateTags(client, id, v); err != nil {
if err := keyvaluetags.Ec2CreateTags(client, d.Id(), v); err != nil {
return fmt.Errorf("error adding tags: %s", err)
}
}

_, err = resourceAwsAmiWaitForAvailable(d.Timeout(schema.TimeoutCreate), id, client)
_, err = resourceAwsAmiWaitForAvailable(d.Timeout(schema.TimeoutCreate), d.Id(), client)
if err != nil {
return err
}
Expand Down

0 comments on commit 341590c

Please sign in to comment.