diff --git a/.changelog/17046.txt b/.changelog/17046.txt new file mode 100644 index 00000000000..6ddffe5743a --- /dev/null +++ b/.changelog/17046.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +data-source/aws_ec2_coip_pool: Add `arn` attribute +``` \ No newline at end of file diff --git a/aws/data_source_aws_ec2_coip_pool.go b/aws/data_source_aws_ec2_coip_pool.go index 703fe13b73f..769ccf9da48 100644 --- a/aws/data_source_aws_ec2_coip_pool.go +++ b/aws/data_source_aws_ec2_coip_pool.go @@ -34,6 +34,11 @@ func dataSourceAwsEc2CoipPool() *schema.Resource { Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchemaComputed(), "filter": ec2CustomFiltersSchema(), @@ -90,6 +95,7 @@ func dataSourceAwsEc2CoipPoolRead(d *schema.ResourceData, meta interface{}) erro d.SetId(aws.StringValue(coip.PoolId)) d.Set("local_gateway_route_table_id", coip.LocalGatewayRouteTableId) + d.Set("arn", coip.PoolArn) if err := d.Set("pool_cidrs", aws.StringValueSlice(coip.PoolCidrs)); err != nil { return fmt.Errorf("error setting pool_cidrs: %s", err) diff --git a/aws/data_source_aws_ec2_coip_pool_test.go b/aws/data_source_aws_ec2_coip_pool_test.go index 9cb93025c89..d082478b980 100644 --- a/aws/data_source_aws_ec2_coip_pool_test.go +++ b/aws/data_source_aws_ec2_coip_pool_test.go @@ -38,6 +38,7 @@ func TestAccDataSourceAwsEc2CoipPool_Id(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestMatchResourceAttr(dataSourceName, "local_gateway_route_table_id", regexp.MustCompile(`^lgw-rtb-`)), resource.TestMatchResourceAttr(dataSourceName, "pool_id", regexp.MustCompile(`^ipv4pool-coip-`)), + testAccMatchResourceAttrRegionalARN(dataSourceName, "arn", "ec2", regexp.MustCompile(`coip-pool/ipv4pool-coip-.+$`)), testCheckResourceAttrGreaterThanValue(dataSourceName, "pool_cidrs.#", "0"), ), }, diff --git a/website/docs/d/ec2_coip_pool.html.markdown b/website/docs/d/ec2_coip_pool.html.markdown index 0114b780009..57158dc887b 100644 --- a/website/docs/d/ec2_coip_pool.html.markdown +++ b/website/docs/d/ec2_coip_pool.html.markdown @@ -55,6 +55,7 @@ result attributes. This data source will complete the data by populating any fields that are not included in the configuration with the data for the selected COIP Pool. -The following attribute is additionally exported: +In addition, the following attributes are exported: +* `arn` - ARN of the COIP pool * `pool_cidrs` - Set of CIDR blocks in pool