Skip to content

Commit

Permalink
Terraform V12 by cloudgeeks.ca
Browse files Browse the repository at this point in the history
  • Loading branch information
quickbooks2018 committed Jun 9, 2020
1 parent 912604a commit d8f3d40
Show file tree
Hide file tree
Showing 42 changed files with 180 additions and 180 deletions.
6 changes: 3 additions & 3 deletions commands
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ c terraform apply

3. terraform output -module=module-name

4.terraform plan -target=module.infragurus-vpc ---> only plan specific modules
4.terraform plan -target=module.cloudgeeks.ca-vpc ---> only plan specific modules

5.terraform apply -target=module.infragurus-vpc ---> only apply specific modules
5.terraform apply -target=module.cloudgeeks.ca-vpc ---> only apply specific modules

6.terraform state pull----> ok

7.terraform state push---->danger

8.terraform state rm module.infragurus-rds-app1 ----> https://stackoverflow.com/questions/43950097/how-to-import-manual-changes-into-terraform-remote-state
8.terraform state rm module.cloudgeeks.ca-rds-app1 ----> https://stackoverflow.com/questions/43950097/how-to-import-manual-changes-into-terraform-remote-state

9.terraform show ---> see after deployment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module "vpc" {
source = "../../modules/aws-vpc"

vpc-location = "Virginia"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
name = "vpc"
stage = "dev"
map_public_ip_on_launch = "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ c terraform apply

3. terraform output -module=module-name

4.terraform plan -target=module.infragurus-vpc ---> only plan specific modules
4.terraform plan -target=module.cloudgeeks.ca-vpc ---> only plan specific modules

5.terraform apply -target=module.infragurus-vpc ---> only apply specific modules
5.terraform apply -target=module.cloudgeeks.ca-vpc ---> only apply specific modules

6.terraform state pull----> ok

7.terraform state push---->danger

8.terraform state rm module.infragurus-rds-app1 ----> https://stackoverflow.com/questions/43950097/how-to-import-manual-changes-into-terraform-remote-state
8.terraform state rm module.cloudgeeks.ca-rds-app1 ----> https://stackoverflow.com/questions/43950097/how-to-import-manual-changes-into-terraform-remote-state

9.terraform show ---> see after deployment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ provider "aws" {

module "dynamodb" {
source = "../../modules/aws-dynamodb"
dynamoTable_Name = "infragurus-vault"
dynamoTable_Name = "cloudgeeks.ca-vault"
read_capacity = 5
write_capacity = 5
tag_Name = "infragurus-vault"
tag_Name = "cloudgeeks.ca-vault"
tag_Environment = "dev"
}

Expand All @@ -24,7 +24,7 @@ module "vpc" {
source = "../../modules/aws-vpc"

vpc-location = "Virginia"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
name = "vpc"
stage = "vault-dev"
map_public_ip_on_launch = "true"
Expand All @@ -39,7 +39,7 @@ module "vpc" {

module "sg1" {
source = "../../modules/aws-sg-cidr"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "vault"
tcp_ports = "22,80,443,8201,23525"
Expand All @@ -50,7 +50,7 @@ module "sg1" {

module "sg2" {
source = "../../modules/aws-sg-ref-v2"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "vault-Ref"
tcp_ports = "22,80,443,8201,3306"
Expand All @@ -68,7 +68,7 @@ module "openvpn-eip" {

module "ec2-openvpn" {
source = "../../modules/aws-ec2"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "openvpn"
key_name = "vault-demo"
Expand All @@ -86,7 +86,7 @@ module "ec2-openvpn" {

module "ec2-vault-master" {
source = "../../modules/aws-ec2"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "vault-master"
key_name = "vault-master"
Expand All @@ -103,7 +103,7 @@ module "ec2-vault-master" {

module "ec2-vault-failover" {
source = "../../modules/aws-ec2"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "vault-failover"
key_name = "vault-failover"
Expand All @@ -121,11 +121,11 @@ module "ec2-vault-failover" {

module "rds-mysql" {
source = "../../modules/aws-rds-mysql"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "wordpress-db"
rds-name = "wordpress-db"
final-snapshot-identifier = "infragurus-db-final-snap-shot"
final-snapshot-identifier = "cloudgeeks.ca-db-final-snap-shot"
skip-final-snapshot = "true"
rds-allocated-storage = "5"
storage-type = "gp2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#Define the domain name

# DNS
DOMAIN='infragurus'
DOMAIN='cloudgeeks.ca'
SUBDOMAIN='vault'
DNS_1="infragurus.com"
DNS_1="cloudgeeks.ca.com"
DNS_2="localhost"
DNS_3="vault.infragurus.com"
DNS_3="vault.cloudgeeks.ca.com"

# IP
IP_1="127.0.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# DynamoDB Table Creation

REGION="us-east-1"
dynamodbTable="infragurus-vault"
domain="infragurus"
dynamodbTable="cloudgeeks.ca-vault"
domain="cloudgeeks.ca"
kms_key_arn="arn:aws:kms:us-east-1:117519388977:key/16c183e5-f38b-43c6-afc2-4a891af21ddd"
api_addr="https://10.20.4.144:8200"
cluster_addr="https://10.20.4.144:8201"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TRUST="ec2-trust-relationship"
VAULT_KMS_POLICY_NAME="vault-kms"
VAULT_KMS_ARN="arn:aws:iam::$ACCOUNT:policy/$VAULT_KMS_POLICY_NAME"

DYNAMO_TABLE="infragurus-vault"
DYNAMO_TABLE="cloudgeeks.ca-vault"
VAULT_DYNAMODB_POLICY_NAME="vault-dynamodb"
VAULT_DYNAMODB_POLICY_ARN="arn:aws:iam::$ACCOUNT:policy/$VAULT_DYNAMODB_POLICY_NAME"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# DynamoDB Table Creation

REGION="us-east-1"
dynamodbTable="infragurus-vault"
domain="infragurus"
dynamodbTable="cloudgeeks.ca-vault"
domain="cloudgeeks.ca"
kms_key_arn="arn:aws:kms:us-east-1:117519388977:key/16c183e5-f38b-43c6-afc2-4a891af21ddd"
api_addr="https://10.20.4.201:8200"
cluster_addr="https://10.20.4.144:8201"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TRUST="ec2-trust-relationship"
VAULT_KMS_POLICY_NAME="vault-kms"
VAULT_KMS_ARN="arn:aws:iam::$ACCOUNT:policy/$VAULT_KMS_POLICY_NAME"

DYNAMO_TABLE="infragurus-vault"
DYNAMO_TABLE="cloudgeeks.ca-vault"
VAULT_DYNAMODB_POLICY_NAME="vault-dynamodb"
VAULT_DYNAMODB_POLICY_ARN="arn:aws:iam::$ACCOUNT:policy/$VAULT_DYNAMODB_POLICY_NAME"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ systemctl status docker

# vault Container

docker network create infragurus
docker network create cloudgeeks.ca

docker run --name vault -d --network=infragurus --user=root -v /root/vault:/var/vault_home -p 8080:8080 -v $(which docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /root:/root --restart always vault/vault:lts
docker run --name vault -d --network=cloudgeeks.ca --user=root -v /root/vault:/var/vault_home -p 8080:8080 -v $(which docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /root:/root --restart always vault/vault:lts

# Nginx Container

Expand Down Expand Up @@ -52,11 +52,11 @@ yum install -y vim 2> /dev/null
echo '
server {
listen 80;
server_name vault.infragurus.com;
server_name vault.cloudgeeks.ca.com;
return 301 https://$host$request_uri;
}
server {
server_name vault.infragurus.com;
server_name vault.cloudgeeks.ca.com;
listen 443 ssl;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/certs/nginx-selfsigned.key;
Expand All @@ -82,7 +82,7 @@ location / {
}' > ~/nginx/conf.d/server.conf

#8
docker run --name nginx --network=infragurus --restart unless-stopped -v ~/ssl/certs:/etc/ssl/certs -v ~/nginx/conf.d:/etc/nginx/conf.d -p 443:443 -p 80:80 -d nginx
docker run --name nginx --network=cloudgeeks.ca --restart unless-stopped -v ~/ssl/certs:/etc/ssl/certs -v ~/nginx/conf.d:/etc/nginx/conf.d -p 443:443 -p 80:80 -d nginx


#END
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Create a Key from AWS Console

ALIAS_NAME_KMS_KEY_ID='5b7d1d0d-624c-487d-869f-b8298529d678'
RDS_USER='infragurus'
RDS_USER='cloudgeeks.ca'
RDS_PASSWORD='123456789'
RDS_DATABASE_NAME='wordpress'

Expand Down
12 changes: 6 additions & 6 deletions terraform.v12/RDS_wordpress_docker/environment/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "vpc" {
source = "../../modules/aws-vpc"

vpc-location = "Virginia"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
name = "vpc"
stage = "docker-dev"
map_public_ip_on_launch = "true"
Expand All @@ -26,7 +26,7 @@ module "vpc" {

module "sg1" {
source = "../../modules/aws-sg-cidr"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "docker"
tcp_ports = "22,80,443"
Expand All @@ -37,7 +37,7 @@ module "sg1" {

module "sg2" {
source = "../../modules/aws-sg-ref-v2"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "docker-Ref"
tcp_ports = "80,443,3306"
Expand All @@ -62,7 +62,7 @@ module "docker-eip" {

module "ec2-docker" {
source = "../../modules/aws-ec2"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "docker"
key_name = "docker-demo"
Expand All @@ -80,11 +80,11 @@ module "ec2-docker" {

module "rds-mysql" {
source = "../../modules/aws-rds-mysql"
namespace = "infragurus"
namespace = "cloudgeeks.ca"
stage = "dev"
name = "wordpress-db"
rds-name = "wordpress-db"
final-snapshot-identifier = "infragurus-db-final-snap-shot"
final-snapshot-identifier = "cloudgeeks.ca-db-final-snap-shot"
skip-final-snapshot = "true"
rds-allocated-storage = "5"
storage-type = "gp2"
Expand Down
Loading

0 comments on commit d8f3d40

Please sign in to comment.