-
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
[Enhancement]: support service_region with aws_vpc_endpoint (privateLink consumer) #40583
[Enhancement]: support service_region with aws_vpc_endpoint (privateLink consumer) #40583
Conversation
Rebase forked main branch
rebase from main
…nction Signed-off-by: Mohamed Medhat Mohamed Ibrahim Shalaby <[email protected]>
Update vpc_endpoint_test for crossRegion services
…ant validator function
…on-services Update Read function + Add forcenew for serviceRegion + remove redund…
update docs to add service region attribute
Add computed to service region
Community NoteVoting for Prioritization
For Submitters
|
I can't see why |
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 testacc TESTARGS='-run=TestAccVPCEndpoint_\|TestAccVPCEndpointDataSource_basic' PKG=ec2 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/ec2/... -v -count 1 -parallel 3 -run=TestAccVPCEndpoint_\|TestAccVPCEndpointDataSource_basic -timeout 360m
2024/12/18 08:56:39 Initializing Terraform AWS Provider...
=== RUN TestAccVPCEndpoint_gatewayBasic
=== PAUSE TestAccVPCEndpoint_gatewayBasic
=== RUN TestAccVPCEndpoint_interfaceBasic
=== PAUSE TestAccVPCEndpoint_interfaceBasic
=== RUN TestAccVPCEndpoint_interfaceNoPrivateDNS
=== PAUSE TestAccVPCEndpoint_interfaceNoPrivateDNS
=== RUN TestAccVPCEndpoint_interfacePrivateDNS
=== PAUSE TestAccVPCEndpoint_interfacePrivateDNS
=== RUN TestAccVPCEndpoint_interfacePrivateDNSNoGateway
=== PAUSE TestAccVPCEndpoint_interfacePrivateDNSNoGateway
=== RUN TestAccVPCEndpoint_disappears
=== PAUSE TestAccVPCEndpoint_disappears
=== RUN TestAccVPCEndpoint_tags
=== PAUSE TestAccVPCEndpoint_tags
=== RUN TestAccVPCEndpoint_gatewayWithRouteTableAndPolicy
=== PAUSE TestAccVPCEndpoint_gatewayWithRouteTableAndPolicy
=== RUN TestAccVPCEndpoint_gatewayPolicy
=== PAUSE TestAccVPCEndpoint_gatewayPolicy
=== RUN TestAccVPCEndpoint_ignoreEquivalent
=== PAUSE TestAccVPCEndpoint_ignoreEquivalent
=== RUN TestAccVPCEndpoint_ipAddressType
=== PAUSE TestAccVPCEndpoint_ipAddressType
=== RUN TestAccVPCEndpoint_interfaceWithSubnetAndSecurityGroup
=== PAUSE TestAccVPCEndpoint_interfaceWithSubnetAndSecurityGroup
=== RUN TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnCreate
=== PAUSE TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnCreate
=== RUN TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnUpdate
=== PAUSE TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnUpdate
=== RUN TestAccVPCEndpoint_interfaceUserDefinedIPv4
=== PAUSE TestAccVPCEndpoint_interfaceUserDefinedIPv4
=== RUN TestAccVPCEndpoint_interfaceUserDefinedIPv6
=== PAUSE TestAccVPCEndpoint_interfaceUserDefinedIPv6
=== RUN TestAccVPCEndpoint_interfaceUserDefinedDualstack
=== PAUSE TestAccVPCEndpoint_interfaceUserDefinedDualstack
=== RUN TestAccVPCEndpoint_VPCEndpointType_gatewayLoadBalancer
=== PAUSE TestAccVPCEndpoint_VPCEndpointType_gatewayLoadBalancer
=== RUN TestAccVPCEndpoint_crossRegionService
=== PAUSE TestAccVPCEndpoint_crossRegionService
=== RUN TestAccVPCEndpoint_invalidCrossRegionService
=== PAUSE TestAccVPCEndpoint_invalidCrossRegionService
=== CONT TestAccVPCEndpoint_gatewayBasic
=== CONT TestAccVPCEndpoint_interfaceUserDefinedIPv6
=== CONT TestAccVPCEndpoint_ipAddressType
--- PASS: TestAccVPCEndpoint_gatewayBasic (30.87s)
=== CONT TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnUpdate
--- PASS: TestAccVPCEndpoint_interfaceUserDefinedIPv6 (220.41s)
=== CONT TestAccVPCEndpoint_interfaceUserDefinedIPv4
--- PASS: TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnUpdate (300.27s)
=== CONT TestAccVPCEndpoint_crossRegionService
--- PASS: TestAccVPCEndpoint_ipAddressType (341.79s)
=== CONT TestAccVPCEndpoint_invalidCrossRegionService
--- PASS: TestAccVPCEndpoint_interfaceUserDefinedIPv4 (188.51s)
=== CONT TestAccVPCEndpoint_VPCEndpointType_gatewayLoadBalancer
--- PASS: TestAccVPCEndpoint_invalidCrossRegionService (235.20s)
=== CONT TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnCreate
--- PASS: TestAccVPCEndpoint_VPCEndpointType_gatewayLoadBalancer (419.75s)
=== CONT TestAccVPCEndpoint_interfaceWithSubnetAndSecurityGroup
--- PASS: TestAccVPCEndpoint_crossRegionService (517.54s)
=== CONT TestAccVPCEndpoint_disappears
--- PASS: TestAccVPCEndpoint_disappears (25.69s)
=== CONT TestAccVPCEndpoint_ignoreEquivalent
--- PASS: TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnCreate (297.43s)
=== CONT TestAccVPCEndpoint_gatewayPolicy
--- PASS: TestAccVPCEndpoint_ignoreEquivalent (31.38s)
=== CONT TestAccVPCEndpoint_gatewayWithRouteTableAndPolicy
--- PASS: TestAccVPCEndpoint_gatewayPolicy (44.93s)
=== CONT TestAccVPCEndpoint_tags
--- PASS: TestAccVPCEndpoint_gatewayWithRouteTableAndPolicy (45.51s)
=== CONT TestAccVPCEndpoint_interfacePrivateDNS
--- PASS: TestAccVPCEndpoint_tags (51.26s)
=== CONT TestAccVPCEndpoint_interfacePrivateDNSNoGateway
--- PASS: TestAccVPCEndpoint_interfaceWithSubnetAndSecurityGroup (252.70s)
=== CONT TestAccVPCEndpoint_interfaceNoPrivateDNS
--- PASS: TestAccVPCEndpoint_interfaceNoPrivateDNS (58.50s)
=== CONT TestAccVPCEndpoint_interfaceUserDefinedDualstack
--- PASS: TestAccVPCEndpoint_interfacePrivateDNSNoGateway (200.50s)
=== CONT TestAccVPCEndpoint_interfaceBasic
--- PASS: TestAccVPCEndpoint_interfaceBasic (68.68s)
--- PASS: TestAccVPCEndpoint_interfacePrivateDNS (297.63s)
--- PASS: TestAccVPCEndpoint_interfaceUserDefinedDualstack (189.71s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 1335.307s
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 🚀
@MS99-9 Thanks for the contribution 🎉 👏. |
Good afternoon! I have a VPC endpoint service in APAC and when trying to create the vpc endpoint in eu-west-1 terraform displays an error: api error InvalidServiceName: The Vpc Endpoint Service 'xxx' does not exist However, I can create it without any problem using the AWS console by setting the cross region checkbox and choosing the region that finally sets the service_region. Thanks |
This functionality has been released in v5.82.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! |
Description
This pull request adds support for the
service_region
argument to theaws_vpc_endpoint
resource. Theservice_region
argument allows users to specify the region of the VPC Endpoint Service explicitly, enabling cross-region endpoint connections.Changes
service_region
argument to theaws_vpc_endpoint
resource schema.create
andread
functions to handle the new argument:create
function validates theservice_region
against the service's available regions.read
function parses theservice_region
from the service name.service_region
.service_region
for cross-region configurations.service_region
.Tests
TestAccVPCEndpoint_crossRegionService
: Validates that theservice_region
argument works as expected for cross-region endpoints.TestAccVPCEndpoint_invalidCrossRegionService
: Ensures an error is returned when specifying an unsupportedservice_region
.Relations
Closes #40522.
Closes #40438.
References
Output from Acceptance Testing