File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -99,14 +99,22 @@ resource "aws_nat_gateway" "natgw" {
9999 depends_on = [" aws_internet_gateway.mod" ]
100100}
101101
102- data "aws_vpc_endpoint_service" "s3" {
103- service = " s3"
104- }
102+ # Since 2.2.2021 there is an error:
103+ # Error: multiple VPC Endpoint Services matched; use additional constraints to reduce matches to a single VPC Endpoint Service
104+ # The solution is to not use aws_vpc_endpoint_service datasource, but use service_name explicitly in aws_vpc_endpoint.
105+ # data "aws_vpc_endpoint_service" "s3" {
106+ # count = "${var.enable_s3_endpoint ? 1 : 0}"
107+ #
108+ # service = "s3"
109+ # }
110+
111+ data "aws_region" "current" {}
105112
106113resource "aws_vpc_endpoint" "ep" {
107- vpc_id = " ${ aws_vpc . mod . id } "
108- service_name = " ${ data . aws_vpc_endpoint_service . s3 . service_name } "
109114 count = " ${ var . enable_s3_endpoint } "
115+
116+ vpc_id = " ${ aws_vpc . mod . id } "
117+ service_name = " com.amazonaws.${ data . aws_region . current . name } .s3"
110118}
111119
112120resource "aws_vpc_endpoint_route_table_association" "private_s3" {
You can’t perform that action at this time.
0 commit comments