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

New Data Sources: aws_ec2_local_gateway_virtual_interface_group(s) #13767

Merged
merged 2 commits into from Jun 16, 2020

Conversation

bflad
Copy link
Member

@bflad bflad commented Jun 16, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13502

Release note for CHANGELOG:

* **New Data Source:** `aws_ec2_local_gateway_virtual_interface_group`
* **New Data Source:** `aws_ec2_local_gateway_virtual_interface_groups`

Output from acceptance testing:

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_LocalGatewayId (17.89s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Filter (18.16s)

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (16.94s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (21.14s)

@bflad bflad added the new-data-source Introduces a new data source. label Jun 16, 2020
@bflad bflad requested a review from a team June 16, 2020 00:04
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 16, 2020
@gdavison gdavison self-assigned this Jun 16, 2020
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions about computed tags and PreCheck function, otherwise LGTM 🚀

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (20.31s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_LocalGatewayId (21.16s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Filter (21.36s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (21.63s)

Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"tags": tagsSchema(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be tagsSchemaComputed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, you are correct -- I'll try to add covering tests as well using the new aws_ec2_tag resource (since this resource implicitly exists and cannot be managed). 😄

Comment on lines +12 to +21
// Hide Outposts testing behind consistent environment variable
outpostArn := os.Getenv("AWS_OUTPOST_ARN")
if outpostArn == "" {
t.Skip(
"Environment variable AWS_OUTPOST_ARN is not set. " +
"This environment variable must be set to the ARN of " +
"a deployed Outpost to enable this test.")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a PreCheck function instead of inline for the tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Outposts client support was just merged and the PreCheck function is pending in this other PR: https://github.com/terraform-providers/terraform-provider-aws/pull/13777/files#diff-19464074d9803005745f6f85ccb8c12fR49

Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"tags": tagsSchema(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be tagsSchemaComputed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh duh 🤦 Yes it should be tagsSchemaComputed() since that's Optional + Computed.

Comment on lines +12 to +20
outpostArn := os.Getenv("AWS_OUTPOST_ARN")
if outpostArn == "" {
t.Skip(
"Environment variable AWS_OUTPOST_ARN is not set. " +
"This environment variable must be set to the ARN of " +
"a deployed Outpost to enable this test.")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a PreCheck?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note as above, this part was just delayed since Outposts API functionality was "phase 4" and this can swapped once #13777 is merged.

@bflad bflad added this to the v2.67.0 milestone Jun 16, 2020
Reference: #13502

Output from acceptance testing:

```
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_LocalGatewayId (17.89s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Filter (18.16s)

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (16.94s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (21.14s)
```
…data source tags arguments work and are tested

Output from acceptance testing:

```
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Filter (17.76s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_LocalGatewayId (17.68s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Tags (21.87s)

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (16.28s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (18.11s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Tags (22.15s)
```
@bflad bflad force-pushed the f-aws_ec2_local_gateway_virtual_interface_group branch from 9174152 to 12244c7 Compare June 16, 2020 23:04
@bflad
Copy link
Member Author

bflad commented Jun 16, 2020

Rebased to fix merge conflict and ensured the tags arguments were working as expected, will merge once CI is green. 👍

Updated output from acceptance testing:

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Filter (17.76s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_LocalGatewayId (17.68s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Tags (21.87s)

--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (16.28s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (18.11s)
--- PASS: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Tags (22.15s)

@bflad bflad merged commit 6cb8a5e into master Jun 16, 2020
@bflad bflad deleted the f-aws_ec2_local_gateway_virtual_interface_group branch June 16, 2020 23:14
bflad added a commit that referenced this pull request Jun 16, 2020
@ghost
Copy link

ghost commented Jun 19, 2020

This has been released in version 2.67.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!

@ghost
Copy link

ghost commented Jul 17, 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 Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-data-source Introduces a new data source. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Data Source: aws_ec2_local_gateway_virtual_interface_group
2 participants