From 341590cd19311a48cc302f4f5306bd77f7418b00 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 17 Dec 2020 08:10:13 -0500 Subject: [PATCH] r/aws_ami_copy: Add 'throughput' attribute to 'ebs_block_device' block. 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 --- aws/resource_aws_ami_copy.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_ami_copy.go b/aws/resource_aws_ami_copy.go index 1ed5bb2ea93..07e0e92ebec 100644 --- a/aws/resource_aws_ami_copy.go +++ b/aws/resource_aws_ami_copy.go @@ -67,6 +67,11 @@ func resourceAwsAmiCopy() *schema.Resource { Computed: true, }, + "throughput": { + Type: schema.TypeInt, + Computed: true, + }, + "volume_size": { Type: schema.TypeInt, Computed: true, @@ -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 }