google-site-verification=EmVnnySXehAfTr_j8ZJN48hwvxJtfNf80pkPX1ObQlA Fast Track News: March || Level 2 || Lab 9 Interact with Terraform Modules

March || Level 2 || Lab 9 Interact with Terraform Modules

 export PROJECT_ID=$(gcloud config get-value project)

git clone https://github.com/terraform-google-modules/terraform-google-network

cd terraform-google-network

git checkout tags/v6.0.1 -b v6.0.1

echo 'module "test-vpc-module" {

  source       = "terraform-google-modules/network/google"

  version      = "~> 6.0"

  project_id   = var.project_id

  network_name = var.network_name

  mtu          = 1460


  subnets = [

    {

      subnet_name   = "subnet-01"

      subnet_ip     = "10.10.10.0/24"

      subnet_region = "us-west1"

    },

    {

      subnet_name           = "subnet-02"

      subnet_ip             = "10.10.20.0/24"

      subnet_region         = "us-west1"

      subnet_private_access = "true"

      subnet_flow_logs      = "true"

    },

    {

      subnet_name               = "subnet-03"

      subnet_ip                 = "10.10.30.0/24"

      subnet_region             = "us-west1"

      subnet_flow_logs          = "true"

      subnet_flow_logs_interval = "INTERVAL_10_MIN"

      subnet_flow_logs_sampling = 0.7

      subnet_flow_logs_metadata = "INCLUDE_ALL_METADATA"

      subnet_flow_logs_filter   = "false"

    }

  ]

}' > examples/simple_project/main.tf


echo 'variable "project_id" {

  description = "The project ID to host the network in Cloudhustler"

  default     = "'"$PROJECT_ID"'"

}

variable "network_name" {

  description = "The name of the VPC network being created Hustler"

  default     = "cloudhustlers"

}' > examples/simple_project/variables.tf

cd ~/terraform-google-network/examples/simple_project

terraform init

terraform apply -auto-approve

terraform destroy -auto-approve

rm -rd terraform-google-network -f

cd ~

gsutil mb gs://$PROJECT_ID

curl https://raw.githubusercontent.com/hashicorp/learn-terraform-modules/master/modules/aws-s3-static-website-bucket/www/index.html > index.html

curl https://raw.githubusercontent.com/hashicorp/learn-terraform-modules/blob/master/modules/aws-s3-static-website-bucket/www/error.html > error.html

gsutil cp *.html gs://$PROJECT_ID

No comments:

Post a Comment

April Week 2 || Lab 2 || Troubleshooting Data Models in Looker

  CREATE NEW FILE NAME: user_order_lifetime view: user_order_lifetime { derived_table: { sql: SELECT order_items.user_id as us...