Skip to content

Commit

Permalink
add vpc s3 endpoint, thanks to grigory@naviteq.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Friz-zy committed Sep 5, 2024
1 parent 26e0d62 commit f06bdac
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ provider "aws" {
region = "us-east-2"
}

data "aws_region" "current" {}

locals {
cluster_name = "test"
admin_email = "test@test.com"
Expand Down Expand Up @@ -121,9 +123,26 @@ module "vpc" {
tags = local.tags
}

resource "aws_vpc_endpoint" "s3" {
vpc_id = module.vpc.vpc_id
service_name = "com.amazonaws.${data.aws_region.current.name}.s3"
route_table_ids = concat(
module.vpc.public_route_table_ids,
module.vpc.private_route_table_ids,
module.vpc.intra_route_table_ids
)

tags = merge(
local.tags,
{
Name = "${module.vpc.vpc_id} S3 Gateway Endpoint"
}
)
}

module "eks" {
# source = "../"
source = "github.com/tldr-devops/aws-eks-terraform?ref=1.1"
source = "github.com/tldr-devops/aws-eks-terraform?ref=1.2"

cluster_name = local.cluster_name
cluster_version = local.cluster_version
Expand Down

0 comments on commit f06bdac

Please sign in to comment.