-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[New Data Source]: aws_vpn_connection: Add new data source to fetch information about an EC2 VPN Connection. #44622
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 Source]: aws_vpn_connection: Add new data source to fetch information about an EC2 VPN Connection. #44622
Conversation
% make testacc TESTS=TestAccEC2VpnConnectionDataSource_ PKG=ec2 make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-aws_ec2_vpn_connection-new-data-source 🌿... TF_ACC=1 go1.24.6 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2VpnConnectionDataSource_' -timeout 360m -vet=off 2025/10/09 20:21:06 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/09 20:21:06 Initializing Terraform AWS Provider (SDKv2-style)... === RUN TestAccEC2VpnConnectionDataSource_basic === PAUSE TestAccEC2VpnConnectionDataSource_basic === RUN TestAccEC2VpnConnectionDataSource_byFilter === PAUSE TestAccEC2VpnConnectionDataSource_byFilter === RUN TestAccEC2VpnConnectionDataSource_nonExistentId === PAUSE TestAccEC2VpnConnectionDataSource_nonExistentId === RUN TestAccEC2VpnConnectionDataSource_noInput === PAUSE TestAccEC2VpnConnectionDataSource_noInput === CONT TestAccEC2VpnConnectionDataSource_basic === CONT TestAccEC2VpnConnectionDataSource_nonExistentId === CONT TestAccEC2VpnConnectionDataSource_noInput === CONT TestAccEC2VpnConnectionDataSource_byFilter --- PASS: TestAccEC2VpnConnectionDataSource_noInput (3.85s) --- PASS: TestAccEC2VpnConnectionDataSource_nonExistentId (5.41s) --- PASS: TestAccEC2VpnConnectionDataSource_byFilter (258.74s) --- PASS: TestAccEC2VpnConnectionDataSource_basic (593.10s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 597.880s
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
```console % make t K=ec2 T=TestAccEC2VPNConnectionDataSource_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-aws_ec2_vpn_connection-new-data-source 🌿... TF_ACC=1 go1.24.8 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2VPNConnectionDataSource_' -timeout 360m -vet=off 2025/10/14 10:23:05 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/14 10:23:05 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccEC2VPNConnectionDataSource_noInput (1.62s) --- PASS: TestAccEC2VPNConnectionDataSource_nonExistentId (2.57s) --- PASS: TestAccEC2VPNConnectionDataSource_byFilter (252.11s) --- PASS: TestAccEC2VPNConnectionDataSource_basic (252.37s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 259.363s ```
```console % make t K=ec2 T=TestAccVPNConnectionDataSource_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-aws_ec2_vpn_connection-new-data-source 🌿... TF_ACC=1 go1.24.8 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPNConnectionDataSource_' -timeout 360m -vet=off 2025/10/15 16:51:14 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/15 16:51:14 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccVPNConnectionDataSource_noInput (1.42s) --- PASS: TestAccVPNConnectionDataSource_nonExistentId (2.32s) --- PASS: TestAccVPNConnectionDataSource_byFilter (243.04s) --- PASS: TestAccVPNConnectionDataSource_basic (243.18s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 250.058s ```
```console % make t K=ec2 T=TestAccVPNConnectionDataSource_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-aws_ec2_vpn_connection-new-data-source 🌿... TF_ACC=1 go1.24.8 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPNConnectionDataSource_' -timeout 360m -vet=off 2025/10/15 17:01:59 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/15 17:01:59 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccVPNConnectionDataSource_noInput (1.61s) --- PASS: TestAccVPNConnectionDataSource_nonExistentId (2.56s) --- PASS: TestAccVPNConnectionDataSource_byFilter (298.01s) --- PASS: TestAccVPNConnectionDataSource_basic (588.72s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 595.637s ```
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 🚀
% make t K=ec2 T=TestAccVPNConnectionDataSource_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_ec2_vpn_connection-new-data-source 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPNConnectionDataSource_' -timeout 360m -vet=off
2025/10/15 17:01:59 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/15 17:01:59 Initializing Terraform AWS Provider (SDKv2-style)...
--- PASS: TestAccVPNConnectionDataSource_noInput (1.61s)
--- PASS: TestAccVPNConnectionDataSource_nonExistentId (2.56s)
--- PASS: TestAccVPNConnectionDataSource_byFilter (298.01s)
--- PASS: TestAccVPNConnectionDataSource_basic (588.72s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 595.637s
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 🚀
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v6.17.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. Thank you! |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
aws_vpn_connection
to retrieve information on an EC2 VPN Connection.Relations
Closes #3593
References
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpnConnections.html
Output from Acceptance Testing
% make testacc TESTS=TestAccEC2VpnConnectionDataSource_ PKG=ec2 make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-aws_ec2_vpn_connection-new-data-source 🌿... TF_ACC=1 go1.24.6 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2VpnConnectionDataSource_' -timeout 360m -vet=off 2025/10/09 20:21:06 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/09 20:21:06 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccEC2VpnConnectionDataSource_basic
=== PAUSE TestAccEC2VpnConnectionDataSource_basic
=== RUN TestAccEC2VpnConnectionDataSource_byFilter
=== PAUSE TestAccEC2VpnConnectionDataSource_byFilter
=== RUN TestAccEC2VpnConnectionDataSource_nonExistentId
=== PAUSE TestAccEC2VpnConnectionDataSource_nonExistentId
=== RUN TestAccEC2VpnConnectionDataSource_noInput
=== PAUSE TestAccEC2VpnConnectionDataSource_noInput
=== CONT TestAccEC2VpnConnectionDataSource_basic
=== CONT TestAccEC2VpnConnectionDataSource_nonExistentId
=== CONT TestAccEC2VpnConnectionDataSource_noInput
=== CONT TestAccEC2VpnConnectionDataSource_byFilter
--- PASS: TestAccEC2VpnConnectionDataSource_noInput (3.85s)
--- PASS: TestAccEC2VpnConnectionDataSource_nonExistentId (5.41s)
--- PASS: TestAccEC2VpnConnectionDataSource_byFilter (258.74s)
--- PASS: TestAccEC2VpnConnectionDataSource_basic (593.10s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 597.880s