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

updated database name locally #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

anoopfirefox
Copy link
Contributor

No description provided.

Copy link

Environment npd

Workflow GCP-GHA

QSAloyment Engine Plan 📖success

QSAloyment Engine Plan:

Show Plan


Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
 + create

Terraform will perform the following actions:

 # module.database.google_compute_global_address.private_ip_address will be created
 + resource "google_compute_global_address" "private_ip_address" {
     + address            = (known after apply)
     + address_type       = "INTERNAL"
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "private-ip-address"
     + network            = "web-app-vpc"
     + prefix_length      = 16
     + project            = "stone-botany-426817-p5"
     + purpose            = "VPC_PEERING"
     + self_link          = (known after apply)
   }

 # module.database.google_service_networking_connection.private_vpc_connection will be created
 + resource "google_service_networking_connection" "private_vpc_connection" {
     + id                      = (known after apply)
     + network                 = "web-app-vpc"
     + peering                 = (known after apply)
     + reserved_peering_ranges = [
         + "private-ip-address",
       ]
     + service                 = "servicenetworking.googleapis.com"
   }

 # module.database.google_sql_database.example_db will be created
 + resource "google_sql_database" "example_db" {
     + charset         = (known after apply)
     + collation       = (known after apply)
     + deletion_policy = "DELETE"
     + id              = (known after apply)
     + instance        = "webapp-db-master"
     + name            = "exampledb"
     + project         = "stone-botany-426817-p5"
     + self_link       = (known after apply)
   }

 # module.database.google_sql_database_instance.master will be created
 + resource "google_sql_database_instance" "master" {
     + available_maintenance_versions = (known after apply)
     + connection_name                = (known after apply)
     + database_version               = "POSTGRES_15"
     + deletion_protection            = false
     + dns_name                       = (known after apply)
     + encryption_key_name            = (known after apply)
     + first_ip_address               = (known after apply)
     + id                             = (known after apply)
     + instance_type                  = (known after apply)
     + ip_address                     = (known after apply)
     + maintenance_version            = (known after apply)
     + master_instance_name           = (known after apply)
     + name                           = "webapp-db-master"
     + private_ip_address             = (known after apply)
     + project                        = "stone-botany-426817-p5"
     + psc_service_attachment_link    = (known after apply)
     + public_ip_address              = (known after apply)
     + region                         = "us-central1"
     + self_link                      = (known after apply)
     + server_ca_cert                 = (sensitive value)
     + service_account_email_address  = (known after apply)

     + settings {
         + activation_policy     = "ALWAYS"
         + availability_type     = "REGIONAL"
         + connector_enforcement = (known after apply)
         + disk_autoresize       = true
         + disk_autoresize_limit = 0
         + disk_size             = 10
         + disk_type             = "PD_SSD"
         + edition               = "ENTERPRISE"
         + pricing_plan          = "PER_USE"
         + tier                  = "db-f1-micro"
         + user_labels           = (known after apply)
         + version               = (known after apply)

         + backup_configuration {
             + enabled                        = true
             + start_time                     = (known after apply)
             + transaction_log_retention_days = (known after apply)
           }

         + ip_configuration {
             + ipv4_enabled    = false
             + private_network = "projects/stone-botany-426817-p5/global/networks/web-app-vpc"
             + ssl_mode        = (known after apply)
           }
       }
   }

 # module.database.google_sql_database_instance.read_replica will be created
 + resource "google_sql_database_instance" "read_replica" {
     + available_maintenance_versions = (known after apply)
     + connection_name                = (known after apply)
     + database_version               = "POSTGRES_15"
     + deletion_protection            = false
     + dns_name                       = (known after apply)
     + encryption_key_name            = (known after apply)
     + first_ip_address               = (known after apply)
     + id                             = (known after apply)
     + instance_type                  = (known after apply)
     + ip_address                     = (known after apply)
     + maintenance_version            = (known after apply)
     + master_instance_name           = "webapp-db-master"
     + name                           = "webapp-db-read-replica"
     + private_ip_address             = (known after apply)
     + project                        = "stone-botany-426817-p5"
     + psc_service_attachment_link    = (known after apply)
     + public_ip_address              = (known after apply)
     + region                         = "europe-north1"
     + self_link                      = (known after apply)
     + server_ca_cert                 = (sensitive value)
     + service_account_email_address  = (known after apply)

     + replica_configuration {
         + failover_target = false
       }

     + settings {
         + activation_policy     = "ALWAYS"
         + availability_type     = "REGIONAL"
         + connector_enforcement = (known after apply)
         + disk_autoresize       = true
         + disk_autoresize_limit = 0
         + disk_size             = 10
         + disk_type             = "PD_SSD"
         + edition               = "ENTERPRISE"
         + pricing_plan          = "PER_USE"
         + tier                  = "db-f1-micro"
         + user_labels           = (known after apply)
         + version               = (known after apply)

         + backup_configuration {
             + enabled                        = false
             + start_time                     = (known after apply)
             + transaction_log_retention_days = (known after apply)
           }

         + ip_configuration {
             + ipv4_enabled    = false
             + private_network = "projects/stone-botany-426817-p5/global/networks/web-app-vpc"
             + ssl_mode        = (known after apply)
           }
       }
   }

 # module.database.google_sql_user.root will be created
 + resource "google_sql_user" "root" {
     + host                    = (known after apply)
     + id                      = (known after apply)
     + instance                = "webapp-db-master"
     + name                    = "root"
     + password                = (sensitive value)
     + project                 = "stone-botany-426817-p5"
     + sql_server_user_details = (known after apply)
   }

 # module.load_balancer.google_compute_backend_service.default will be created
 + resource "google_compute_backend_service" "default" {
     + connection_draining_timeout_sec = 300
     + creation_timestamp              = (known after apply)
     + enable_cdn                      = true
     + fingerprint                     = (known after apply)
     + generated_id                    = (known after apply)
     + health_checks                   = (known after apply)
     + id                              = (known after apply)
     + load_balancing_scheme           = "EXTERNAL"
     + name                            = "mig-backend-service"
     + port_name                       = (known after apply)
     + project                         = "stone-botany-426817-p5"
     + protocol                        = "HTTP"
     + self_link                       = (known after apply)
     + session_affinity                = "NONE"
     + timeout_sec                     = 10

     + backend {
         + balancing_mode               = "UTILIZATION"
         + capacity_scaler              = 1
         + group                        = (known after apply)
         + max_connections              = (known after apply)
         + max_connections_per_endpoint = (known after apply)
         + max_connections_per_instance = (known after apply)
         + max_rate                     = (known after apply)
         + max_rate_per_endpoint        = (known after apply)
         + max_rate_per_instance        = (known after apply)
         + max_utilization              = 0.8
           # (1 unchanged attribute hidden)
       }
     + backend {
         + balancing_mode               = "UTILIZATION"
         + capacity_scaler              = 1
         + group                        = (known after apply)
         + max_connections              = (known after apply)
         + max_connections_per_endpoint = (known after apply)
         + max_connections_per_instance = (known after apply)
         + max_rate                     = (known after apply)
         + max_rate_per_endpoint        = (known after apply)
         + max_rate_per_instance        = (known after apply)
         + max_utilization              = 0.8
           # (1 unchanged attribute hidden)
       }
   }

 # module.load_balancer.google_compute_global_address.website will be created
 + resource "google_compute_global_address" "website" {
     + address            = (known after apply)
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "website-lb-ip"
     + prefix_length      = (known after apply)
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
   }

 # module.load_balancer.google_compute_global_forwarding_rule.default will be created
 + resource "google_compute_global_forwarding_rule" "default" {
     + base_forwarding_rule  = (known after apply)
     + effective_labels      = (known after apply)
     + id                    = (known after apply)
     + ip_address            = (known after apply)
     + ip_protocol           = "TCP"
     + label_fingerprint     = (known after apply)
     + load_balancing_scheme = "EXTERNAL"
     + name                  = "website-forwarding-rule"
     + network               = (known after apply)
     + port_range            = "80"
     + project               = "stone-botany-426817-p5"
     + psc_connection_id     = (known after apply)
     + psc_connection_status = (known after apply)
     + self_link             = (known after apply)
     + subnetwork            = (known after apply)
     + target                = (known after apply)
     + terraform_labels      = (known after apply)
   }

 # module.load_balancer.google_compute_health_check.default will be created
 + resource "google_compute_health_check" "default" {
     + check_interval_sec  = 5
     + creation_timestamp  = (known after apply)
     + healthy_threshold   = 4
     + id                  = (known after apply)
     + name                = "tcp-proxy-health-check"
     + project             = "stone-botany-426817-p5"
     + self_link           = (known after apply)
     + timeout_sec         = 5
     + type                = (known after apply)
     + unhealthy_threshold = 5

     + log_config {
         + enable = true
       }

     + tcp_health_check {
         + port         = 80
         + proxy_header = "NONE"
       }
   }

 # module.load_balancer.google_compute_target_http_proxy.website will be created
 + resource "google_compute_target_http_proxy" "website" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "website-target-proxy"
     + project            = "stone-botany-426817-p5"
     + proxy_bind         = (known after apply)
     + proxy_id           = (known after apply)
     + self_link          = (known after apply)
     + url_map            = (known after apply)
   }

 # module.load_balancer.google_compute_url_map.website will be created
 + resource "google_compute_url_map" "website" {
     + creation_timestamp = (known after apply)
     + default_service    = (known after apply)
     + fingerprint        = (known after apply)
     + id                 = (known after apply)
     + map_id             = (known after apply)
     + name               = "website-url-map"
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)

     + host_rule {
         + hosts        = [
             + "*",
           ]
         + path_matcher = "allpaths"
           # (1 unchanged attribute hidden)
       }

     + path_matcher {
         + default_service = (known after apply)
         + name            = "allpaths"

         + path_rule {
             + paths   = [
                 + "/static",
                 + "/static/*",
               ]
             + service = (known after apply)
           }
         + path_rule {
             + paths   = [
                 + "/home",
                 + "/home/*",
               ]
             + service = (known after apply)
           }
         + path_rule {
             + paths   = [
                 + "/home_page",
               ]
             + service = (known after apply)
           }
       }
   }

 # module.load_balancer.google_dns_record_set.website will be created
 + resource "google_dns_record_set" "website" {
     + id           = (known after apply)
     + managed_zone = "gcp-terraform-dns-zone"
     + name         = "www.platformengine-devops.shop."
     + project      = "stone-botany-426817-p5"
     + rrdatas      = (known after apply)
     + ttl          = 300
     + type         = "A"
   }

 # module.managed_instance_group_region1.google_compute_health_check.autohealing will be created
 + resource "google_compute_health_check" "autohealing" {
     + check_interval_sec  = 5
     + creation_timestamp  = (known after apply)
     + healthy_threshold   = 2
     + id                  = (known after apply)
     + name                = "autohealing-health-check-us-central1"
     + project             = "stone-botany-426817-p5"
     + self_link           = (known after apply)
     + timeout_sec         = 5
     + type                = (known after apply)
     + unhealthy_threshold = 10

     + http_health_check {
         + port         = 80
         + proxy_header = "NONE"
         + request_path = "/"
       }

     + log_config {
         + enable = true
       }
   }

 # module.managed_instance_group_region1.google_compute_instance_template.appserver will be created
 + resource "google_compute_instance_template" "appserver" {
     + can_ip_forward       = false
     + description          = "This template is used to create app server instances in us-central1."
     + effective_labels     = {
         + "environment" = "dev"
       }
     + id                   = (known after apply)
     + instance_description = "description assigned to instances"
     + labels               = {
         + "environment" = "dev"
       }
     + machine_type         = "e2-medium"
     + metadata             = {
         + "startup-script" = <<-EOT
               #!/bin/bash
               exec > /var/log/startup-script.log 2>&1
               set -x
               
               # Function to extract zone information
               get_zone() {
                   local zone_full=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/zone -H "Metadata-Flavor: Google")
                   local zone=$(basename "$zone_full")
                   echo "$zone"
               }
               
               
               # Update package repositories and install Apache
               sudo apt update
               sudo apt -y install apache2
               
               # Define HTML content for the Apache home page
               sudo bash -c "cat <<EOF > /var/www/html/index.html
               <html lang=\"en\">
               <head>
                   <meta charset=\"UTF-8\">
                   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
                   <title>Tech with Thulitha</title>
                   <style>
                       body { 
                           font-family: Arial, sans-serif; 
                           background-color: #004d4d; 
                           color: #ffffff; 
                           margin: 0; 
                           padding: 0; 
                       }
                       .container { 
                           max-width: 800px; 
                           margin: 50px auto; 
                           background-color: #006666; 
                           padding: 20px; 
                           border-radius: 5px; 
                           box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 
                       }
                       h1 { color: #ffffff; text-align: center; }
                       p { color: #d9d9d9; text-align: left; }
                       b { color: #f7f7f7e4; }
                       .value-placeholder { color: #ffffff; }
                       h2 { color: #ffffff; text-align: center; margin-top: 40px; font-family:'Times New Roman', Times, serif;}
                       .social-icon { 
                           font-size: 1.5em; 
                           color: #ffffff; 
                           margin: 0 5px; 
                       }
                       .social-icon:hover { 
                           color: #d9d9d9; 
                       }
                       .social-container { text-align: center; }
                   </style>
                   <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
               </head>
               <body>
                   <div class=\"container\">
                       <h1>Welcome to the Home Page</h1>
                       <p><b>This is the default home page for the Apache web server running on:</b> <span class=\"value-placeholder\">\$(hostname)</span>.</p>
                       <p><b>Server IP Address:</b> <span class=\"value-placeholder\">\$(hostname -i)</span></p>
                       <p><b>Server Domain:</b> <span class=\"value-placeholder\">\$(hostname -d)</span></p>
                       <p><b>Zone:</b> <span class=\"value-placeholder\">$(get_zone)</span></p>
                       <h2>Tech with Thulitha</h2>
                       <div class=\"social-container\">
                           <a href=\"https://github.com/ThulithaNawagamuwa\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-github social-icon\"></i></a>
                           <a href=\"https://medium.com/@thulitha_n\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-medium social-icon\"></i></a>
                           <a href=\"https://www.linkedin.com/in/thulitha-nawagamuwa/\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-linkedin-in social-icon\"></i></a>
                       </div>
                   </div>
               </body>
               </html>
               EOF"
               
               
               sudo mkdir /var/www/html/home/
               
               # copy the home page to /home directory
               sudo cp /var/www/html/index.html /var/www/html/home/index.html
               
               
               # Update 000-default.conf file
               sudo sed -i '/# The ServerName directive/a\
                   Alias "/home_page" "/var/www/html/home"\
               ' /etc/apache2/sites-available/000-default.conf
               
               # Start Apache and enable it to start on boot
               sudo systemctl start apache2
               sudo systemctl enable apache2
           EOT
       }
     + metadata_fingerprint = (known after apply)
     + name                 = (known after apply)
     + name_prefix          = "appserver-template-us-central1-"
     + project              = "stone-botany-426817-p5"
     + region               = (known after apply)
     + self_link            = (known after apply)
     + self_link_unique     = (known after apply)
     + tags                 = [
         + "appserver-instance-template",
         + "web-app-vpc-firewall-http",
         + "web-app-vpc-firewall-https",
         + "web-app-vpc-firewall-icmp",
         + "web-app-vpc-firewall-ssh",
       ]
     + tags_fingerprint     = (known after apply)
     + terraform_labels     = {
         + "environment" = "dev"
       }

     + disk {
         + auto_delete      = true
         + boot             = true
         + device_name      = (known after apply)
         + disk_size_gb     = (known after apply)
         + disk_type        = (known after apply)
         + interface        = (known after apply)
         + mode             = (known after apply)
         + provisioned_iops = (known after apply)
         + source_image     = "debian-cloud/debian-11"
         + type             = (known after apply)
       }

     + network_interface {
         + internal_ipv6_prefix_length = (known after apply)
         + ipv6_access_type            = (known after apply)
         + ipv6_address                = (known after apply)
         + name                        = (known after apply)
         + network                     = "web-app-vpc"
         + stack_type                  = (known after apply)
         + subnetwork                  = (known after apply)
         + subnetwork_project          = (known after apply)
       }

     + scheduling {
         + automatic_restart   = true
         + on_host_maintenance = "MIGRATE"
         + preemptible         = false
         + provisioning_model  = (known after apply)
       }
   }

 # module.managed_instance_group_region1.google_compute_region_autoscaler.appserver_autoscaler will be created
 + resource "google_compute_region_autoscaler" "appserver_autoscaler" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "appserver-autoscaler-us-central1"
     + project            = "stone-botany-426817-p5"
     + region             = "us-central1"
     + self_link          = (known after apply)
     + target             = (known after apply)

     + autoscaling_policy {
         + cooldown_period = 60
         + max_replicas    = 4
         + min_replicas    = 2
         + mode            = "ON"

         + cpu_utilization {
             + predictive_method = "NONE"
             + target            = 0.6
           }
       }
   }

 # module.managed_instance_group_region1.google_compute_region_instance_group_manager.instance_group_manager will be created
 + resource "google_compute_region_instance_group_manager" "instance_group_manager" {
     + base_instance_name               = "app-us-central1"
     + creation_timestamp               = (known after apply)
     + distribution_policy_target_shape = (known after apply)
     + distribution_policy_zones        = [
         + "us-central1-a",
         + "us-central1-b",
       ]
     + fingerprint                      = (known after apply)
     + id                               = (known after apply)
     + instance_group                   = (known after apply)
     + list_managed_instances_results   = "PAGELESS"
     + name                             = "instance-group-manager-us-central1"
     + project                          = "stone-botany-426817-p5"
     + region                           = "us-central1"
     + self_link                        = (known after apply)
     + status                           = (known after apply)
     + target_size                      = 2
     + wait_for_instances               = false
     + wait_for_instances_status        = "STABLE"

     + auto_healing_policies {
         + health_check      = (known after apply)
         + initial_delay_sec = 100
       }

     + named_port {
         + name = "http"
         + port = 80
       }

     + update_policy {
         + max_surge_fixed       = 2
         + max_unavailable_fixed = 2
         + minimal_action        = "REPLACE"
         + type                  = "PROACTIVE"
       }

     + version {
         + instance_template = (known after apply)
       }
   }

 # module.managed_instance_group_region2.google_compute_health_check.autohealing will be created
 + resource "google_compute_health_check" "autohealing" {
     + check_interval_sec  = 5
     + creation_timestamp  = (known after apply)
     + healthy_threshold   = 2
     + id                  = (known after apply)
     + name                = "autohealing-health-check-europe-north1"
     + project             = "stone-botany-426817-p5"
     + self_link           = (known after apply)
     + timeout_sec         = 5
     + type                = (known after apply)
     + unhealthy_threshold = 10

     + http_health_check {
         + port         = 80
         + proxy_header = "NONE"
         + request_path = "/"
       }

     + log_config {
         + enable = true
       }
   }

 # module.managed_instance_group_region2.google_compute_instance_template.appserver will be created
 + resource "google_compute_instance_template" "appserver" {
     + can_ip_forward       = false
     + description          = "This template is used to create app server instances in europe-north1."
     + effective_labels     = {
         + "environment" = "dev"
       }
     + id                   = (known after apply)
     + instance_description = "description assigned to instances"
     + labels               = {
         + "environment" = "dev"
       }
     + machine_type         = "e2-medium"
     + metadata             = {
         + "startup-script" = <<-EOT
               #!/bin/bash
               exec > /var/log/startup-script.log 2>&1
               set -x
               
               # Function to extract zone information
               get_zone() {
                   local zone_full=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/zone -H "Metadata-Flavor: Google")
                   local zone=$(basename "$zone_full")
                   echo "$zone"
               }
               
               
               # Update package repositories and install Apache
               sudo apt update
               sudo apt -y install apache2
               
               # Define HTML content for the Apache home page
               sudo bash -c "cat <<EOF > /var/www/html/index.html
               <html lang=\"en\">
               <head>
                   <meta charset=\"UTF-8\">
                   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
                   <title>Tech with Thulitha</title>
                   <style>
                       body { 
                           font-family: Arial, sans-serif; 
                           background-color: #004d4d; 
                           color: #ffffff; 
                           margin: 0; 
                           padding: 0; 
                       }
                       .container { 
                           max-width: 800px; 
                           margin: 50px auto; 
                           background-color: #006666; 
                           padding: 20px; 
                           border-radius: 5px; 
                           box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 
                       }
                       h1 { color: #ffffff; text-align: center; }
                       p { color: #d9d9d9; text-align: left; }
                       b { color: #f7f7f7e4; }
                       .value-placeholder { color: #ffffff; }
                       h2 { color: #ffffff; text-align: center; margin-top: 40px; font-family:'Times New Roman', Times, serif;}
                       .social-icon { 
                           font-size: 1.5em; 
                           color: #ffffff; 
                           margin: 0 5px; 
                       }
                       .social-icon:hover { 
                           color: #d9d9d9; 
                       }
                       .social-container { text-align: center; }
                   </style>
                   <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
               </head>
               <body>
                   <div class=\"container\">
                       <h1>Welcome to the Home Page</h1>
                       <p><b>This is the default home page for the Apache web server running on:</b> <span class=\"value-placeholder\">\$(hostname)</span>.</p>
                       <p><b>Server IP Address:</b> <span class=\"value-placeholder\">\$(hostname -i)</span></p>
                       <p><b>Server Domain:</b> <span class=\"value-placeholder\">\$(hostname -d)</span></p>
                       <p><b>Zone:</b> <span class=\"value-placeholder\">$(get_zone)</span></p>
                       <h2>Tech with Thulitha</h2>
                       <div class=\"social-container\">
                           <a href=\"https://github.com/ThulithaNawagamuwa\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-github social-icon\"></i></a>
                           <a href=\"https://medium.com/@thulitha_n\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-medium social-icon\"></i></a>
                           <a href=\"https://www.linkedin.com/in/thulitha-nawagamuwa/\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-linkedin-in social-icon\"></i></a>
                       </div>
                   </div>
               </body>
               </html>
               EOF"
               
               
               sudo mkdir /var/www/html/home/
               
               # copy the home page to /home directory
               sudo cp /var/www/html/index.html /var/www/html/home/index.html
               
               
               # Update 000-default.conf file
               sudo sed -i '/# The ServerName directive/a\
                   Alias "/home_page" "/var/www/html/home"\
               ' /etc/apache2/sites-available/000-default.conf
               
               # Start Apache and enable it to start on boot
               sudo systemctl start apache2
               sudo systemctl enable apache2
           EOT
       }
     + metadata_fingerprint = (known after apply)
     + name                 = (known after apply)
     + name_prefix          = "appserver-template-europe-north1-"
     + project              = "stone-botany-426817-p5"
     + region               = (known after apply)
     + self_link            = (known after apply)
     + self_link_unique     = (known after apply)
     + tags                 = [
         + "appserver-instance-template",
         + "web-app-vpc-firewall-http",
         + "web-app-vpc-firewall-https",
         + "web-app-vpc-firewall-icmp",
         + "web-app-vpc-firewall-ssh",
       ]
     + tags_fingerprint     = (known after apply)
     + terraform_labels     = {
         + "environment" = "dev"
       }

     + disk {
         + auto_delete      = true
         + boot             = true
         + device_name      = (known after apply)
         + disk_size_gb     = (known after apply)
         + disk_type        = (known after apply)
         + interface        = (known after apply)
         + mode             = (known after apply)
         + provisioned_iops = (known after apply)
         + source_image     = "debian-cloud/debian-11"
         + type             = (known after apply)
       }

     + network_interface {
         + internal_ipv6_prefix_length = (known after apply)
         + ipv6_access_type            = (known after apply)
         + ipv6_address                = (known after apply)
         + name                        = (known after apply)
         + network                     = "web-app-vpc"
         + stack_type                  = (known after apply)
         + subnetwork                  = (known after apply)
         + subnetwork_project          = (known after apply)
       }

     + scheduling {
         + automatic_restart   = true
         + on_host_maintenance = "MIGRATE"
         + preemptible         = false
         + provisioning_model  = (known after apply)
       }
   }

 # module.managed_instance_group_region2.google_compute_region_autoscaler.appserver_autoscaler will be created
 + resource "google_compute_region_autoscaler" "appserver_autoscaler" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "appserver-autoscaler-europe-north1"
     + project            = "stone-botany-426817-p5"
     + region             = "europe-north1"
     + self_link          = (known after apply)
     + target             = (known after apply)

     + autoscaling_policy {
         + cooldown_period = 60
         + max_replicas    = 4
         + min_replicas    = 2
         + mode            = "ON"

         + cpu_utilization {
             + predictive_method = "NONE"
             + target            = 0.6
           }
       }
   }

 # module.managed_instance_group_region2.google_compute_region_instance_group_manager.instance_group_manager will be created
 + resource "google_compute_region_instance_group_manager" "instance_group_manager" {
     + base_instance_name               = "app-europe-north1"
     + creation_timestamp               = (known after apply)
     + distribution_policy_target_shape = (known after apply)
     + distribution_policy_zones        = [
         + "europe-north1-a",
         + "europe-north1-b",
       ]
     + fingerprint                      = (known after apply)
     + id                               = (known after apply)
     + instance_group                   = (known after apply)
     + list_managed_instances_results   = "PAGELESS"
     + name                             = "instance-group-manager-europe-north1"
     + project                          = "stone-botany-426817-p5"
     + region                           = "europe-north1"
     + self_link                        = (known after apply)
     + status                           = (known after apply)
     + target_size                      = 2
     + wait_for_instances               = false
     + wait_for_instances_status        = "STABLE"

     + auto_healing_policies {
         + health_check      = (known after apply)
         + initial_delay_sec = 100
       }

     + named_port {
         + name = "http"
         + port = 80
       }

     + update_policy {
         + max_surge_fixed       = 2
         + max_unavailable_fixed = 2
         + minimal_action        = "REPLACE"
         + type                  = "PROACTIVE"
       }

     + version {
         + instance_template = (known after apply)
       }
   }

 # module.network.google_compute_firewall.http will be created
 + resource "google_compute_firewall" "http" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-http"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-http",
       ]

     + allow {
         + ports    = [
             + "80",
           ]
         + protocol = "tcp"
       }
   }

 # module.network.google_compute_firewall.https will be created
 + resource "google_compute_firewall" "https" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-https"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-https",
       ]

     + allow {
         + ports    = [
             + "443",
           ]
         + protocol = "tcp"
       }
   }

 # module.network.google_compute_firewall.icmp will be created
 + resource "google_compute_firewall" "icmp" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-icmp"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-icmp",
       ]

     + allow {
         + ports    = []
         + protocol = "icmp"
       }
   }

 # module.network.google_compute_firewall.ssh will be created
 + resource "google_compute_firewall" "ssh" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-ssh"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-ssh",
       ]

     + allow {
         + ports    = [
             + "22",
           ]
         + protocol = "tcp"
       }
   }

 # module.network.google_compute_network.vpc_network will be created
 + resource "google_compute_network" "vpc_network" {
     + auto_create_subnetworks                   = false
     + delete_default_routes_on_create           = false
     + gateway_ipv4                              = (known after apply)
     + id                                        = (known after apply)
     + internal_ipv6_range                       = (known after apply)
     + mtu                                       = (known after apply)
     + name                                      = "web-app-vpc"
     + network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL"
     + numeric_id                                = (known after apply)
     + project                                   = "stone-botany-426817-p5"
     + routing_mode                              = (known after apply)
     + self_link                                 = (known after apply)
   }

 # module.network.google_compute_router.nat-router-region1 will be created
 + resource "google_compute_router" "nat-router-region1" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "nat-router-us-central1"
     + network            = "web-app-vpc"
     + project            = "stone-botany-426817-p5"
     + region             = "us-central1"
     + self_link          = (known after apply)
   }

 # module.network.google_compute_router.nat-router-region2 will be created
 + resource "google_compute_router" "nat-router-region2" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "nat-router-europe-north1"
     + network            = "web-app-vpc"
     + project            = "stone-botany-426817-p5"
     + region             = "europe-north1"
     + self_link          = (known after apply)
   }

 # module.network.google_compute_router_nat.nat-config-region1 will be created
 + resource "google_compute_router_nat" "nat-config-region1" {
     + auto_network_tier                   = (known after apply)
     + enable_dynamic_port_allocation      = (known after apply)
     + enable_endpoint_independent_mapping = (known after apply)
     + endpoint_types                      = (known after apply)
     + icmp_idle_timeout_sec               = 30
     + id                                  = (known after apply)
     + min_ports_per_vm                    = (known after apply)
     + name                                = "nat-config-us-central1"
     + nat_ip_allocate_option              = "AUTO_ONLY"
     + project                             = "stone-botany-426817-p5"
     + region                              = "us-central1"
     + router                              = "nat-router-us-central1"
     + source_subnetwork_ip_ranges_to_nat  = "ALL_SUBNETWORKS_ALL_IP_RANGES"
     + tcp_established_idle_timeout_sec    = 1200
     + tcp_time_wait_timeout_sec           = 120
     + tcp_transitory_idle_timeout_sec     = 30
     + udp_idle_timeout_sec                = 30
   }

 # module.network.google_compute_router_nat.nat-config-region2 will be created
 + resource "google_compute_router_nat" "nat-config-region2" {
     + auto_network_tier                   = (known after apply)
     + enable_dynamic_port_allocation      = (known after apply)
     + enable_endpoint_independent_mapping = (known after apply)
     + endpoint_types                      = (known after apply)
     + icmp_idle_timeout_sec               = 30
     + id                                  = (known after apply)
     + min_ports_per_vm                    = (known after apply)
     + name                                = "nat-config-europe-north1"
     + nat_ip_allocate_option              = "AUTO_ONLY"
     + project                             = "stone-botany-426817-p5"
     + region                              = "europe-north1"
     + router                              = "nat-router-europe-north1"
     + source_subnetwork_ip_ranges_to_nat  = "ALL_SUBNETWORKS_ALL_IP_RANGES"
     + tcp_established_idle_timeout_sec    = 1200
     + tcp_time_wait_timeout_sec           = 120
     + tcp_transitory_idle_timeout_sec     = 30
     + udp_idle_timeout_sec                = 30
   }

 # module.network.google_compute_subnetwork.vpc_web_subnet1 will be created
 + resource "google_compute_subnetwork" "vpc_web_subnet1" {
     + creation_timestamp         = (known after apply)
     + external_ipv6_prefix       = (known after apply)
     + fingerprint                = (known after apply)
     + gateway_address            = (known after apply)
     + id                         = (known after apply)
     + internal_ipv6_prefix       = (known after apply)
     + ip_cidr_range              = "10.0.1.0/24"
     + ipv6_cidr_range            = (known after apply)
     + name                       = "web-subnet-1"
     + network                    = "web-app-vpc"
     + private_ip_google_access   = (known after apply)
     + private_ipv6_google_access = (known after apply)
     + project                    = "stone-botany-426817-p5"
     + purpose                    = (known after apply)
     + region                     = "us-central1"
     + secondary_ip_range         = (known after apply)
     + self_link                  = (known after apply)
     + stack_type                 = (known after apply)
   }

 # module.network.google_compute_subnetwork.vpc_web_subnet2 will be created
 + resource "google_compute_subnetwork" "vpc_web_subnet2" {
     + creation_timestamp         = (known after apply)
     + external_ipv6_prefix       = (known after apply)
     + fingerprint                = (known after apply)
     + gateway_address            = (known after apply)
     + id                         = (known after apply)
     + internal_ipv6_prefix       = (known after apply)
     + ip_cidr_range              = "10.0.2.0/24"
     + ipv6_cidr_range            = (known after apply)
     + name                       = "web-subnet-2"
     + network                    = "web-app-vpc"
     + private_ip_google_access   = (known after apply)
     + private_ipv6_google_access = (known after apply)
     + project                    = "stone-botany-426817-p5"
     + purpose                    = (known after apply)
     + region                     = "europe-north1"
     + secondary_ip_range         = (known after apply)
     + self_link                  = (known after apply)
     + stack_type                 = (known after apply)
   }

 # module.static_page.google_compute_backend_bucket.static-webpage-backend will be created
 + resource "google_compute_backend_bucket" "static-webpage-backend" {
     + bucket_name        = "static-webpage-bucket1"
     + creation_timestamp = (known after apply)
     + description        = "Contains files needed by the website"
     + enable_cdn         = true
     + id                 = (known after apply)
     + name               = "static-website-backend-bucket"
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
   }

 # module.static_page.google_storage_bucket.static_webpage will be created
 + resource "google_storage_bucket" "static_webpage" {
     + effective_labels            = (known after apply)
     + force_destroy               = false
     + id                          = (known after apply)
     + location                    = "US"
     + name                        = "static-webpage-bucket1"
     + project                     = (known after apply)
     + project_number              = (known after apply)
     + public_access_prevention    = (known after apply)
     + rpo                         = (known after apply)
     + self_link                   = (known after apply)
     + storage_class               = "STANDARD"
     + terraform_labels            = (known after apply)
     + uniform_bucket_level_access = (known after apply)
     + url                         = (known after apply)
   }

 # module.static_page.google_storage_bucket_object.static_site_src will be created
 + resource "google_storage_bucket_object" "static_site_src" {
     + bucket         = "static-webpage-bucket1"
     + content        = (sensitive value)
     + content_type   = (known after apply)
     + crc32c         = (known after apply)
     + detect_md5hash = "different hash"
     + id             = (known after apply)
     + kms_key_name   = (known after apply)
     + md5hash        = (known after apply)
     + media_link     = (known after apply)
     + name           = "index.html"
     + output_name    = (known after apply)
     + self_link      = (known after apply)
     + source         = "modules/static-page/templates/index.html"
     + storage_class  = (known after apply)
   }

 # module.static_page.google_storage_object_access_control.public_rule will be created
 + resource "google_storage_object_access_control" "public_rule" {
     + bucket       = (known after apply)
     + domain       = (known after apply)
     + email        = (known after apply)
     + entity       = "allUsers"
     + entity_id    = (known after apply)
     + generation   = (known after apply)
     + id           = (known after apply)
     + object       = (known after apply)
     + project_team = (known after apply)
     + role         = "READER"
   }

