Skip to content

module vpc-endpoints to support non-AWS endpoint services #1134

@sjwl

Description

@sjwl

Is your request related to a problem? Please describe.

when trying to add a vpc endpoint to a non-AWS service, I see this error

│ Error: multiple EC2 VPC Endpoint Services matched; use additional constraints to reduce matches to a single EC2 VPC Endpoint Service
│ 
│   with module.vpc_endpoints.data.aws_vpc_endpoint_service.this["my_company_artifactory"],
│   on .terraform/modules/vpc_endpoints/modules/vpc-endpoints/main.tf line 11, in data "aws_vpc_endpoint_service" "this":
│   11: data "aws_vpc_endpoint_service" "this" {

Describe the solution you'd like.

Similar to how this documentation shows how to create a vpc endpoint to a non-AWS service, the vpc-endpoints module should document how to support this scenario.

Describe alternatives you've considered.

a workaround is to insert a dummy line service = "s3" like so

module "vpc_endpoints" {
  source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints"
  version = "v5.7.0"

  create = var.create_vpc_endpoints && var.create_vpc

  vpc_id = try(module.vpc[0].vpc_id, null)
  create_security_group = false

  endpoints = {
    my_company_artifactory = {
      service = "s3" #hack workaround
      service_endpoint = "com.amazonaws.vpce.us-west-2.vpce-svc-07<redacted>b4"
      subnet_ids = try(module.vpc[0].private_subnets, [])
    }
  }
}

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions