Skip to content

Commit f06bdac

Browse files
committed
add vpc s3 endpoint, thanks to [email protected]
1 parent 26e0d62 commit f06bdac

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

example/main.tf

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ provider "aws" {
22
region = "us-east-2"
33
}
44

5+
data "aws_region" "current" {}
6+
57
locals {
68
cluster_name = "test"
79
admin_email = "[email protected]"
@@ -121,9 +123,26 @@ module "vpc" {
121123
tags = local.tags
122124
}
123125

126+
resource "aws_vpc_endpoint" "s3" {
127+
vpc_id = module.vpc.vpc_id
128+
service_name = "com.amazonaws.${data.aws_region.current.name}.s3"
129+
route_table_ids = concat(
130+
module.vpc.public_route_table_ids,
131+
module.vpc.private_route_table_ids,
132+
module.vpc.intra_route_table_ids
133+
)
134+
135+
tags = merge(
136+
local.tags,
137+
{
138+
Name = "${module.vpc.vpc_id} S3 Gateway Endpoint"
139+
}
140+
)
141+
}
142+
124143
module "eks" {
125144
# source = "../"
126-
source = "github.com/tldr-devops/aws-eks-terraform?ref=1.1"
145+
source = "github.com/tldr-devops/aws-eks-terraform?ref=1.2"
127146

128147
cluster_name = local.cluster_name
129148
cluster_version = local.cluster_version

0 commit comments

Comments
 (0)