From 2cdd81d301d10846b76143af40278961023f843e Mon Sep 17 00:00:00 2001 From: linkedin Date: Wed, 16 Sep 2020 13:26:47 -0500 Subject: [PATCH] Renumbered chapter 2 and 3 exercises --- .../main.tf | 0 .../terraform.tfvars.backup | 0 02_02_functions/main.tf | 195 ------------------ 02_02_variables/main.challenge | 193 ----------------- 02_03_modules/instance.tf.challenge | 23 --- .../main.tf | 0 .../terraform.tfvars.backup | 0 {02_08_count => 02_10_count}/main.tf | 0 .../terraform.tfvars.backup | 0 02_10_modules/main.tf | 98 --------- 02_10_modules/terraform.tfvars.backup | 3 - {02_03_modules => 02_11-12_modules}/main.tf | 0 .../terraform.tfvars.backup | 0 03_01_remotestate/commands.txt | 5 - 03_01_remotestate/main.tf | 78 ------- .../remote_resources/s3_backend.tf | 104 ---------- 03_01_remotestate/terraform.tfvars.backup | 7 - .../commands.txt | 0 .../main.tf | 0 .../remote_resources/s3_backend.tf | 0 .../terraform.tfvars.backup | 0 03_02_complex/instance.tf | 17 -- 03_02_complex/terraform.tfvars.backup | 5 - 03_02_complex/variables.tf | 17 -- 03_02_remotestate/terraform.tfvars.backup | 3 - 03_03_multi_environment/commands.txt | 23 --- .../environments/1_qa/qa.auto.tvfars.backup | 13 -- .../manifests/datasource.tf | 22 -- 03_03_multi_environment/manifests/provider.tf | 8 - .../manifests/security_group.tf | 36 ---- 03_03_multi_environment/manifests/vpc.tf | 16 -- 03_04_custommodule/main.tf | 16 -- .../modules/nodejs-instance/LICENSE | 11 - .../modules/nodejs-instance/README.md | 0 .../modules/nodejs-instance/main.tf | 86 -------- .../modules/nodejs-instance/outputs.tf | 6 - .../modules/nodejs-instance/variables.tf | 21 -- 03_04_custommodule/terraform.tfvars.backup | 5 - 03_04_custommodule/variables.tf | 25 --- .../commands.txt | 0 .../development.auto.tfvars.backup | 0 .../environments/0_development}/provider.tf | 0 .../environments/1_qa}/provider.tf | 0 .../environments/1_qa/qa.auto.tfvars.backup | 0 .../production.auto.tfvars.backup | 0 .../environments/2_production}/provider.tf | 0 .../manifests}/datasource.tf | 0 .../manifests/instance.tf | 0 .../manifests}/provider.tf | 0 .../manifests}/security_group.tf | 0 .../manifests/variables.tf | 0 .../manifests}/vpc.tf | 0 03_05_adapted_configuration/main.tf | 97 --------- .../terraform.tfvars.backup | 0 03_05_adapted_configuration/variables.tf | 60 ------ .../development.auto.tfvars.backup | 13 -- .../environments/0_development/provider.tf | 8 - .../environments/1_qa/provider.tf | 8 - .../production.auto.tfvars.backup | 13 -- .../environments/2_production/provider.tf | 8 - .../manifests/datasource.tf | 22 -- 03_06_multi_environment/manifests/instance.tf | 18 -- 03_06_multi_environment/manifests/provider.tf | 8 - .../manifests/security_group.tf | 36 ---- .../manifests/variables.tf | 28 --- 03_06_multi_environment/manifests/vpc.tf | 16 -- 66 files changed, 1371 deletions(-) rename {02_02_variables => 02_02-07_variables}/main.tf (100%) rename {02_02_functions => 02_02-07_variables}/terraform.tfvars.backup (100%) delete mode 100644 02_02_functions/main.tf delete mode 100644 02_02_variables/main.challenge delete mode 100644 02_03_modules/instance.tf.challenge rename {02_06_expressions_functions => 02_08-09_expressions_functions}/main.tf (100%) rename {02_02_variables => 02_08-09_expressions_functions}/terraform.tfvars.backup (100%) rename {02_08_count => 02_10_count}/main.tf (100%) rename {02_08_count => 02_10_count}/terraform.tfvars.backup (100%) delete mode 100644 02_10_modules/main.tf delete mode 100644 02_10_modules/terraform.tfvars.backup rename {02_03_modules => 02_11-12_modules}/main.tf (100%) rename {02_03_modules => 02_11-12_modules}/terraform.tfvars.backup (100%) delete mode 100644 03_01_remotestate/commands.txt delete mode 100644 03_01_remotestate/main.tf delete mode 100644 03_01_remotestate/remote_resources/s3_backend.tf delete mode 100644 03_01_remotestate/terraform.tfvars.backup rename {03_02_remotestate => 03_02-03_remotestate}/commands.txt (100%) rename {03_02_remotestate => 03_02-03_remotestate}/main.tf (100%) rename {03_02_remotestate => 03_02-03_remotestate}/remote_resources/s3_backend.tf (100%) rename {02_06_expressions_functions => 03_02-03_remotestate}/terraform.tfvars.backup (100%) delete mode 100644 03_02_complex/instance.tf delete mode 100644 03_02_complex/terraform.tfvars.backup delete mode 100644 03_02_complex/variables.tf delete mode 100644 03_02_remotestate/terraform.tfvars.backup delete mode 100644 03_03_multi_environment/commands.txt delete mode 100644 03_03_multi_environment/environments/1_qa/qa.auto.tvfars.backup delete mode 100644 03_03_multi_environment/manifests/datasource.tf delete mode 100644 03_03_multi_environment/manifests/provider.tf delete mode 100644 03_03_multi_environment/manifests/security_group.tf delete mode 100644 03_03_multi_environment/manifests/vpc.tf delete mode 100644 03_04_custommodule/main.tf delete mode 100644 03_04_custommodule/modules/nodejs-instance/LICENSE delete mode 100644 03_04_custommodule/modules/nodejs-instance/README.md delete mode 100644 03_04_custommodule/modules/nodejs-instance/main.tf delete mode 100644 03_04_custommodule/modules/nodejs-instance/outputs.tf delete mode 100644 03_04_custommodule/modules/nodejs-instance/variables.tf delete mode 100644 03_04_custommodule/terraform.tfvars.backup delete mode 100644 03_04_custommodule/variables.tf rename {03_06_multi_environment => 03_05-06_multi_environment}/commands.txt (100%) rename {03_03_multi_environment => 03_05-06_multi_environment}/environments/0_development/development.auto.tfvars.backup (100%) rename {03_02_complex => 03_05-06_multi_environment/environments/0_development}/provider.tf (100%) rename {03_03_multi_environment/environments/0_development => 03_05-06_multi_environment/environments/1_qa}/provider.tf (100%) rename {03_06_multi_environment => 03_05-06_multi_environment}/environments/1_qa/qa.auto.tfvars.backup (100%) rename {03_03_multi_environment => 03_05-06_multi_environment}/environments/2_production/production.auto.tfvars.backup (100%) rename {03_03_multi_environment/environments/1_qa => 03_05-06_multi_environment/environments/2_production}/provider.tf (100%) rename {03_02_complex => 03_05-06_multi_environment/manifests}/datasource.tf (100%) rename {03_03_multi_environment => 03_05-06_multi_environment}/manifests/instance.tf (100%) rename {03_03_multi_environment/environments/2_production => 03_05-06_multi_environment/manifests}/provider.tf (100%) rename {03_02_complex => 03_05-06_multi_environment/manifests}/security_group.tf (100%) rename {03_03_multi_environment => 03_05-06_multi_environment}/manifests/variables.tf (100%) rename {03_02_complex => 03_05-06_multi_environment/manifests}/vpc.tf (100%) delete mode 100644 03_05_adapted_configuration/main.tf delete mode 100644 03_05_adapted_configuration/terraform.tfvars.backup delete mode 100644 03_05_adapted_configuration/variables.tf delete mode 100644 03_06_multi_environment/environments/0_development/development.auto.tfvars.backup delete mode 100644 03_06_multi_environment/environments/0_development/provider.tf delete mode 100644 03_06_multi_environment/environments/1_qa/provider.tf delete mode 100644 03_06_multi_environment/environments/2_production/production.auto.tfvars.backup delete mode 100644 03_06_multi_environment/environments/2_production/provider.tf delete mode 100644 03_06_multi_environment/manifests/datasource.tf delete mode 100644 03_06_multi_environment/manifests/instance.tf delete mode 100644 03_06_multi_environment/manifests/provider.tf delete mode 100644 03_06_multi_environment/manifests/security_group.tf delete mode 100644 03_06_multi_environment/manifests/variables.tf delete mode 100644 03_06_multi_environment/manifests/vpc.tf diff --git a/02_02_variables/main.tf b/02_02-07_variables/main.tf similarity index 100% rename from 02_02_variables/main.tf rename to 02_02-07_variables/main.tf diff --git a/02_02_functions/terraform.tfvars.backup b/02_02-07_variables/terraform.tfvars.backup similarity index 100% rename from 02_02_functions/terraform.tfvars.backup rename to 02_02-07_variables/terraform.tfvars.backup diff --git a/02_02_functions/main.tf b/02_02_functions/main.tf deleted file mode 100644 index 0ee4ed6..0000000 --- a/02_02_functions/main.tf +++ /dev/null @@ -1,195 +0,0 @@ -# ////////////////////////////// -# VARIABLES -# ////////////////////////////// -variable "aws_access_key" {} - -variable "aws_secret_key" {} - -variable "ssh_key_name" {} - -variable "private_key_path" {} - -variable "region" { - default = "us-east-2" -} - -variable "vpc_cidr" { - default = "172.16.0.0/16" -} - -variable "subnet1_cidr" { - default = "172.16.0.0/24" -} - -variable "environment_list" { - type = list(string) - default = ["DEV","QA","STAGE","PROD"] -} - -variable "environment_map" { - type = map(string) - default = { - "DEV" = "DEV", - "QA" = "QA", - "STAGE" = "STAGE", - "PROD" = "PROD" - } -} - -variable "environment_instance_type" { - type = map(string) - default = { - "DEV" = "t2.micro", - "QA" = "t2.micro", - "STAGE" = "t2.micro", - "PROD" = "t2.micro" - } -} - -variable "environment_instance_settings" { - type = map(object({instance_type=string, monitoring=bool})) - default = { - "DEV" = { - instance_type = "t2.micro", - monitoring = false - }, - "QA" = { - instance_type = "t2.micro", - monitoring = false - }, - "STAGE" = { - instance_type = "t2.micro", - monitoring = false - }, - "PROD" = { - instance_type = "t2.micro", - monitoring = true - } - } -} - -# ////////////////////////////// -# PROVIDERS -# ////////////////////////////// -provider "aws" { - access_key = var.aws_access_key - secret_key = var.aws_secret_key - region = var.region -} - -# ////////////////////////////// -# RESOURCES -# ////////////////////////////// - -# VPC -resource "aws_vpc" "vpc1" { - cidr_block = var.vpc_cidr - enable_dns_hostnames = "true" -} - -# SUBNET -resource "aws_subnet" "subnet1" { - cidr_block = var.subnet1_cidr - vpc_id = aws_vpc.vpc1.id - map_public_ip_on_launch = "true" - availability_zone = data.aws_availability_zones.available.names[1] -} - -# INTERNET_GATEWAY -resource "aws_internet_gateway" "gateway1" { - vpc_id = aws_vpc.vpc1.id -} - -# ROUTE_TABLE -resource "aws_route_table" "route_table1" { - vpc_id = aws_vpc.vpc1.id - - route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.gateway1.id - } -} - -resource "aws_route_table_association" "route-subnet1" { - subnet_id = aws_subnet.subnet1.id - route_table_id = aws_route_table.route_table1.id -} - -# SECURITY_GROUP -resource "aws_security_group" "sg-nodejs-instance" { - name = "nodejs_sg" - vpc_id = aws_vpc.vpc1.id - - ingress { - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# INSTANCE -resource "aws_instance" "node_instances" { - count = 4 - - ami = data.aws_ami.aws-linux.id - instance_type = var.environment_instance_settings["PROD"].instance_type - subnet_id = aws_subnet.subnet1.id - vpc_security_group_ids = [aws_security_group.sg-nodejs-instance.id] - key_name = var.ssh_key_name - - monitoring = var.environment_instance_settings["PROD"].monitoring - - tags = {Environment = var.environment_list[0]} - -} - -# ////////////////////////////// -# DATA -# ////////////////////////////// -data "aws_availability_zones" "available" {} - -data "aws_ami" "aws-linux" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-hvm*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } -} - -# ////////////////////////////// -# OUTPUT -# ////////////////////////////// -output "instance-dns" { - value = aws_instance.node_instances.*.public_dns -} - -output "private-dns" { - value = aws_instance.node_instances.*.private_dns -} \ No newline at end of file diff --git a/02_02_variables/main.challenge b/02_02_variables/main.challenge deleted file mode 100644 index 6e086f2..0000000 --- a/02_02_variables/main.challenge +++ /dev/null @@ -1,193 +0,0 @@ -# ////////////////////////////// -# VARIABLES -# ////////////////////////////// -variable "aws_access_key" {} - -variable "aws_secret_key" {} - -variable "deploy_environment" { - default = "DEV" -} - -variable "region" { - default = "us-east-2" -} - -variable "vpc_cidr" { - default = "172.16.0.0/16" -} - -variable "subnet1_cidr" { - default = "172.16.0.0/24" -} - -variable "environment_list" { - type = list(string) - default = ["DEV","QA","STAGE","PROD"] -} - -variable "environment_map" { - type = map(string) - default = { - "DEV" = "DEV", - "QA" = "QA", - "STAGE" = "STAGE", - "PROD" = "PROD" - } -} - -variable "environment_instance_type" { - type = map(string) - default = { - "DEV" = "t2.micro", - "QA" = "t2.micro", - "STAGE" = "t2.micro", - "PROD" = "t2.micro" - } -} - -variable "environment_instance_settings" { - type = map(object({instance_type=string, monitoring=bool})) - default = { - "DEV" = { - instance_type = "t2.micro", - monitoring = false - }, - "QA" = { - instance_type = "t2.micro", - monitoring = false - }, - "STAGE" = { - instance_type = "t2.micro", - monitoring = false - }, - "PROD" = { - instance_type = "t2.micro", - monitoring = true - } - } -} - -# ////////////////////////////// -# PROVIDERS -# ////////////////////////////// -provider "aws" { - access_key = var.aws_access_key - secret_key = var.aws_secret_key - region = var.region -} - -# ////////////////////////////// -# RESOURCES -# ////////////////////////////// - -# VPC -resource "aws_vpc" "vpc1" { - cidr_block = var.vpc_cidr - enable_dns_hostnames = "true" -} - -# SUBNET -resource "aws_subnet" "subnet1" { - cidr_block = var.subnet1_cidr - vpc_id = aws_vpc.vpc1.id - map_public_ip_on_launch = "true" - availability_zone = data.aws_availability_zones.available.names[1] -} - -# INTERNET_GATEWAY -resource "aws_internet_gateway" "gateway1" { - vpc_id = aws_vpc.vpc1.id -} - -# ROUTE_TABLE -resource "aws_route_table" "route_table1" { - vpc_id = aws_vpc.vpc1.id - - route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.gateway1.id - } -} - -resource "aws_route_table_association" "route-subnet1" { - subnet_id = aws_subnet.subnet1.id - route_table_id = aws_route_table.route_table1.id -} - -# SECURITY_GROUP -resource "aws_security_group" "sg-nodejs-instance" { - name = "nodejs_sg" - vpc_id = aws_vpc.vpc1.id - - ingress { - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# INSTANCE -resource "aws_instance" "nodejs1" { - ami = data.aws_ami.aws-linux.id - //instance_type = var.environment_instance_type["DEV"] - instance_type = var.environment_instance_settings[var.deploy_environment].instance_type - subnet_id = aws_subnet.subnet1.id - vpc_security_group_ids = [aws_security_group.sg-nodejs-instance.id] - - monitoring = var.environment_instance_settings[var.deploy_environment].monitoring - - tags = {Environment = var.environment_map[var.deploy_environment]} - -} - -# ////////////////////////////// -# DATA -# ////////////////////////////// -data "aws_availability_zones" "available" {} - -data "aws_ami" "aws-linux" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-hvm*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } -} - -# ////////////////////////////// -# OUTPUT -# ////////////////////////////// -output "instance-dns" { - value = aws_instance.nodejs1.public_dns -} - -output "private-dns" { - value = aws_instance.nodejs1.private_dns -} \ No newline at end of file diff --git a/02_03_modules/instance.tf.challenge b/02_03_modules/instance.tf.challenge deleted file mode 100644 index 617f847..0000000 --- a/02_03_modules/instance.tf.challenge +++ /dev/null @@ -1,23 +0,0 @@ -# ////////////////////////////// -# EC2 MODULE -# ////////////////////////////// -module "ec2_cluster" { - source = "terraform-aws-modules/ec2-instance/aws" - version = "~> 2.0" - - name = "frontend-linux" - instance_count = 1 - - ami = data.aws_ami.aws-linux.id - instance_type = "t2.micro" - - vpc_security_group_ids = [aws_security_group.sg_frontend.id] - subnet_id = module.vpc.public_subnets[1] -} - -# ////////////////////////////// -# OUTPUT -# ////////////////////////////// -output "instance-ip" { - value = module.ec2_cluster.public_ip -} \ No newline at end of file diff --git a/02_06_expressions_functions/main.tf b/02_08-09_expressions_functions/main.tf similarity index 100% rename from 02_06_expressions_functions/main.tf rename to 02_08-09_expressions_functions/main.tf diff --git a/02_02_variables/terraform.tfvars.backup b/02_08-09_expressions_functions/terraform.tfvars.backup similarity index 100% rename from 02_02_variables/terraform.tfvars.backup rename to 02_08-09_expressions_functions/terraform.tfvars.backup diff --git a/02_08_count/main.tf b/02_10_count/main.tf similarity index 100% rename from 02_08_count/main.tf rename to 02_10_count/main.tf diff --git a/02_08_count/terraform.tfvars.backup b/02_10_count/terraform.tfvars.backup similarity index 100% rename from 02_08_count/terraform.tfvars.backup rename to 02_10_count/terraform.tfvars.backup diff --git a/02_10_modules/main.tf b/02_10_modules/main.tf deleted file mode 100644 index f58a102..0000000 --- a/02_10_modules/main.tf +++ /dev/null @@ -1,98 +0,0 @@ -# ////////////////////////////// -# VARIABLES -# ////////////////////////////// -variable "aws_access_key" {} - -variable "aws_secret_key" {} - -variable "region" { - default = "us-east-2" -} - - -# ////////////////////////////// -# PROVIDERS -# ////////////////////////////// -provider "aws" { - access_key = var.aws_access_key - secret_key = var.aws_secret_key - region = var.region -} - -# ////////////////////////////// -# SECURITY GROUP -# ////////////////////////////// -resource "aws_security_group" "sg_frontend" { - name = "sg_frontend" - vpc_id = module.vpc.vpc_id - - ingress { - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} - -# ////////////////////////////// -# MODULES -# ////////////////////////////// -module "vpc" { - source = "terraform-aws-modules/vpc/aws" - name = "frontend-vpc" - cidr = "10.0.0.0/16" - - azs = ["us-east-2a", "us-east-2b", "us-east-2c"] - private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] - public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] - - enable_nat_gateway = true - single_nat_gateway = true - # one_nat_gateway_per_az = true -} - - -# ////////////////////////////// -# DATA -# ////////////////////////////// -data "aws_ami" "aws-linux" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-hvm*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } -} \ No newline at end of file diff --git a/02_10_modules/terraform.tfvars.backup b/02_10_modules/terraform.tfvars.backup deleted file mode 100644 index af8b4ef..0000000 --- a/02_10_modules/terraform.tfvars.backup +++ /dev/null @@ -1,3 +0,0 @@ -aws_access_key = "" - -aws_secret_key = "" \ No newline at end of file diff --git a/02_03_modules/main.tf b/02_11-12_modules/main.tf similarity index 100% rename from 02_03_modules/main.tf rename to 02_11-12_modules/main.tf diff --git a/02_03_modules/terraform.tfvars.backup b/02_11-12_modules/terraform.tfvars.backup similarity index 100% rename from 02_03_modules/terraform.tfvars.backup rename to 02_11-12_modules/terraform.tfvars.backup diff --git a/03_01_remotestate/commands.txt b/03_01_remotestate/commands.txt deleted file mode 100644 index d361a5f..0000000 --- a/03_01_remotestate/commands.txt +++ /dev/null @@ -1,5 +0,0 @@ -terraform init \ - -backend-config="bucket=red30-tfstate" \ - -backend-config="key=red30/ecommerceapp/app.state" \ - -backend-config="region=us-east-2" \ - -backend-config="dynamodb_table=red30-tfstatelock" diff --git a/03_01_remotestate/main.tf b/03_01_remotestate/main.tf deleted file mode 100644 index 6a7f595..0000000 --- a/03_01_remotestate/main.tf +++ /dev/null @@ -1,78 +0,0 @@ -# ////////////////////////////// -# BACKEND -# ////////////////////////////// -terraform { - backend "s3" { - } -} - -# ////////////////////////////// -# VARIABLES -# ////////////////////////////// -variable "aws_access_key" {} - -variable "aws_secret_key" {} - -variable "region" { - default = "us-east-2" -} - -variable "vpc_cidr" { - default = "172.16.0.0/16" -} - -variable "subnet1_cidr" { - default = "172.16.0.0/24" -} - -# ////////////////////////////// -# PROVIDERS -# ////////////////////////////// -provider "aws" { - access_key = var.aws_access_key - secret_key = var.aws_secret_key - region = var.region -} - - -# ////////////////////////////// -# MODULES -# ////////////////////////////// -module "vpc" { - source = "terraform-aws-modules/vpc/aws" - - name = "vpc-module-example" - - cidr = "10.0.0.0/16" - - azs = ["us-east-2a", "us-east-2b", "us-east-2c"] - private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] - public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] - - enable_nat_gateway = true - single_nat_gateway = true -} - - -# ////////////////////////////// -# DATA -# ////////////////////////////// -data "aws_ami" "aws-linux" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-hvm*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } -} diff --git a/03_01_remotestate/remote_resources/s3_backend.tf b/03_01_remotestate/remote_resources/s3_backend.tf deleted file mode 100644 index 9c74dfb..0000000 --- a/03_01_remotestate/remote_resources/s3_backend.tf +++ /dev/null @@ -1,104 +0,0 @@ -# ////////////////////////////// -# VARIABLES -# ////////////////////////////// -variable "aws_access_key" {} - -variable "aws_secret_key" {} - -variable "bucket_name" { - default = "red30-tfstate" -} - -# ////////////////////////////// -# PROVIDER -# ////////////////////////////// -provider "aws" { - access_key = var.aws_access_key - secret_key = var.aws_secret_key - region = "us-east-2" -} - -# ////////////////////////////// -# S3 BUCKET -# ////////////////////////////// -resource "aws_s3_bucket" "red30-tfremotestate" { - bucket = var.bucket_name - force_destroy = true - acl = "private" - - versioning { - enabled = true - } - - # Grant read/write access to the terraform user - policy = <