mirror of
https://github.com/ghndrx/terraform.git
synced 2026-02-10 14:55:06 +00:00
remove efs elb
This commit is contained in:
@@ -62,19 +62,3 @@ module "ec2-west" {
|
|||||||
vpc_id_west_2 = module.vpc-west.vpc_id_west_2
|
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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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]
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user