Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoolArn attribute support in Data Source: aws_ec2_coip_pool #17046

Merged
merged 13 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions aws/data_source_aws_ec2_coip_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ func dataSourceAwsEc2CoipPool() *schema.Resource {
Computed: true,
},

"pool_arn": {
Type: schema.TypeString,
Optional: true,
sumitmenaria marked this conversation as resolved.
Show resolved Hide resolved
Computed: true,
},

"tags": tagsSchemaComputed(),

"filter": ec2CustomFiltersSchema(),
Expand Down Expand Up @@ -90,6 +96,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("pool_arn", coip.PoolArn)

if err := d.Set("pool_cidrs", aws.StringValueSlice(coip.PoolCidrs)); err != nil {
return fmt.Errorf("error setting pool_cidrs: %s", err)
Expand Down
1 change: 1 addition & 0 deletions aws/data_source_aws_ec2_coip_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-`)),
resource.TestMatchResourceAttr(dataSourceName, "pool_arn", regexp.MustCompile(`coip-pool/ipv4pool-coip-.+$`)),
testCheckResourceAttrGreaterThanValue(dataSourceName, "pool_cidrs.#", "0"),
),
},
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/ec2_coip_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ the selected COIP Pool.
The following attribute is additionally exported:

* `pool_cidrs` - Set of CIDR blocks in pool

* `pool_arn` - ARN of the COIP pool
sumitmenaria marked this conversation as resolved.
Show resolved Hide resolved