Skip to content

client server creation using cloud shell #13

@nhefets

Description

@nhefets

Welcome to Cloud Shell! Type "help" to get started.
Your Cloud Platform project in this session is set to aesthetic-hub-387607.
Use “gcloud config set project [PROJECT_ID]” to change to a different project.
nhefets@cloudshell:~ (aesthetic-hub-387607)$ git clone
https://github.com/googlecloudplatform/deploystack-nosql-client-server
Cloning into 'deploystack-nosql-client-server'...
remote: Enumerating objects: 290, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 290 (delta 43), reused 37 (delta 31), pack-reused 224
Receiving objects: 100% (290/290), 87.45 KiB | 844.00 KiB/s, done.
Resolving deltas: 100% (130/130), done.
nhefets@cloudshell:~ (aesthetic-hub-387607)$ cd deploystack-nosql-client-server
&& deploystack install

Deploystack
NoSQL Client Server
Installation will proceed with these settings
Setting Value

Stack Name nosql-client-server
Project ID aesthetic-hub-387607
Basename nosql-client-server
Region me-west1
Zone me-west1-a

Initializing the backend...

Initializing provider plugins...

  • Finding latest version of hashicorp/google...
  • Finding latest version of hashicorp/google-beta...
  • Installing hashicorp/google v4.66.0...
  • Installed hashicorp/google v4.66.0 (signed by HashiCorp)
  • Installing hashicorp/google-beta v4.66.0...
  • Installed hashicorp/google-beta v4.66.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
data.google_project.project: Reading...

│ Error: Error when reading or editing Project "aesthetic-hub-387607": googleapi: Error 403: Cloud Resource Manager API has not been used in project 280138726953 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=280138726953 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.Help",
│ "links": [
│ {
│ "description": "Google developers console API activation",
│ "url": "https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=280138726953"
│ }
│ ]
│ },
│ {
│ "@type": "type.googleapis.com/google.rpc.ErrorInfo",
│ "domain": "googleapis.com",
│ "metadata": {
│ "consumer": "projects/280138726953",
│ "service": "cloudresourcemanager.googleapis.com"
│ },
│ "reason": "SERVICE_DISABLED"
│ }
│ ]
│ , accessNotConfigured

│ with data.google_project.project,
│ on main.tf line 21, in data "google_project" "project":
│ 21: data "google_project" "project" {

Deploystack - Error
An error occurred collecting the necessary information to run your Deploystack
application. Please try again.

If the problem persists, please file an issue with the Github repo:
https://github.com/googlecloudplatform/deploystack-nosql-client-server/issues
nhefets@cloudshell:/deploystack-nosql-client-server (aesthetic-hub-387607)$ cd deploystack-nosql-client-server && deploystack install
-bash: cd: deploystack-nosql-client-server: No such file or directory
nhefets@cloudshell:
/deploystack-nosql-client-server (aesthetic-hub-387607)$ git clone https://github.com/googlecloudplatform/deploystack-nosql-client-server
Cloning into 'deploystack-nosql-client-server'...
remote: Enumerating objects: 290, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 290 (delta 43), reused 37 (delta 31), pack-reused 224
Receiving objects: 100% (290/290), 87.45 KiB | 4.60 MiB/s, done.
Resolving deltas: 100% (130/130), done.
nhefets@cloudshell:~/deploystack-nosql-client-server (aesthetic-hub-387607)$ cd deploystack-nosql-client-server && deploystack install

Deploystack
NoSQL Client Server
Installation will proceed with these settings
Setting Value

Stack Name nosql-client-server
Project ID aesthetic-hub-387607
Basename nosql-client-server
Region me-west1
Zone me-west1-a

Initializing the backend...

Initializing provider plugins...

  • Finding latest version of hashicorp/google...
  • Finding latest version of hashicorp/google-beta...
  • Installing hashicorp/google v4.66.0...
  • Installed hashicorp/google v4.66.0 (signed by HashiCorp)
  • Installing hashicorp/google-beta v4.66.0...
  • Installed hashicorp/google-beta v4.66.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
data.google_project.project: Reading...
data.google_project.project: Read complete after 1s [id=projects/aesthetic-hub-387607]

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

  • create
    <= read (data resources)

Terraform will perform the following actions:

data.google_compute_network.default will be read during apply

(depends on a resource or a module with changes pending)

<= data "google_compute_network" "default" {
+ description = (known after apply)
+ gateway_ipv4 = (known after apply)
+ id = (known after apply)
+ name = "default"
+ project = "aesthetic-hub-387607"
+ self_link = (known after apply)
+ subnetworks_self_links = (known after apply)
}

google_compute_firewall.default-allow-http will be created

  • resource "google_compute_firewall" "default-allow-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 = "deploystack-allow-http"

    • network = "nosql-client-server-network"

    • priority = 1000

    • project = "280138726953"

    • self_link = (known after apply)

    • source_ranges = [

      • "0.0.0.0/0",
        ]
    • target_tags = [

      • "http-server",
        ]
    • allow {

      • ports = [
        • "80",
          ]
      • protocol = "tcp"
        }
        }