Plan: 36 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan-npd.out

To perform exactly these actions, run the following command to apply:
   terraform apply "plan-npd.out"

Pusher: @anoopfirefox, Action: pull_request, Workflow: GCP Manage Layer workflow

Copy link

Environment npd

Workflow GCP-GHA

QSAloyment Engine Plan 📖success

QSAloyment Engine Plan:

Show Plan


Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
 + create

Terraform will perform the following actions:

 # module.database.google_compute_global_address.private_ip_address will be created
 + resource "google_compute_global_address" "private_ip_address" {
     + address            = (known after apply)
     + address_type       = "INTERNAL"
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "private-ip-address"
     + network            = "web-app-vpc"
     + prefix_length      = 16
     + project            = "stone-botany-426817-p5"
     + purpose            = "VPC_PEERING"
     + self_link          = (known after apply)
   }

 # module.database.google_service_networking_connection.private_vpc_connection will be created
 + resource "google_service_networking_connection" "private_vpc_connection" {
     + id                      = (known after apply)
     + network                 = "web-app-vpc"
     + peering                 = (known after apply)
     + reserved_peering_ranges = [
         + "private-ip-address",
       ]
     + service                 = "servicenetworking.googleapis.com"
   }

 # module.database.google_sql_database.example_db will be created
 + resource "google_sql_database" "example_db" {
     + charset         = (known after apply)
     + collation       = (known after apply)
     + deletion_policy = "DELETE"
     + id              = (known after apply)
     + instance        = "webapp-db-master"
     + name            = "exampledb"
     + project         = "stone-botany-426817-p5"
     + self_link       = (known after apply)
   }

 # module.database.google_sql_database_instance.master will be created
 + resource "google_sql_database_instance" "master" {
     + available_maintenance_versions = (known after apply)
     + connection_name                = (known after apply)
     + database_version               = "POSTGRES_15"
     + deletion_protection            = false
     + dns_name                       = (known after apply)
     + encryption_key_name            = (known after apply)
     + first_ip_address               = (known after apply)
     + id                             = (known after apply)
     + instance_type                  = (known after apply)
     + ip_address                     = (known after apply)
     + maintenance_version            = (known after apply)
     + master_instance_name           = (known after apply)
     + name                           = "webapp-db-master"
     + private_ip_address             = (known after apply)
     + project                        = "stone-botany-426817-p5"
     + psc_service_attachment_link    = (known after apply)
     + public_ip_address              = (known after apply)
     + region                         = "us-central1"
     + self_link                      = (known after apply)
     + server_ca_cert                 = (sensitive value)
     + service_account_email_address  = (known after apply)

     + settings {
         + activation_policy     = "ALWAYS"
         + availability_type     = "REGIONAL"
         + connector_enforcement = (known after apply)
         + disk_autoresize       = true
         + disk_autoresize_limit = 0
         + disk_size             = 10
         + disk_type             = "PD_SSD"
         + edition               = "ENTERPRISE"
         + pricing_plan          = "PER_USE"
         + tier                  = "db-f1-micro"
         + user_labels           = (known after apply)
         + version               = (known after apply)

         + backup_configuration {
             + enabled                        = true
             + start_time                     = (known after apply)
             + transaction_log_retention_days = (known after apply)
           }

         + ip_configuration {
             + ipv4_enabled    = false
             + private_network = "projects/stone-botany-426817-p5/global/networks/web-app-vpc"
             + ssl_mode        = (known after apply)
           }
       }
   }

 # module.database.google_sql_database_instance.read_replica will be created
 + resource "google_sql_database_instance" "read_replica" {
     + available_maintenance_versions = (known after apply)
     + connection_name                = (known after apply)
     + database_version               = "POSTGRES_15"
     + deletion_protection            = false
     + dns_name                       = (known after apply)
     + encryption_key_name            = (known after apply)
     + first_ip_address               = (known after apply)
     + id                             = (known after apply)
     + instance_type                  = (known after apply)
     + ip_address                     = (known after apply)
     + maintenance_version            = (known after apply)
     + master_instance_name           = "webapp-db-master"
     + name                           = "webapp-db-read-replica"
     + private_ip_address             = (known after apply)
     + project                        = "stone-botany-426817-p5"
     + psc_service_attachment_link    = (known after apply)
     + public_ip_address              = (known after apply)
     + region                         = "europe-north1"
     + self_link                      = (known after apply)
     + server_ca_cert                 = (sensitive value)
     + service_account_email_address  = (known after apply)

     + replica_configuration {
         + failover_target = false
       }

     + settings {
         + activation_policy     = "ALWAYS"
         + availability_type     = "REGIONAL"
         + connector_enforcement = (known after apply)
         + disk_autoresize       = true
         + disk_autoresize_limit = 0
         + disk_size             = 10
         + disk_type             = "PD_SSD"
         + edition               = "ENTERPRISE"
         + pricing_plan          = "PER_USE"
         + tier                  = "db-f1-micro"
         + user_labels           = (known after apply)
         + version               = (known after apply)

         + backup_configuration {
             + enabled                        = false
             + start_time                     = (known after apply)
             + transaction_log_retention_days = (known after apply)
           }

         + ip_configuration {
             + ipv4_enabled    = false
             + private_network = "projects/stone-botany-426817-p5/global/networks/web-app-vpc"
             + ssl_mode        = (known after apply)
           }
       }
   }

 # module.database.google_sql_user.root will be created
 + resource "google_sql_user" "root" {
     + host                    = (known after apply)
     + id                      = (known after apply)
     + instance                = "webapp-db-master"
     + name                    = "root"
     + password                = (sensitive value)
     + project                 = "stone-botany-426817-p5"
     + sql_server_user_details = (known after apply)
   }

 # module.load_balancer.google_compute_backend_service.default will be created
 + resource "google_compute_backend_service" "default" {
     + connection_draining_timeout_sec = 300
     + creation_timestamp              = (known after apply)
     + enable_cdn                      = true
     + fingerprint                     = (known after apply)
     + generated_id                    = (known after apply)
     + health_checks                   = (known after apply)
     + id                              = (known after apply)
     + load_balancing_scheme           = "EXTERNAL"
     + name                            = "mig-backend-service"
     + port_name                       = (known after apply)
     + project                         = "stone-botany-426817-p5"
     + protocol                        = "HTTP"
     + self_link                       = (known after apply)
     + session_affinity                = "NONE"
     + timeout_sec                     = 10

     + backend {
         + balancing_mode               = "UTILIZATION"
         + capacity_scaler              = 1
         + group                        = (known after apply)
         + max_connections              = (known after apply)
         + max_connections_per_endpoint = (known after apply)
         + max_connections_per_instance = (known after apply)
         + max_rate                     = (known after apply)
         + max_rate_per_endpoint        = (known after apply)
         + max_rate_per_instance        = (known after apply)
         + max_utilization              = 0.8
           # (1 unchanged attribute hidden)
       }
     + backend {
         + balancing_mode               = "UTILIZATION"
         + capacity_scaler              = 1
         + group                        = (known after apply)
         + max_connections              = (known after apply)
         + max_connections_per_endpoint = (known after apply)
         + max_connections_per_instance = (known after apply)
         + max_rate                     = (known after apply)
         + max_rate_per_endpoint        = (known after apply)
         + max_rate_per_instance        = (known after apply)
         + max_utilization              = 0.8
           # (1 unchanged attribute hidden)
       }
   }

 # module.load_balancer.google_compute_global_address.website will be created
 + resource "google_compute_global_address" "website" {
     + address            = (known after apply)
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "website-lb-ip"
     + prefix_length      = (known after apply)
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
   }

 # module.load_balancer.google_compute_global_forwarding_rule.default will be created
 + resource "google_compute_global_forwarding_rule" "default" {
     + base_forwarding_rule  = (known after apply)
     + effective_labels      = (known after apply)
     + id                    = (known after apply)
     + ip_address            = (known after apply)
     + ip_protocol           = "TCP"
     + label_fingerprint     = (known after apply)
     + load_balancing_scheme = "EXTERNAL"
     + name                  = "website-forwarding-rule"
     + network               = (known after apply)
     + port_range            = "80"
     + project               = "stone-botany-426817-p5"
     + psc_connection_id     = (known after apply)
     + psc_connection_status = (known after apply)
     + self_link             = (known after apply)
     + subnetwork            = (known after apply)
     + target                = (known after apply)
     + terraform_labels      = (known after apply)
   }

 # module.load_balancer.google_compute_health_check.default will be created
 + resource "google_compute_health_check" "default" {
     + check_interval_sec  = 5
     + creation_timestamp  = (known after apply)
     + healthy_threshold   = 4
     + id                  = (known after apply)
     + name                = "tcp-proxy-health-check"
     + project             = "stone-botany-426817-p5"
     + self_link           = (known after apply)
     + timeout_sec         = 5
     + type                = (known after apply)
     + unhealthy_threshold = 5

     + log_config {
         + enable = true
       }

     + tcp_health_check {
         + port         = 80
         + proxy_header = "NONE"
       }
   }

 # module.load_balancer.google_compute_target_http_proxy.website will be created
 + resource "google_compute_target_http_proxy" "website" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "website-target-proxy"
     + project            = "stone-botany-426817-p5"
     + proxy_bind         = (known after apply)
     + proxy_id           = (known after apply)
     + self_link          = (known after apply)
     + url_map            = (known after apply)
   }

 # module.load_balancer.google_compute_url_map.website will be created
 + resource "google_compute_url_map" "website" {
     + creation_timestamp = (known after apply)
     + default_service    = (known after apply)
     + fingerprint        = (known after apply)
     + id                 = (known after apply)
     + map_id             = (known after apply)
     + name               = "website-url-map"
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)

     + host_rule {
         + hosts        = [
             + "*",
           ]
         + path_matcher = "allpaths"
           # (1 unchanged attribute hidden)
       }

     + path_matcher {
         + default_service = (known after apply)
         + name            = "allpaths"

         + path_rule {
             + paths   = [
                 + "/static",
                 + "/static/*",
               ]
             + service = (known after apply)
           }
         + path_rule {
             + paths   = [
                 + "/home",
                 + "/home/*",
               ]
             + service = (known after apply)
           }
         + path_rule {
             + paths   = [
                 + "/home_page",
               ]
             + service = (known after apply)
           }
       }
   }

 # module.load_balancer.google_dns_record_set.website will be created
 + resource "google_dns_record_set" "website" {
     + id           = (known after apply)
     + managed_zone = "gcp-terraform-dns-zone"
     + name         = "www.platformengine-devops.shop."
     + project      = "stone-botany-426817-p5"
     + rrdatas      = (known after apply)
     + ttl          = 300
     + type         = "A"
   }

 # module.managed_instance_group_region1.google_compute_health_check.autohealing will be created
 + resource "google_compute_health_check" "autohealing" {
     + check_interval_sec  = 5
     + creation_timestamp  = (known after apply)
     + healthy_threshold   = 2
     + id                  = (known after apply)
     + name                = "autohealing-health-check-us-central1"
     + project             = "stone-botany-426817-p5"
     + self_link           = (known after apply)
     + timeout_sec         = 5
     + type                = (known after apply)
     + unhealthy_threshold = 10

     + http_health_check {
         + port         = 80
         + proxy_header = "NONE"
         + request_path = "/"
       }

     + log_config {
         + enable = true
       }
   }

 # module.managed_instance_group_region1.google_compute_instance_template.appserver will be created
 + resource "google_compute_instance_template" "appserver" {
     + can_ip_forward       = false
     + description          = "This template is used to create app server instances in us-central1."
     + effective_labels     = {
         + "environment" = "dev"
       }
     + id                   = (known after apply)
     + instance_description = "description assigned to instances"
     + labels               = {
         + "environment" = "dev"
       }
     + machine_type         = "e2-medium"
     + metadata             = {
         + "startup-script" = <<-EOT
               #!/bin/bash
               exec > /var/log/startup-script.log 2>&1
               set -x
               
               # Function to extract zone information
               get_zone() {
                   local zone_full=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/zone -H "Metadata-Flavor: Google")
                   local zone=$(basename "$zone_full")
                   echo "$zone"
               }
               
               
               # Update package repositories and install Apache
               sudo apt update
               sudo apt -y install apache2
               
               # Define HTML content for the Apache home page
               sudo bash -c "cat <<EOF > /var/www/html/index.html
               <html lang=\"en\">
               <head>
                   <meta charset=\"UTF-8\">
                   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
                   <title>Tech with Thulitha</title>
                   <style>
                       body { 
                           font-family: Arial, sans-serif; 
                           background-color: #004d4d; 
                           color: #ffffff; 
                           margin: 0; 
                           padding: 0; 
                       }
                       .container { 
                           max-width: 800px; 
                           margin: 50px auto; 
                           background-color: #006666; 
                           padding: 20px; 
                           border-radius: 5px; 
                           box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 
                       }
                       h1 { color: #ffffff; text-align: center; }
                       p { color: #d9d9d9; text-align: left; }
                       b { color: #f7f7f7e4; }
                       .value-placeholder { color: #ffffff; }
                       h2 { color: #ffffff; text-align: center; margin-top: 40px; font-family:'Times New Roman', Times, serif;}
                       .social-icon { 
                           font-size: 1.5em; 
                           color: #ffffff; 
                           margin: 0 5px; 
                       }
                       .social-icon:hover { 
                           color: #d9d9d9; 
                       }
                       .social-container { text-align: center; }
                   </style>
                   <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
               </head>
               <body>
                   <div class=\"container\">
                       <h1>Welcome to the Home Page</h1>
                       <p><b>This is the default home page for the Apache web server running on:</b> <span class=\"value-placeholder\">\$(hostname)</span>.</p>
                       <p><b>Server IP Address:</b> <span class=\"value-placeholder\">\$(hostname -i)</span></p>
                       <p><b>Server Domain:</b> <span class=\"value-placeholder\">\$(hostname -d)</span></p>
                       <p><b>Zone:</b> <span class=\"value-placeholder\">$(get_zone)</span></p>
                       <h2>Tech with Thulitha</h2>
                       <div class=\"social-container\">
                           <a href=\"https://github.com/ThulithaNawagamuwa\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-github social-icon\"></i></a>
                           <a href=\"https://medium.com/@thulitha_n\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-medium social-icon\"></i></a>
                           <a href=\"https://www.linkedin.com/in/thulitha-nawagamuwa/\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-linkedin-in social-icon\"></i></a>
                       </div>
                   </div>
               </body>
               </html>
               EOF"
               
               
               sudo mkdir /var/www/html/home/
               
               # copy the home page to /home directory
               sudo cp /var/www/html/index.html /var/www/html/home/index.html
               
               
               # Update 000-default.conf file
               sudo sed -i '/# The ServerName directive/a\
                   Alias "/home_page" "/var/www/html/home"\
               ' /etc/apache2/sites-available/000-default.conf
               
               # Start Apache and enable it to start on boot
               sudo systemctl start apache2
               sudo systemctl enable apache2
           EOT
       }
     + metadata_fingerprint = (known after apply)
     + name                 = (known after apply)
     + name_prefix          = "appserver-template-us-central1-"
     + project              = "stone-botany-426817-p5"
     + region               = (known after apply)
     + self_link            = (known after apply)
     + self_link_unique     = (known after apply)
     + tags                 = [
         + "appserver-instance-template",
         + "web-app-vpc-firewall-http",
         + "web-app-vpc-firewall-https",
         + "web-app-vpc-firewall-icmp",
         + "web-app-vpc-firewall-ssh",
       ]
     + tags_fingerprint     = (known after apply)
     + terraform_labels     = {
         + "environment" = "dev"
       }

     + disk {
         + auto_delete      = true
         + boot             = true
         + device_name      = (known after apply)
         + disk_size_gb     = (known after apply)
         + disk_type        = (known after apply)
         + interface        = (known after apply)
         + mode             = (known after apply)
         + provisioned_iops = (known after apply)
         + source_image     = "debian-cloud/debian-11"
         + type             = (known after apply)
       }

     + network_interface {
         + internal_ipv6_prefix_length = (known after apply)
         + ipv6_access_type            = (known after apply)
         + ipv6_address                = (known after apply)
         + name                        = (known after apply)
         + network                     = "web-app-vpc"
         + stack_type                  = (known after apply)
         + subnetwork                  = (known after apply)
         + subnetwork_project          = (known after apply)
       }

     + scheduling {
         + automatic_restart   = true
         + on_host_maintenance = "MIGRATE"
         + preemptible         = false
         + provisioning_model  = (known after apply)
       }
   }

 # module.managed_instance_group_region1.google_compute_region_autoscaler.appserver_autoscaler will be created
 + resource "google_compute_region_autoscaler" "appserver_autoscaler" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "appserver-autoscaler-us-central1"
     + project            = "stone-botany-426817-p5"
     + region             = "us-central1"
     + self_link          = (known after apply)
     + target             = (known after apply)

     + autoscaling_policy {
         + cooldown_period = 60
         + max_replicas    = 4
         + min_replicas    = 2
         + mode            = "ON"

         + cpu_utilization {
             + predictive_method = "NONE"
             + target            = 0.6
           }
       }
   }

 # module.managed_instance_group_region1.google_compute_region_instance_group_manager.instance_group_manager will be created
 + resource "google_compute_region_instance_group_manager" "instance_group_manager" {
     + base_instance_name               = "app-us-central1"
     + creation_timestamp               = (known after apply)
     + distribution_policy_target_shape = (known after apply)
     + distribution_policy_zones        = [
         + "us-central1-a",
         + "us-central1-b",
       ]
     + fingerprint                      = (known after apply)
     + id                               = (known after apply)
     + instance_group                   = (known after apply)
     + list_managed_instances_results   = "PAGELESS"
     + name                             = "instance-group-manager-us-central1"
     + project                          = "stone-botany-426817-p5"
     + region                           = "us-central1"
     + self_link                        = (known after apply)
     + status                           = (known after apply)
     + target_size                      = 2
     + wait_for_instances               = false
     + wait_for_instances_status        = "STABLE"

     + auto_healing_policies {
         + health_check      = (known after apply)
         + initial_delay_sec = 100
       }

     + named_port {
         + name = "http"
         + port = 80
       }

     + update_policy {
         + max_surge_fixed       = 2
         + max_unavailable_fixed = 2
         + minimal_action        = "REPLACE"
         + type                  = "PROACTIVE"
       }

     + version {
         + instance_template = (known after apply)
       }
   }

 # module.managed_instance_group_region2.google_compute_health_check.autohealing will be created
 + resource "google_compute_health_check" "autohealing" {
     + check_interval_sec  = 5
     + creation_timestamp  = (known after apply)
     + healthy_threshold   = 2
     + id                  = (known after apply)
     + name                = "autohealing-health-check-europe-north1"
     + project             = "stone-botany-426817-p5"
     + self_link           = (known after apply)
     + timeout_sec         = 5
     + type                = (known after apply)
     + unhealthy_threshold = 10

     + http_health_check {
         + port         = 80
         + proxy_header = "NONE"
         + request_path = "/"
       }

     + log_config {
         + enable = true
       }
   }

 # module.managed_instance_group_region2.google_compute_instance_template.appserver will be created
 + resource "google_compute_instance_template" "appserver" {
     + can_ip_forward       = false
     + description          = "This template is used to create app server instances in europe-north1."
     + effective_labels     = {
         + "environment" = "dev"
       }
     + id                   = (known after apply)
     + instance_description = "description assigned to instances"
     + labels               = {
         + "environment" = "dev"
       }
     + machine_type         = "e2-medium"
     + metadata             = {
         + "startup-script" = <<-EOT
               #!/bin/bash
               exec > /var/log/startup-script.log 2>&1
               set -x
               
               # Function to extract zone information
               get_zone() {
                   local zone_full=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/zone -H "Metadata-Flavor: Google")
                   local zone=$(basename "$zone_full")
                   echo "$zone"
               }
               
               
               # Update package repositories and install Apache
               sudo apt update
               sudo apt -y install apache2
               
               # Define HTML content for the Apache home page
               sudo bash -c "cat <<EOF > /var/www/html/index.html
               <html lang=\"en\">
               <head>
                   <meta charset=\"UTF-8\">
                   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
                   <title>Tech with Thulitha</title>
                   <style>
                       body { 
                           font-family: Arial, sans-serif; 
                           background-color: #004d4d; 
                           color: #ffffff; 
                           margin: 0; 
                           padding: 0; 
                       }
                       .container { 
                           max-width: 800px; 
                           margin: 50px auto; 
                           background-color: #006666; 
                           padding: 20px; 
                           border-radius: 5px; 
                           box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 
                       }
                       h1 { color: #ffffff; text-align: center; }
                       p { color: #d9d9d9; text-align: left; }
                       b { color: #f7f7f7e4; }
                       .value-placeholder { color: #ffffff; }
                       h2 { color: #ffffff; text-align: center; margin-top: 40px; font-family:'Times New Roman', Times, serif;}
                       .social-icon { 
                           font-size: 1.5em; 
                           color: #ffffff; 
                           margin: 0 5px; 
                       }
                       .social-icon:hover { 
                           color: #d9d9d9; 
                       }
                       .social-container { text-align: center; }
                   </style>
                   <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
               </head>
               <body>
                   <div class=\"container\">
                       <h1>Welcome to the Home Page</h1>
                       <p><b>This is the default home page for the Apache web server running on:</b> <span class=\"value-placeholder\">\$(hostname)</span>.</p>
                       <p><b>Server IP Address:</b> <span class=\"value-placeholder\">\$(hostname -i)</span></p>
                       <p><b>Server Domain:</b> <span class=\"value-placeholder\">\$(hostname -d)</span></p>
                       <p><b>Zone:</b> <span class=\"value-placeholder\">$(get_zone)</span></p>
                       <h2>Tech with Thulitha</h2>
                       <div class=\"social-container\">
                           <a href=\"https://github.com/ThulithaNawagamuwa\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-github social-icon\"></i></a>
                           <a href=\"https://medium.com/@thulitha_n\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-medium social-icon\"></i></a>
                           <a href=\"https://www.linkedin.com/in/thulitha-nawagamuwa/\" class=\"mx-2\" target=\"_blank\"><i class=\"fab fa-linkedin-in social-icon\"></i></a>
                       </div>
                   </div>
               </body>
               </html>
               EOF"
               
               
               sudo mkdir /var/www/html/home/
               
               # copy the home page to /home directory
               sudo cp /var/www/html/index.html /var/www/html/home/index.html
               
               
               # Update 000-default.conf file
               sudo sed -i '/# The ServerName directive/a\
                   Alias "/home_page" "/var/www/html/home"\
               ' /etc/apache2/sites-available/000-default.conf
               
               # Start Apache and enable it to start on boot
               sudo systemctl start apache2
               sudo systemctl enable apache2
           EOT
       }
     + metadata_fingerprint = (known after apply)
     + name                 = (known after apply)
     + name_prefix          = "appserver-template-europe-north1-"
     + project              = "stone-botany-426817-p5"
     + region               = (known after apply)
     + self_link            = (known after apply)
     + self_link_unique     = (known after apply)
     + tags                 = [
         + "appserver-instance-template",
         + "web-app-vpc-firewall-http",
         + "web-app-vpc-firewall-https",
         + "web-app-vpc-firewall-icmp",
         + "web-app-vpc-firewall-ssh",
       ]
     + tags_fingerprint     = (known after apply)
     + terraform_labels     = {
         + "environment" = "dev"
       }

     + disk {
         + auto_delete      = true
         + boot             = true
         + device_name      = (known after apply)
         + disk_size_gb     = (known after apply)
         + disk_type        = (known after apply)
         + interface        = (known after apply)
         + mode             = (known after apply)
         + provisioned_iops = (known after apply)
         + source_image     = "debian-cloud/debian-11"
         + type             = (known after apply)
       }

     + network_interface {
         + internal_ipv6_prefix_length = (known after apply)
         + ipv6_access_type            = (known after apply)
         + ipv6_address                = (known after apply)
         + name                        = (known after apply)
         + network                     = "web-app-vpc"
         + stack_type                  = (known after apply)
         + subnetwork                  = (known after apply)
         + subnetwork_project          = (known after apply)
       }

     + scheduling {
         + automatic_restart   = true
         + on_host_maintenance = "MIGRATE"
         + preemptible         = false
         + provisioning_model  = (known after apply)
       }
   }

 # module.managed_instance_group_region2.google_compute_region_autoscaler.appserver_autoscaler will be created
 + resource "google_compute_region_autoscaler" "appserver_autoscaler" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "appserver-autoscaler-europe-north1"
     + project            = "stone-botany-426817-p5"
     + region             = "europe-north1"
     + self_link          = (known after apply)
     + target             = (known after apply)

     + autoscaling_policy {
         + cooldown_period = 60
         + max_replicas    = 4
         + min_replicas    = 2
         + mode            = "ON"

         + cpu_utilization {
             + predictive_method = "NONE"
             + target            = 0.6
           }
       }
   }

 # module.managed_instance_group_region2.google_compute_region_instance_group_manager.instance_group_manager will be created
 + resource "google_compute_region_instance_group_manager" "instance_group_manager" {
     + base_instance_name               = "app-europe-north1"
     + creation_timestamp               = (known after apply)
     + distribution_policy_target_shape = (known after apply)
     + distribution_policy_zones        = [
         + "europe-north1-a",
         + "europe-north1-b",
       ]
     + fingerprint                      = (known after apply)
     + id                               = (known after apply)
     + instance_group                   = (known after apply)
     + list_managed_instances_results   = "PAGELESS"
     + name                             = "instance-group-manager-europe-north1"
     + project                          = "stone-botany-426817-p5"
     + region                           = "europe-north1"
     + self_link                        = (known after apply)
     + status                           = (known after apply)
     + target_size                      = 2
     + wait_for_instances               = false
     + wait_for_instances_status        = "STABLE"

     + auto_healing_policies {
         + health_check      = (known after apply)
         + initial_delay_sec = 100
       }

     + named_port {
         + name = "http"
         + port = 80
       }

     + update_policy {
         + max_surge_fixed       = 2
         + max_unavailable_fixed = 2
         + minimal_action        = "REPLACE"
         + type                  = "PROACTIVE"
       }

     + version {
         + instance_template = (known after apply)
       }
   }

 # module.network.google_compute_firewall.http will be created
 + resource "google_compute_firewall" "http" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-http"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-http",
       ]

     + allow {
         + ports    = [
             + "80",
           ]
         + protocol = "tcp"
       }
   }

 # module.network.google_compute_firewall.https will be created
 + resource "google_compute_firewall" "https" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-https"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-https",
       ]

     + allow {
         + ports    = [
             + "443",
           ]
         + protocol = "tcp"
       }
   }

 # module.network.google_compute_firewall.icmp will be created
 + resource "google_compute_firewall" "icmp" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-icmp"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-icmp",
       ]

     + allow {
         + ports    = []
         + protocol = "icmp"
       }
   }

 # module.network.google_compute_firewall.ssh will be created
 + resource "google_compute_firewall" "ssh" {
     + creation_timestamp = (known after apply)
     + destination_ranges = (known after apply)
     + direction          = (known after apply)
     + enable_logging     = (known after apply)
     + id                 = (known after apply)
     + name               = "web-app-vpc-firewall-ssh"
     + network            = "web-app-vpc"
     + priority           = 1000
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
     + source_ranges      = [
         + "0.0.0.0/0",
       ]
     + target_tags        = [
         + "web-app-vpc-firewall-ssh",
       ]

     + allow {
         + ports    = [
             + "22",
           ]
         + protocol = "tcp"
       }
   }

 # module.network.google_compute_network.vpc_network will be created
 + resource "google_compute_network" "vpc_network" {
     + auto_create_subnetworks                   = false
     + delete_default_routes_on_create           = false
     + gateway_ipv4                              = (known after apply)
     + id                                        = (known after apply)
     + internal_ipv6_range                       = (known after apply)
     + mtu                                       = (known after apply)
     + name                                      = "web-app-vpc"
     + network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL"
     + numeric_id                                = (known after apply)
     + project                                   = "stone-botany-426817-p5"
     + routing_mode                              = (known after apply)
     + self_link                                 = (known after apply)
   }

 # module.network.google_compute_router.nat-router-region1 will be created
 + resource "google_compute_router" "nat-router-region1" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "nat-router-us-central1"
     + network            = "web-app-vpc"
     + project            = "stone-botany-426817-p5"
     + region             = "us-central1"
     + self_link          = (known after apply)
   }

 # module.network.google_compute_router.nat-router-region2 will be created
 + resource "google_compute_router" "nat-router-region2" {
     + creation_timestamp = (known after apply)
     + id                 = (known after apply)
     + name               = "nat-router-europe-north1"
     + network            = "web-app-vpc"
     + project            = "stone-botany-426817-p5"
     + region             = "europe-north1"
     + self_link          = (known after apply)
   }

 # module.network.google_compute_router_nat.nat-config-region1 will be created
 + resource "google_compute_router_nat" "nat-config-region1" {
     + auto_network_tier                   = (known after apply)
     + enable_dynamic_port_allocation      = (known after apply)
     + enable_endpoint_independent_mapping = (known after apply)
     + endpoint_types                      = (known after apply)
     + icmp_idle_timeout_sec               = 30
     + id                                  = (known after apply)
     + min_ports_per_vm                    = (known after apply)
     + name                                = "nat-config-us-central1"
     + nat_ip_allocate_option              = "AUTO_ONLY"
     + project                             = "stone-botany-426817-p5"
     + region                              = "us-central1"
     + router                              = "nat-router-us-central1"
     + source_subnetwork_ip_ranges_to_nat  = "ALL_SUBNETWORKS_ALL_IP_RANGES"
     + tcp_established_idle_timeout_sec    = 1200
     + tcp_time_wait_timeout_sec           = 120
     + tcp_transitory_idle_timeout_sec     = 30
     + udp_idle_timeout_sec                = 30
   }

 # module.network.google_compute_router_nat.nat-config-region2 will be created
 + resource "google_compute_router_nat" "nat-config-region2" {
     + auto_network_tier                   = (known after apply)
     + enable_dynamic_port_allocation      = (known after apply)
     + enable_endpoint_independent_mapping = (known after apply)
     + endpoint_types                      = (known after apply)
     + icmp_idle_timeout_sec               = 30
     + id                                  = (known after apply)
     + min_ports_per_vm                    = (known after apply)
     + name                                = "nat-config-europe-north1"
     + nat_ip_allocate_option              = "AUTO_ONLY"
     + project                             = "stone-botany-426817-p5"
     + region                              = "europe-north1"
     + router                              = "nat-router-europe-north1"
     + source_subnetwork_ip_ranges_to_nat  = "ALL_SUBNETWORKS_ALL_IP_RANGES"
     + tcp_established_idle_timeout_sec    = 1200
     + tcp_time_wait_timeout_sec           = 120
     + tcp_transitory_idle_timeout_sec     = 30
     + udp_idle_timeout_sec                = 30
   }

 # module.network.google_compute_subnetwork.vpc_web_subnet1 will be created
 + resource "google_compute_subnetwork" "vpc_web_subnet1" {
     + creation_timestamp         = (known after apply)
     + external_ipv6_prefix       = (known after apply)
     + fingerprint                = (known after apply)
     + gateway_address            = (known after apply)
     + id                         = (known after apply)
     + internal_ipv6_prefix       = (known after apply)
     + ip_cidr_range              = "10.0.1.0/24"
     + ipv6_cidr_range            = (known after apply)
     + name                       = "web-subnet-1"
     + network                    = "web-app-vpc"
     + private_ip_google_access   = (known after apply)
     + private_ipv6_google_access = (known after apply)
     + project                    = "stone-botany-426817-p5"
     + purpose                    = (known after apply)
     + region                     = "us-central1"
     + secondary_ip_range         = (known after apply)
     + self_link                  = (known after apply)
     + stack_type                 = (known after apply)
   }

 # module.network.google_compute_subnetwork.vpc_web_subnet2 will be created
 + resource "google_compute_subnetwork" "vpc_web_subnet2" {
     + creation_timestamp         = (known after apply)
     + external_ipv6_prefix       = (known after apply)
     + fingerprint                = (known after apply)
     + gateway_address            = (known after apply)
     + id                         = (known after apply)
     + internal_ipv6_prefix       = (known after apply)
     + ip_cidr_range              = "10.0.2.0/24"
     + ipv6_cidr_range            = (known after apply)
     + name                       = "web-subnet-2"
     + network                    = "web-app-vpc"
     + private_ip_google_access   = (known after apply)
     + private_ipv6_google_access = (known after apply)
     + project                    = "stone-botany-426817-p5"
     + purpose                    = (known after apply)
     + region                     = "europe-north1"
     + secondary_ip_range         = (known after apply)
     + self_link                  = (known after apply)
     + stack_type                 = (known after apply)
   }

 # module.static_page.google_compute_backend_bucket.static-webpage-backend will be created
 + resource "google_compute_backend_bucket" "static-webpage-backend" {
     + bucket_name        = "static-webpage-bucket1"
     + creation_timestamp = (known after apply)
     + description        = "Contains files needed by the website"
     + enable_cdn         = true
     + id                 = (known after apply)
     + name               = "static-website-backend-bucket"
     + project            = "stone-botany-426817-p5"
     + self_link          = (known after apply)
   }

 # module.static_page.google_storage_bucket.static_webpage will be created
 + resource "google_storage_bucket" "static_webpage" {
     + effective_labels            = (known after apply)
     + force_destroy               = false
     + id                          = (known after apply)
     + location                    = "US"
     + name                        = "static-webpage-bucket1"
     + project                     = (known after apply)
     + project_number              = (known after apply)
     + public_access_prevention    = (known after apply)
     + rpo                         = (known after apply)
     + self_link                   = (known after apply)
     + storage_class               = "STANDARD"
     + terraform_labels            = (known after apply)
     + uniform_bucket_level_access = (known after apply)
     + url                         = (known after apply)
   }

 # module.static_page.google_storage_bucket_object.static_site_src will be created
 + resource "google_storage_bucket_object" "static_site_src" {
     + bucket         = "static-webpage-bucket1"
     + content        = (sensitive value)
     + content_type   = (known after apply)
     + crc32c         = (known after apply)
     + detect_md5hash = "different hash"
     + id             = (known after apply)
     + kms_key_name   = (known after apply)
     + md5hash        = (known after apply)
     + media_link     = (known after apply)
     + name           = "index.html"
     + output_name    = (known after apply)
     + self_link      = (known after apply)
     + source         = "modules/static-page/templates/index.html"
     + storage_class  = (known after apply)
   }

 # module.static_page.google_storage_object_access_control.public_rule will be created
 + resource "google_storage_object_access_control" "public_rule" {
     + bucket       = (known after apply)
     + domain       = (known after apply)
     + email        = (known after apply)
     + entity       = "allUsers"
     + entity_id    = (known after apply)
     + generation   = (known after apply)
     + id           = (known after apply)
     + object       = (known after apply)
     + project_team = (known after apply)
     + role         = "READER"
   }

