-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Added CIDR block set to datasource VPC peering #13420
Added CIDR block set to datasource VPC peering #13420
Conversation
If you consider so, I can move the included checks into a new test so the existing one remains as simple as it was before My Golang capabilities are quite limited, I did my best 🙃 |
@AlbertoSH Thanks for submitting this. The Go looks perfect 😄. |
Hi @ewbankkit I moved the checks to a new test & updated the docs. I left the existing test as it was and both tests are green (I updated the PR description with this new output)
|
Verified acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcPeeringConnection_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccDataSourceAwsVpcPeeringConnection_ -timeout 120m
=== RUN TestAccDataSourceAwsVpcPeeringConnection_basic
=== PAUSE TestAccDataSourceAwsVpcPeeringConnection_basic
=== RUN TestAccDataSourceAwsVpcPeeringConnection_cidBlockSets
=== PAUSE TestAccDataSourceAwsVpcPeeringConnection_cidBlockSets
=== CONT TestAccDataSourceAwsVpcPeeringConnection_basic
=== CONT TestAccDataSourceAwsVpcPeeringConnection_cidBlockSets
--- PASS: TestAccDataSourceAwsVpcPeeringConnection_basic (41.27s)
--- PASS: TestAccDataSourceAwsVpcPeeringConnection_cidBlockSets (64.32s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 64.353s |
@@ -41,6 +41,25 @@ func TestAccDataSourceAwsVpcPeeringConnection_basic(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccDataSourceAwsVpcPeeringConnection_cidBlockSets(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Rename to TestAccDataSourceAwsVpcPeeringConnection_cidrBlockSets()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Renamed
Hi @ewbankkit |
Hey guys, Any updates on this. |
Hi guys, |
@ewbankkit when do you guys plan to merge this ? |
@AlbertoSH This is looking good. Can you please convert the new acceptance tests config to Terraform 0.12 syntax? For example "${aws_vpc.foo.id}" to aws_vpc.foo.id |
@ewbankkit There you go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
--- PASS: TestAccDataSourceAwsVpcPeeringConnection_basic (71.73s)
--- PASS: TestAccDataSourceAwsVpcPeeringConnection_cidrBlockSets (98.37s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AlbertoSH 👋 Thank you for submitting this, overall this was looking good, just some minor changes we will complete on merge. 👍
@@ -40,6 +40,19 @@ func dataSourceAwsVpcPeeringConnection() *schema.Resource { | |||
Optional: true, | |||
Computed: true, | |||
}, | |||
"cidr_block_set": { | |||
Type: schema.TypeList, | |||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the attribute is not used for configuring the data source, Optional
should be removed. 👍
Optional: true, |
@@ -60,6 +73,19 @@ func dataSourceAwsVpcPeeringConnection() *schema.Resource { | |||
Optional: true, | |||
Computed: true, | |||
}, | |||
"peer_cidr_block_set": { | |||
Type: schema.TypeList, | |||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly:
Optional: true, |
@@ -82,6 +82,10 @@ All of the argument attributes except `filter` are also exported as result attri | |||
* `requester` - A configuration block that describes [VPC Peering Connection] | |||
(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. | |||
|
|||
* `cidr_block_set` - (Optional) The list of all CIDR blocks of the requester VPC of the specific VPC Peering Connection to retrieve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `cidr_block_set` - (Optional) The list of all CIDR blocks of the requester VPC of the specific VPC Peering Connection to retrieve. | |
* `cidr_block_set` - List of all CIDR blocks of the requester VPC. |
@@ -82,6 +82,10 @@ All of the argument attributes except `filter` are also exported as result attri | |||
* `requester` - A configuration block that describes [VPC Peering Connection] | |||
(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. | |||
|
|||
* `cidr_block_set` - (Optional) The list of all CIDR blocks of the requester VPC of the specific VPC Peering Connection to retrieve. | |||
|
|||
* `peer_cidr_block_set` - (Optional) The list of all CIDR blocks of the accepter VPC of the specific VPC Peering Connection to retrieve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `peer_cidr_block_set` - (Optional) The list of all CIDR blocks of the accepter VPC of the specific VPC Peering Connection to retrieve. | |
* `peer_cidr_block_set` - List of all CIDR blocks of the accepter VPC. |
This has been released in version 3.26.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Current data source
aws_vpc_peering_connection
only providescidr_block
andpeer_cidr_block
. This works fine for most scenarios in which you have two VPCs with just their primary CIDR, but when you attach secondary CIDRs, that info is missingThis PR adds both a
cidr_block_set
and acidr_block_set
attributes to the data source exposing those valuesCommunity Note
Release note for CHANGELOG:
Output from acceptance testing: