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

Add table gcp_compute_machine_image Closes #517 #519

Merged
merged 5 commits into from
Feb 1, 2024
Merged

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Dec 5, 2023

Integration test logs

Logs

No env file present for the current environment:  staging 
 Falling back to .env config
No env file present for the current environment:  staging
customEnv TURBOT_TEST_EXPECTED_TIMEOUT undefined

SETUP: tests/gcp_compute_machine_image []

PRETEST: tests/gcp_compute_machine_image

TEST: tests/gcp_compute_machine_image
Running terraform
data.google_client_config.current: Reading...
data.google_client_config.current: Read complete after 0s [id=projects/"dumm-dfd"/regions/"us-east1"/zones/"us-east1-b"]
data.null_data_source.resource: Reading...
data.null_data_source.resource: Read complete after 0s [id=static]

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:

  # google_compute_instance.names_test_resource will be created
  + resource "google_compute_instance" "names_test_resource" {
      + can_ip_forward       = false
      + cpu_platform         = (known after apply)
      + current_status       = (known after apply)
      + deletion_protection  = false
      + effective_labels     = (known after apply)
      + guest_accelerator    = (known after apply)
      + id                   = (known after apply)
      + instance_id          = (known after apply)
      + label_fingerprint    = (known after apply)
      + machine_type         = "f1-micro"
      + metadata_fingerprint = (known after apply)
      + min_cpu_platform     = (known after apply)
      + name                 = "turbottest96450"
      + project              = "dumm-dfd"
      + self_link            = (known after apply)
      + tags_fingerprint     = (known after apply)
      + terraform_labels     = (known after apply)
      + zone                 = "us-east1-b"

      + boot_disk {
          + auto_delete                = true
          + device_name                = (known after apply)
          + disk_encryption_key_sha256 = (known after apply)
          + kms_key_self_link          = (known after apply)
          + mode                       = "READ_WRITE"
          + source                     = (known after apply)

          + initialize_params {
              + image  = "debian-cloud/debian-11"
              + labels = (known after apply)
              + size   = (known after apply)
              + 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                     = "default"
          + network_attachment          = (known after apply)
          + network_ip                  = (known after apply)
          + stack_type                  = (known after apply)
          + subnetwork                  = (known after apply)
          + subnetwork_project          = (known after apply)
        }
    }

  # google_compute_machine_image.names_test_resource will be created
  + resource "google_compute_machine_image" "names_test_resource" {
      + id                = (known after apply)
      + name              = "turbottest96450"
      + project           = "dumm-dfd"
      + self_link         = (known after apply)
      + source_instance   = (known after apply)
      + storage_locations = (known after apply)
    }

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

Changes to Outputs:
  + machine_type  = "f1-micro"
  + resource_aka  = "gcp://compute.googleapis.com/projects/dumm-dfd/machineImages/turbottest96450"
  + resource_name = "turbottest96450"
  + self_link     = (known after apply)
google_compute_instance.names_test_resource: Creating...
google_compute_instance.names_test_resource: Still creating... [10s elapsed]
google_compute_instance.names_test_resource: Still creating... [20s elapsed]
google_compute_instance.names_test_resource: Creation complete after 21s [id=projects/dumm-dfd/zones/us-east1-b/instances/turbottest96450]
google_compute_machine_image.names_test_resource: Creating...
google_compute_machine_image.names_test_resource: Still creating... [10s elapsed]
google_compute_machine_image.names_test_resource: Still creating... [20s elapsed]
google_compute_machine_image.names_test_resource: Still creating... [30s elapsed]
google_compute_machine_image.names_test_resource: Still creating... [40s elapsed]
google_compute_machine_image.names_test_resource: Creation complete after 44s [id=projects/dumm-dfd/global/machineImages/turbottest96450]

Warning: Deprecated

  with data.null_data_source.resource,
  on variables.tf line 33, in data "null_data_source" "resource":
  33: data "null_data_source" "resource" {

The null_data_source was historically used to construct intermediate values
to re-use elsewhere in configuration, the same can now be achieved using
locals or the terraform_data resource type in Terraform 1.4 and later.

(and one more similar warning elsewhere)

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

Outputs:

machine_type = "f1-micro"
resource_aka = "gcp://compute.googleapis.com/projects/dumm-dfd/machineImages/turbottest96450"
resource_name = "turbottest96450"
self_link = "https://www.googleapis.com/compute/v1/projects/dumm-dfd/global/machineImages/turbottest96450"

Running SQL query: test-get-query.sql
[
  {
    "kind": "compute#machineImage",
    "name": "turbottest96450",
    "self_link": "https://www.googleapis.com/compute/v1/projects/dumm-dfd/global/machineImages/turbottest96450",
    "title": "turbottest96450"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "akas": [
      "gcp://compute.googleapis.com/projects/dumm-dfd/machineImages/turbottest96450"
    ],
    "name": "turbottest96450",
    "title": "turbottest96450"
  }
]
✔ PASSED

Running SQL query: test-notfound-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://compute.googleapis.com/projects/dumm-dfd/machineImages/turbottest96450"
    ],
    "title": "turbottest96450"
  }
]
✔ PASSED

