Skip to content

Conversation

@anavarreteuk
Copy link

Description

This PR updates the aws_vpc_endpoint_service data source logic to conditionally evaluate only when service_endpoint is not defined in the VPC endpoint configuration.

This avoids lookup failures when using cross-account AWS PrivateLink services, which are not discoverable via the data source due to visibility restrictions.

Motivation and Context

Fixes #1215

The module previously evaluated aws_vpc_endpoint_service for all endpoints unconditionally. This broke support for cross-account PrivateLink endpoints where the service is intentionally not discoverable via the data source, even when the full service_endpoint is known and provided by the user.

This change allows users to define endpoints with an explicitly provided service_endpoint, bypassing the data source completely, which resolves this limitation.

Breaking Changes

No breaking changes.
This preserves existing behavior for users who do not define service_endpoint, while enabling new flexibility for cross-account usage.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • [ x ] I have executed pre-commit run -a on my pull request

@anavarreteuk anavarreteuk changed the title feat: add condition to data source feat: Skip VPC endpoint service lookup when service_endpoint is explicitly provided Jul 1, 2025

data "aws_vpc_endpoint_service" "this" {
for_each = local.endpoints
for_each = {
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't make sense - lets discuss in the issue first

@bryantbiggs bryantbiggs closed this Jul 1, 2025
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for cross account vpc endpoint service discovery

2 participants