Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mine #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Mine #25

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions 01_05_base/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions 02_01_variables/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions 02_01_variables/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ variable "environment_list" {
default = ["DEV","QA","STAGE","PROD"]
}

variable "deploy_environment" {
default = "DEV"
}

variable "environment_map" {
type = map(string)
default = {
Expand Down Expand Up @@ -141,14 +145,16 @@ resource "aws_security_group" "sg-nodejs-instance" {
# 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["PROD"].instance_type
//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["PROD"].monitoring
monitoring = var.environment_instance_settings[var.deploy_environment].monitoring

tags = {Environment = var.environment_list[0]}
//tags = {Environment = var.environment_list[0]}
//tags = {Environment = var.deploy_environment[0]}
tags = {Environment = var.environment_map[var.deploy_environment]}

}

Expand Down
2 changes: 1 addition & 1 deletion 03_02-03_remotestate/commands.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform init \
-backend-config="bucket=red30-tfstate" \
-backend-config="bucket=sewared30-tfstate" \
-backend-config="key=red30/ecommerceapp/app.state" \
-backend-config="region=us-east-2" \
-backend-config="dynamodb_table=red30-tfstatelock" \
Expand Down
4 changes: 2 additions & 2 deletions 03_02-03_remotestate/remote_resources/s3_backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data "aws_iam_user" "terraform" {
# //////////////////////////////
# S3 BUCKET
# //////////////////////////////
resource "aws_s3_bucket" "red30-tfremotestate" {
resource "aws_s3_bucket" "sssred30-tfremotestate" {
bucket = var.bucket_name
force_destroy = true
acl = "private"
Expand Down Expand Up @@ -68,7 +68,7 @@ resource "aws_s3_bucket_public_access_block" "red30-tfremotestate" {
# //////////////////////////////
# DYNAMODB TABLE
# //////////////////////////////
resource "aws_dynamodb_table" "tf_db_statelock" {
resource "aws_dynamodb_table" "ssstf_db_statelock" {
name = "red30-tfstatelock"
read_capacity = 20
write_capacity = 20
Expand Down