Plan: 36 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan-npd.out

To perform exactly these actions, run the following command to apply:
   terraform apply "plan-npd.out"

Pusher: @anoopfirefox, Action: pull_request, Workflow: GCP Manage Layer workflow

Copy link

💰 Infracost report

Monthly cost will increase by $184 📈

Changed project Baseline cost Usage cost* Total change New monthly cost
AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json +$184 +$0 +$184 $184

*Usage costs were estimated using Infracost Cloud settings, see docs for other options.

Cost details (includes details of unsupported resources)
Key: * usage cost, ~ changed, + added, - removed

──────────────────────────────────
Project: AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

+ module.managed_instance_group_region2.google_compute_region_instance_group_manager.instance_group_manager
  +$63

    + Instance usage (Linux/UNIX, on-demand, e2-medium)
      +$54

    + Standard provisioned storage (pd-standard)
      +$9

+ module.managed_instance_group_region1.google_compute_region_instance_group_manager.instance_group_manager
  +$57

    + Instance usage (Linux/UNIX, on-demand, e2-medium)
      +$49

    + Standard provisioned storage (pd-standard)
      +$8

+ module.database.google_sql_database_instance.read_replica
  +$31

    + SQL instance (db-f1-micro, regional)
      +$17

    + Storage (SSD, regional)
      +$4

    + Backups
      Monthly cost depends on usage
        +$0.088 per GB

    + Replica
    
        + SQL instance (db-f1-micro, zonal)
          +$8
    
        + Storage (SSD, zonal)
          +$2

