Skip to content

Commit

Permalink
feat: add VPC endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
chomatdam committed Dec 11, 2024
1 parent 13df978 commit 03839f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions terraform/foundation-stack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ module "vpc" {
})
}

data "aws_region" "current" {}

# https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/using-govcloud-vpc-endpoints.html
resource "aws_vpc_endpoint" "eks_vpc_endpoints" {
for_each = var.vpc_endpoints
vpc_id = module.vpc.vpc_id
service_name = "com.amazonaws.${data.aws_region.current.name}.${each.value}"
tags = var.stack_tags
}

module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "20.24.3"
Expand Down
5 changes: 5 additions & 0 deletions terraform/foundation-stack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,8 @@ variable "s3_csi_driver_bucket_arns" {
default = []
description = "existing buckets the s3 CSI driver should have access to"
}
variable "vpc_endpoints" {
type = list(string)
description = "vpc endpoints within the cluster vpc network"
default = []
}

0 comments on commit 03839f8

Please sign in to comment.