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

issue #5239 New Data source: aws_network_interfaces #5324

Merged
merged 2 commits into from
Jul 25, 2018

Conversation

saravanan30erd
Copy link
Contributor

Fixes #5239

Output from acceptance testing:

$ 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 (104.71s)
=== RUN   TestAccDataSourceAwsNetworkInterfaces_Tags
--- PASS: TestAccDataSourceAwsNetworkInterfaces_Tags (113.57s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	218.325s
...

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Jul 25, 2018
@bflad bflad added new-data-source Introduces a new data source. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jul 25, 2018
@bflad bflad added this to the v1.29.0 milestone Jul 25, 2018
Copy link
Contributor

@bflad bflad left a 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}"]
Copy link
Contributor

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 applies Config: testAccDataSourceAwsNetworkInterfacesConfig_Base(rName),


resource "aws_subnet" "test" {
cidr_block = "10.0.0.0/24"
availability_zone = "us-west-2a"
Copy link
Contributor

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") %>>
Copy link
Contributor

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")

@bflad bflad merged commit b358188 into hashicorp:master Jul 25, 2018
bflad added a commit that referenced this pull request Jul 25, 2018
…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
bflad added a commit that referenced this pull request Jul 25, 2018
@bflad
Copy link
Contributor

bflad commented Jul 26, 2018

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.

@ghost
Copy link

ghost commented Apr 4, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data source: aws_network_interfaces
2 participants