+ module.database.google_sql_database_instance.master
  +$19

    + SQL instance (db-f1-micro, regional)
      +$15

    + Storage (SSD, regional)
      +$3

    + Backups
      Monthly cost depends on usage
        +$0.08 per GB

+ module.load_balancer.google_compute_global_address.website
  +$7

    + IP address (unused)
      +$7

+ module.load_balancer.google_compute_global_forwarding_rule.default
  +$7

    + Forwarding rules
      +$7

    + Ingress data
      Monthly cost depends on usage
        +$0.008 per GB

+ module.database.google_service_networking_connection.private_vpc_connection
  Monthly cost depends on usage

    + Network egress
    
        + Traffic within the same region
          Monthly cost depends on usage
            +$0.02 per GB
    
        + Traffic within the US or Canada
          Monthly cost depends on usage
            +$0.02 per GB
    
        + Traffic within Europe
          Monthly cost depends on usage
            +$0.02 per GB
    
        + Traffic within Asia
          Monthly cost depends on usage
            +$0.08 per GB
    
        + Traffic within South America
          Monthly cost depends on usage
            +$0.14 per GB
    
        + Traffic to/from Indonesia and Oceania
          Monthly cost depends on usage
            +$0.10 per GB
    
        + Traffic between continents (excludes Oceania)
          Monthly cost depends on usage
            +$0.08 per GB

+ module.load_balancer.google_compute_target_http_proxy.website
  Monthly cost depends on usage

    + Proxy instance
      Monthly cost depends on usage
        +$0.025 per hours

    + Data processed
      Monthly cost depends on usage
        +$0.008 per GB

+ module.load_balancer.google_dns_record_set.website
  Monthly cost depends on usage

    + Queries
      Monthly cost depends on usage
        +$0.40 per 1M queries

+ module.network.google_compute_router_nat.nat-config-region1
  $0.00

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.network.google_compute_router_nat.nat-config-region2
  $0.00

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.static_page.google_storage_bucket.static_webpage
  Monthly cost depends on usage

    + Storage (standard)
      Monthly cost depends on usage
        +$0.026 per GiB

    + Object adds, bucket/object list (class A)
      Monthly cost depends on usage
        +$0.05 per 10k operations

    + Object gets, retrieve bucket/object metadata (class B)
      Monthly cost depends on usage
        +$0.004 per 10k operations

    + Network egress
    
        + Data transfer in same continent
          Monthly cost depends on usage
            +$0.02 per GB
    
        + Data transfer to worldwide excluding Asia, Australia (first 1TB)
          Monthly cost depends on usage
            +$0.12 per GB
    
        + Data transfer to Asia excluding China, but including Hong Kong (first 1TB)
          Monthly cost depends on usage
            +$0.12 per GB
    
        + Data transfer to China excluding Hong Kong (first 1TB)
          Monthly cost depends on usage
            +$0.23 per GB
    
        + Data transfer to Australia (first 1TB)
          Monthly cost depends on usage
            +$0.19 per GB

Monthly cost change for AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json
Amount:  +$184 ($0.00 → $184)

──────────────────────────────────
Key: * usage cost, ~ changed, + added, - removed

*Usage costs were estimated using Infracost Cloud settings, see docs for other options.

36 cloud resources were detected:
∙ 12 were estimated
∙ 22 were free
∙ 2 are not supported yet, see https://infracost.io/requested-resources:
  ∙ 2 x google_compute_region_autoscaler

Infracost estimate: Monthly cost will increase by $184 ↑
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Changed project                                        ┃ Baseline cost ┃ Usage cost ┃ Total change ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━┫
┃ AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json ┃         +$184 ┃        +$0 ┃        +$184 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛

Governance checks

🔴 3 failures
FinOps tags: This example Tagging policy shows how you can enforce required FinOps tag keys/values in pull requests. This example checks for the tags 'Service' (can have any value) and 'Environment' (must be Dev/Stage/Prod) on all taggable resources being changed in the pull request. You can adjust it from https://dashboard.infracost.io > Governance > Tagging policies. You have a 14 day trial of this feature as it's part of Infracost Cloud.

module.database.google_sql_database_instance.master

  • Missing mandatory tags: Service, Environment

in project AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

module.database.google_sql_database_instance.read_replica

  • Missing mandatory tags: Service, Environment

in project AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

module.load_balancer.google_compute_global_forwarding_rule.default

  • Missing mandatory tags: Service, Environment

in project AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

module.managed_instance_group_region1.google_compute_instance_template.appserver

  • Missing mandatory tags: Service, Environment

in project AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

module.managed_instance_group_region2.google_compute_instance_template.appserver

  • Missing mandatory tags: Service, Environment

in project AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

module.static_page.google_storage_bucket.static_webpage

  • Missing mandatory tags: Service, Environment

in project AnoopHegde/platformengine-projects/GCP-GHA/tfplan.json

Example threshold warning

At least one project exceeded per-project threshold. Cost increased by $184, threshold was $10. This example Guardrail shows how you can monitor pull request costs, and trigger actions when your defined thresholds are exceeded. You can adjust it from https://dashboard.infracost.io > Governance > Guardrails. You have a 14 day trial of this feature as it's part of Infracost Cloud.

Change increases costs by more than $1.2K/yr - review

Cost increased by $184, threshold was $100. This change increases costs by more than $1.2K/yr, you might want to review it with your team lead.

🟢 54 passed
54 FinOps policies, 0 Tagging policies, and 0 Guardrails passed.

View report in Infracost Cloud. This comment will be updated when code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant