Skip to content

Commit

Permalink
r/aws_ami_from_instance: Add 'throughput' attribute to 'ebs_block_dev…
Browse files Browse the repository at this point in the history
…ice' block.

Acceptance test output:

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

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

"volume_size": {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -197,17 +202,16 @@ func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{})
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 c13e09b

Please sign in to comment.