-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
issue #5239 New Data source: aws_network_interfaces #5324
issue #5239 New Data source: aws_network_interfaces #5324
Conversation
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.
This looks great, @saravanan30erd! Thank you! 🚀
The items below are maintainer-scope testing/documentation nits, so I don't want to hold up merging this and will append a quick commit after yours to make the super minor adjustments. Nice setup with the testing. 💯
data "aws_network_interfaces" "test" { | ||
filter { | ||
name = "subnet-id" | ||
values = ["${aws_network_interface.test.subnet_id}"] |
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.
This test configuration has the potential for false positive results (receiving 1 ID instead of 2 IDs) since it only has an ordering dependency on one of the network interfaces.
We can either:
- Add the second dependency here (even if it is the same subnet ID):
values = ["${aws_network_interface.test.subnet_id}", "${aws_network_interface.test1.subnet_id}"]
- Use two
TestStep
in the test, where the first one appliesConfig: testAccDataSourceAwsNetworkInterfacesConfig_Base(rName),
|
||
resource "aws_subnet" "test" { | ||
cidr_block = "10.0.0.0/24" | ||
availability_zone = "us-west-2a" |
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.
We can allow this test configuration to be generic for all partitions/regions by removing availability_zone
here. 👍
@@ -249,6 +249,9 @@ | |||
</li> | |||
<li<%= sidebar_current("docs-aws-datasource-network-interface") %>> |
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.
Minor nitpick: We don't expect most people to know this, but when we add a plural data source, we need to adjust the sidebar_current
of the singular data source in the sidebar page and the top matter of its documentation page. Otherwise the sidebar will highlight both the singular and plural data sources when visiting the singular page since its sidebar_current becomes a prefix of the plural (unless its adjusted).
e.g. Changing here and website/docs/d/network_interface.html.markdown
is the trick we use:
sidebar_current("docs-aws-datasource-network-interface-x")
…feedback * Remove subnet availability_zone to allow for reusability across partitions/regions * Add aws_network_interface.test1 ordering dependency to filter configuration make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsNetworkInterfaces' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -run=TestAccDataSourceAwsNetworkInterfaces -timeout 120m === RUN TestAccDataSourceAwsNetworkInterfaces_Filter --- PASS: TestAccDataSourceAwsNetworkInterfaces_Filter (33.74s) === RUN TestAccDataSourceAwsNetworkInterfaces_Tags --- PASS: TestAccDataSourceAwsNetworkInterfaces_Tags (33.18s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 67.570s
This has been released in version 1.29.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #5239
Output from acceptance testing: