Skip to content

Commit 2eb52d8

Browse files
Merge pull request #28 from comet-ml/DT-523-vpc-s3-endpoint
DT-523 add vpc s3 endpoint resource
2 parents b613ec6 + 6af60be commit 2eb52d8

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

.terraform.lock.hcl

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module "comet_vpc" {
1515
source = "./modules/comet_vpc"
1616
count = var.enable_vpc ? 1 : 0
1717
environment = var.environment
18+
region = var.region
1819

1920
eks_enabled = var.enable_eks
2021
single_nat_gateway = var.single_nat_gateway

modules/comet_vpc/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,15 @@ module "vpc" {
3939
private_subnet_tags = var.eks_enabled ? { "kubernetes.io/role/internal-elb" = 1 } : null
4040

4141
tags = local.tags
42+
}
43+
44+
resource "aws_vpc_endpoint" "s3" {
45+
vpc_id = module.vpc.vpc_id
46+
service_name = "com.amazonaws.${var.region}.s3"
47+
vpc_endpoint_type = "Gateway"
48+
route_table_ids = concat(module.vpc.private_route_table_ids, module.vpc.public_route_table_ids)
49+
tags = merge(
50+
local.tags,
51+
{ Name = "${local.resource_name}-s3-endpoint" }
52+
)
4253
}

modules/comet_vpc/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ variable "eks_enabled" {
1111
variable "single_nat_gateway" {
1212
description = "Controls whether single NAT gateway used for all public subnets"
1313
type = bool
14+
}
15+
16+
variable "region" {
17+
description = "AWS region to provision resources in"
18+
type = string
1419
}

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ variable "elasticache_engine" {
258258
variable "elasticache_engine_version" {
259259
description = "Version number for ElastiCache engine"
260260
type = string
261-
default = "7.1.0"
261+
default = "7.1"
262262
}
263263

264264
variable "elasticache_instance_type" {
@@ -270,7 +270,7 @@ variable "elasticache_instance_type" {
270270
variable "elasticache_param_group_name" {
271271
description = "Name for the ElastiCache cluster parameter group"
272272
type = string
273-
default = "default.redis5.0"
273+
default = "default.redis7"
274274
}
275275

276276
variable "elasticache_num_cache_nodes" {

0 commit comments

Comments
 (0)