-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed as not planned
Labels
Description
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, [])
}
}
}