remove efs elb

This commit is contained in:
Greg Hendrickson
2023-11-17 14:02:43 -08:00
parent 524d36b239
commit 5bd7a7562b
5 changed files with 0 additions and 107 deletions

View File

@@ -62,19 +62,3 @@ module "ec2-west" {
vpc_id_west_2 = module.vpc-west.vpc_id_west_2
}
module "elb" {
source = "./modules/elb"
}
module "efs" {
source = "./modules/efs"
us_east_subnet_1_id = module.subnets_us_east.us_east_subnet_1_id
us_east_subnet_2_id = module.subnets_us_east.us_east_subnet_2_id
us_east_subnet_3_id = module.subnets_us_east.us_east_subnet_3_id
us_west_subnet_1_id = module.subnets_us_west.us_west_subnet_1_id
us_west_subnet_2_id = module.subnets_us_west.us_west_subnet_2_id
us_west_subnet_3_id = module.subnets_us_west.us_west_subnet_3_id
}

View File

@@ -1,60 +0,0 @@
resource "aws_efs_file_system" "efs" {
creation_token = "efs-asg-west-east"
encrypted = true
performance_mode = "generalPurpose"
throughput_mode = "bursting"
}
resource "aws_efs_mount_target" "us_west_subnet_1" {
file_system_id = aws_efs_file_system.efs.id
subnet_id = var.us_west_subnet_1_id
depends_on = [var.us_west_subnet_1_id]
}
resource "aws_efs_mount_target" "us_west_subnet_2" {
file_system_id = aws_efs_file_system.efs.id
subnet_id = var.us_west_subnet_2_id
depends_on = [var.us_west_subnet_2_id]
}
resource "aws_efs_mount_target" "us_west_subnet_3" {
file_system_id = aws_efs_file_system.efs.id
subnet_id = var.us_west_subnet_3_id
depends_on = [var.us_west_subnet_3_id]
}
data "template_file" "mount_script" {
template = <<EOF
#!/bin/bash
yum install -y amazon-efs-utils
mkdir -p /mnt/efs
echo "${aws_efs_file_system.efs.dns_name}:/ /mnt/efs efs defaults,_netdev 0 0" >> /etc/fstab
mount -a -t efs,nfs4 defaults
EOF
}
provider "aws" {
region = "us-east-1"
}
resource "aws_efs_mount_target" "us_east_subnet_1" {
file_system_id = aws_efs_file_system.efs.id
subnet_id = var.us_east_subnet_1_id
depends_on = [var.us_east_subnet_1_id]
}
resource "aws_efs_mount_target" "us_east_subnet_2" {
file_system_id = aws_efs_file_system.efs.id
subnet_id = var.us_east_subnet_2_id
depends_on = [var.us_east_subnet_2_id]
}
resource "aws_efs_mount_target" "us_east_subnet_3" {
file_system_id = aws_efs_file_system.efs.id
subnet_id = var.us_east_subnet_3_id
depends_on = [var.us_east_subnet_3_id]
}

View File

@@ -1,31 +0,0 @@
variable "us_east_subnet_1_id" {
description = "The ID of the first US East subnet"
type = string
}
variable "us_east_subnet_2_id" {
description = "The ID of the second US East subnet"
type = string
}
variable "us_east_subnet_3_id" {
description = "The ID of the third US East subnet"
type = string
}
variable "us_west_subnet_1_id" {
description = "The ID of the first US East subnet"
type = string
}
variable "us_west_subnet_2_id" {
description = "The ID of the second US East subnet"
type = string
}
variable "us_west_subnet_3_id" {
description = "The ID of the third US East subnet"
type = string
}