POSTTEST: tests/gcp_compute_machine_image

TEARDOWN: tests/gcp_compute_machine_image

SUMMARY:

1/1 passed.

Example query results

Results
> select * from gcp_compute_machine_image
+---------+---------------------+----------------------------------------------------------------------------------------+---------------------------+-------------+-------------+----------------------+-------------------------------------------------------------------->
| name    | id                  | self_link                                                                              | creation_timestamp        | description | guest_flush | kind                 | source_instance                                                    >
+---------+---------------------+----------------------------------------------------------------------------------------+---------------------------+-------------+-------------+----------------------+-------------------------------------------------------------------->
| test123 | 8019220569218285477 | https://www.googleapis.com/compute/v1/projects/dumm-dfd/global/machineImages/test123 | 2023-12-05T20:57:07+05:30 | test123     | false       | compute#machineImage | https://www.googleapis.com/compute/v1/projects/dumm-dfd/zones/us->
|         |                     |                                                                                        |                           |             |             |                      |                                                                    >
+---------+---------------------+----------------------------------------------------------------------------------------+---------------------------+-------------+-------------+----------------------+-------------------------------------------------------------------->

Time: 0.6s. Rows fetched: 1. Hydrate calls: 0.
> select * from gcp_compute_machine_image where name = 'test123'
+---------+---------------------+----------------------------------------------------------------------------------------+---------------------------+-------------+-------------+----------------------+-------------------------------------------------------------------->
| name    | id                  | self_link                                                                              | creation_timestamp        | description | guest_flush | kind                 | source_instance                                                    >
+---------+---------------------+----------------------------------------------------------------------------------------+---------------------------+-------------+-------------+----------------------+-------------------------------------------------------------------->
| test123 | 8019220569218285477 | https://www.googleapis.com/compute/v1/projects/dumm-dfd/global/machineImages/test123 | 2023-12-05T20:57:07+05:30 | test123     | false       | compute#machineImage | https://www.googleapis.com/compute/v1/projects/dumm-dfd/zones/us->
|         |                     |                                                                                        |                           |             |             |                      |                                                                    >
+---------+---------------------+----------------------------------------------------------------------------------------+---------------------------+-------------+-------------+----------------------+-------------------------------------------------------------------->

@ParthaI ParthaI self-assigned this Dec 5, 2023
@ParthaI ParthaI linked an issue Dec 5, 2023 that may be closed by this pull request
@khushboo9024 khushboo9024 merged commit dd88109 into main Feb 1, 2024
1 check passed
@khushboo9024 khushboo9024 deleted the issue-517 branch February 1, 2024 07:38
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.

Add table gcp_compute_machine_images
2 participants