google_compute_firewall.default-allow-internal will be created

  • resource "google_compute_firewall" "default-allow-internal" {
    • creation_timestamp = (known after apply)

    • destination_ranges = (known after apply)

    • direction = (known after apply)

    • enable_logging = (known after apply)

    • id = (known after apply)

    • name = "deploystack-allow-internal"

    • network = "nosql-client-server-network"

    • priority = 1000

    • project = "280138726953"

    • self_link = (known after apply)

    • source_ranges = [

      • "10.128.0.0/20",
        ]
    • allow {

      • ports = [
        • "0-65535",
          ]
      • protocol = "tcp"
        }
    • allow {

      • ports = [
        • "0-65535",
          ]
      • protocol = "udp"
        }
    • allow {

      • ports = []
      • protocol = "icmp"
        }
        }

google_compute_firewall.default-allow-ssh will be created

  • resource "google_compute_firewall" "default-allow-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 = "deploystack-allow-ssh"

    • network = "nosql-client-server-network"

    • priority = 1000

    • project = "280138726953"

    • self_link = (known after apply)

    • source_ranges = [

      • "0.0.0.0/0",
        ]
    • target_tags = [

      • "ssh-server",
        ]
    • allow {

      • ports = [
        • "22",
          ]
      • protocol = "tcp"
        }
        }

google_compute_instance.client will be created

  • resource "google_compute_instance" "client" {
    • allow_stopping_for_update = true

    • can_ip_forward = false

    • cpu_platform = (known after apply)

    • current_status = (known after apply)

    • deletion_protection = false

    • guest_accelerator = (known after apply)

    • id = (known after apply)

    • instance_id = (known after apply)

    • label_fingerprint = (known after apply)

    • machine_type = "e2-standard-2"

    • metadata_fingerprint = (known after apply)

    • metadata_startup_script = (known after apply)

    • min_cpu_platform = (known after apply)

    • name = "client"

    • project = "aesthetic-hub-387607"

    • self_link = (known after apply)

    • tags = [

      • "http-server",
      • "https-server",
      • "ssh-server",
        ]
    • tags_fingerprint = (known after apply)

    • zone = "me-west1-a"

    • boot_disk {

      • auto_delete = true

      • device_name = "client"

      • disk_encryption_key_sha256 = (known after apply)

      • kms_key_self_link = (known after apply)

      • mode = "READ_WRITE"

      • source = (known after apply)

      • initialize_params {

        • image = "family/ubuntu-1804-lts"
        • labels = (known after apply)
        • size = 10
        • type = "pd-standard"
          }
          }
    • network_interface {

      • ipv6_access_type = (known after apply)

      • name = (known after apply)

      • network = "nosql-client-server-network"

      • network_ip = (known after apply)

      • stack_type = (known after apply)

      • subnetwork = (known after apply)

      • subnetwork_project = (known after apply)

      • access_config {

        • nat_ip = (known after apply)
        • network_tier = (known after apply)
          }
          }
    • service_account {

google_compute_instance.server will be created

  • resource "google_compute_instance" "server" {
    • allow_stopping_for_update = true

    • can_ip_forward = false

    • cpu_platform = (known after apply)

    • current_status = (known after apply)

    • deletion_protection = false

    • guest_accelerator = (known after apply)

    • id = (known after apply)

    • instance_id = (known after apply)

    • label_fingerprint = (known after apply)

    • machine_type = "e2-standard-2"

    • metadata_fingerprint = (known after apply)

    • metadata_startup_script = <<-EOT
      apt-get update
      apt-get install -y mongodb
      service mongodb stop
      sed -i 's/bind_ip = 127.0.0.1/bind_ip = 0.0.0.0/' /etc/mongodb.conf
      iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 27017
      service mongodb start
      EOT

    • min_cpu_platform = (known after apply)

    • name = "server"

    • project = "aesthetic-hub-387607"

    • self_link = (known after apply)

    • tags = [

      • "http-server",
      • "ssh-server",
        ]
    • tags_fingerprint = (known after apply)

    • zone = "me-west1-a"

    • boot_disk {

      • auto_delete = true

      • device_name = "server"

      • disk_encryption_key_sha256 = (known after apply)

      • kms_key_self_link = (known after apply)

      • mode = "READ_WRITE"

      • source = (known after apply)

      • initialize_params {

        • image = "family/ubuntu-1804-lts"
        • labels = (known after apply)
        • size = 10
        • type = "pd-standard"
          }
          }
    • network_interface {

      • ipv6_access_type = (known after apply)

      • name = (known after apply)

      • network = "nosql-client-server-network"

      • network_ip = (known after apply)

      • stack_type = (known after apply)

      • subnetwork = (known after apply)

      • subnetwork_project = (known after apply)

      • access_config {

        • nat_ip = (known after apply)
        • network_tier = (known after apply)
          }
          }
    • service_account {

google_compute_network.main will be created

  • resource "google_compute_network" "main" {
    • auto_create_subnetworks = true
    • 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 = "nosql-client-server-network"
    • network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL"
    • project = "aesthetic-hub-387607"
    • routing_mode = (known after apply)
    • self_link = (known after apply)
      }

google_project_service.all["compute.googleapis.com"] will be created

  • resource "google_project_service" "all" {
    • disable_dependent_services = false
    • disable_on_destroy = false
    • id = (known after apply)
    • project = "280138726953"
    • service = "compute.googleapis.com"
      }

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

Changes to Outputs:

  • client_url = (known after apply)
    google_project_service.all["compute.googleapis.com"]: Creating...
    google_project_service.all["compute.googleapis.com"]: Creation complete after 4s [id=280138726953/compute.googleapis.com]
    data.google_compute_network.default: Reading...
    google_compute_network.main: Creating...
    data.google_compute_network.default: Read complete after 0s [id=projects/aesthetic-hub-387607/global/networks/default]
    google_compute_network.main: Still creating... [10s elapsed]
    google_compute_network.main: Still creating... [20s elapsed]
    google_compute_network.main: Still creating... [30s elapsed]
    google_compute_network.main: Still creating... [40s elapsed]
    google_compute_network.main: Still creating... [50s elapsed]
    google_compute_network.main: Creation complete after 53s [id=projects/aesthetic-hub-387607/global/networks/nosql-client-server-network]
    google_compute_firewall.default-allow-http: Creating...
    google_compute_firewall.default-allow-ssh: Creating...
    google_compute_firewall.default-allow-internal: Creating...
    google_compute_instance.server: Creating...
    google_compute_firewall.default-allow-http: Still creating... [10s elapsed]
    google_compute_firewall.default-allow-ssh: Still creating... [10s elapsed]
    google_compute_firewall.default-allow-internal: Still creating... [10s elapsed]
    google_compute_instance.server: Still creating... [10s elapsed]
    google_compute_firewall.default-allow-internal: Creation complete after 11s [id=projects/280138726953/global/firewalls/deploystack-allow-internal]
    google_compute_firewall.default-allow-http: Creation complete after 12s [id=projects/280138726953/global/firewalls/deploystack-allow-http]
    google_compute_firewall.default-allow-ssh: Creation complete after 12s [id=projects/280138726953/global/firewalls/deploystack-allow-ssh]
    google_compute_instance.server: Creation complete after 15s [id=projects/aesthetic-hub-387607/zones/me-west1-a/instances/server]
    google_compute_instance.client: Creating...
    google_compute_instance.client: Still creating... [10s elapsed]
    google_compute_instance.client: Creation complete after 15s [id=projects/aesthetic-hub-387607/zones/me-west1-a/instances/client]

Apply complete! Resources: 7 added, 0 changed, 0 destroyed.

Outputs:

client_url = "http://34.165.14.71"
Waiting for the client to be active
..................................................Max attempts reached.
Solution was not successfully installed.

If the problem persists, please file an issue with the Github repo:
https://github.com/googlecloudplatform/deploystack-nosql-client-server/issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions