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

Added tables gcp_alloydb_cluster and gcp_alloydb_instance Closes #594 #595 #597

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jun 5, 2024

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_alloydb_instance []
 
 PRETEST: tests/gcp_alloydb_instance
 
 TEST: tests/gcp_alloydb_instance
 Running terraform
 data.google_client_config.current: Reading...
 data.google_client_config.current: Read complete after 1s [id=projects/"gskwer-bbb"/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_alloydb_cluster.default will be created
   + resource "google_alloydb_cluster" "default" {
       + backup_source          = (known after apply)
       + cluster_id             = "turbottest7011"
       + cluster_type           = "PRIMARY"
       + continuous_backup_info = (known after apply)
       + database_version       = (known after apply)
       + deletion_policy        = "DEFAULT"
       + effective_annotations  = (known after apply)
       + effective_labels       = (known after apply)
       + encryption_info        = (known after apply)
       + id                     = (known after apply)
       + location               = "us-central1"
       + migration_source       = (known after apply)
       + name                   = (known after apply)
       + network                = (known after apply)
       + project                = "gskwer-bbb"
       + reconciling            = (known after apply)
       + state                  = (known after apply)
       + terraform_labels       = (known after apply)
       + uid                    = (known after apply)
 
       + initial_user {
           + password = (sensitive value)
         }
 
       + network_config {
           + network = (known after apply)
         }
     }
 
   # google_alloydb_instance.default will be created
   + resource "google_alloydb_instance" "default" {
       + availability_type     = (known after apply)
       + cluster               = (known after apply)
       + create_time           = (known after apply)
       + database_flags        = (known after apply)
       + effective_annotations = (known after apply)
       + effective_labels      = (known after apply)
       + id                    = (known after apply)
       + instance_id           = "turbottest7011"
       + instance_type         = "PRIMARY"
       + ip_address            = (known after apply)
       + name                  = (known after apply)
       + public_ip_address     = (known after apply)
       + reconciling           = (known after apply)
       + state                 = (known after apply)
       + terraform_labels      = (known after apply)
       + uid                   = (known after apply)
       + update_time           = (known after apply)
 
       + machine_config {
           + cpu_count = 2
         }
     }
 
   # google_compute_global_address.private_ip_alloc will be created
   + resource "google_compute_global_address" "private_ip_alloc" {
       + address            = (known after apply)
       + address_type       = "INTERNAL"
       + creation_timestamp = (known after apply)
       + id                 = (known after apply)
       + name               = "turbottest7011"
       + network            = (known after apply)
       + prefix_length      = 16
       + project            = "gskwer-bbb"
       + purpose            = "VPC_PEERING"
       + self_link          = (known after apply)
     }
 
   # google_compute_network.default will be created
   + resource "google_compute_network" "default" {
       + 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                                      = "turbottest7011"
       + network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL"
       + numeric_id                                = (known after apply)
       + project                                   = "gskwer-bbb"
       + routing_mode                              = (known after apply)
       + self_link                                 = (known after apply)
     }
 
   # google_service_networking_connection.vpc_connection will be created
   + resource "google_service_networking_connection" "vpc_connection" {
       + id                      = (known after apply)
       + network                 = (known after apply)
       + peering                 = (known after apply)
       + reserved_peering_ranges = [
           + "turbottest7011",
         ]
       + service                 = "servicenetworking.googleapis.com"
     }
 
 Plan: 5 to add, 0 to change, 0 to destroy.
 
 Changes to Outputs:
   + project_id    = "gskwer-bbb"
   + resource_aka  = (known after apply)
   + resource_id   = (known after apply)
   + resource_name = "turbottest7011"
 google_compute_network.default: Creating...
 google_compute_network.default: Still creating... [10s elapsed]
 google_compute_network.default: Still creating... [20s elapsed]
 google_compute_network.default: Still creating... [30s elapsed]
 google_compute_network.default: Still creating... [40s elapsed]
 google_compute_network.default: Still creating... [50s elapsed]
 google_compute_network.default: Creation complete after 57s [id=projects/gskwer-bbb/global/networks/turbottest7011]
 google_compute_global_address.private_ip_alloc: Creating...
 google_alloydb_cluster.default: Creating...
 google_compute_global_address.private_ip_alloc: Still creating... [10s elapsed]
 google_alloydb_cluster.default: Still creating... [10s elapsed]
 google_compute_global_address.private_ip_alloc: Creation complete after 14s [id=projects/gskwer-bbb/global/addresses/turbottest7011]
 google_service_networking_connection.vpc_connection: Creating...
 google_alloydb_cluster.default: Creation complete after 17s [id=projects/gskwer-bbb/locations/us-central1/clusters/turbottest7011]
 google_service_networking_connection.vpc_connection: Still creating... [10s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [20s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [30s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [40s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [50s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [1m0s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [1m10s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [1m20s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [1m30s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [1m40s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [1m50s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [2m0s elapsed]
 google_service_networking_connection.vpc_connection: Still creating... [2m10s elapsed]
 google_service_networking_connection.vpc_connection: Creation complete after 2m11s [id=projects%2Fgskwer-bbb%2Fglobal%2Fnetworks%2Fturbottest7011:servicenetworking.googleapis.com]
 google_alloydb_instance.default: Creating...
 google_alloydb_instance.default: Still creating... [10s elapsed]
 google_alloydb_instance.default: Still creating... [20s elapsed]
 google_alloydb_instance.default: Still creating... [30s elapsed]
 google_alloydb_instance.default: Still creating... [40s elapsed]
 google_alloydb_instance.default: Still creating... [50s elapsed]
 google_alloydb_instance.default: Still creating... [1m0s elapsed]
 google_alloydb_instance.default: Still creating... [1m10s elapsed]
 google_alloydb_instance.default: Still creating... [1m20s elapsed]
 google_alloydb_instance.default: Still creating... [1m30s elapsed]
 google_alloydb_instance.default: Still creating... [1m40s elapsed]
 google_alloydb_instance.default: Still creating... [1m50s elapsed]
 google_alloydb_instance.default: Still creating... [2m0s elapsed]
 google_alloydb_instance.default: Still creating... [2m10s elapsed]
 google_alloydb_instance.default: Still creating... [2m20s elapsed]
 google_alloydb_instance.default: Still creating... [2m30s elapsed]
 google_alloydb_instance.default: Still creating... [2m40s elapsed]
 google_alloydb_instance.default: Still creating... [2m50s elapsed]
 google_alloydb_instance.default: Still creating... [3m0s elapsed]
 google_alloydb_instance.default: Still creating... [3m10s elapsed]
 google_alloydb_instance.default: Still creating... [3m20s elapsed]
 google_alloydb_instance.default: Still creating... [3m30s elapsed]
 google_alloydb_instance.default: Still creating... [3m40s elapsed]
 google_alloydb_instance.default: Still creating... [3m50s elapsed]
 google_alloydb_instance.default: Still creating... [4m0s elapsed]
 google_alloydb_instance.default: Still creating... [4m10s elapsed]
 google_alloydb_instance.default: Still creating... [4m20s elapsed]
 google_alloydb_instance.default: Still creating... [4m30s elapsed]
 google_alloydb_instance.default: Still creating... [4m40s elapsed]
 google_alloydb_instance.default: Still creating... [4m50s elapsed]
 google_alloydb_instance.default: Still creating... [5m0s elapsed]
 google_alloydb_instance.default: Still creating... [5m10s elapsed]
 google_alloydb_instance.default: Still creating... [5m20s elapsed]
 google_alloydb_instance.default: Still creating... [5m30s elapsed]
 google_alloydb_instance.default: Still creating... [5m40s elapsed]
 google_alloydb_instance.default: Still creating... [5m50s elapsed]
 google_alloydb_instance.default: Still creating... [6m0s elapsed]
 google_alloydb_instance.default: Still creating... [6m10s elapsed]
 google_alloydb_instance.default: Still creating... [6m20s elapsed]
 google_alloydb_instance.default: Still creating... [6m30s elapsed]
 google_alloydb_instance.default: Still creating... [6m40s elapsed]
 google_alloydb_instance.default: Still creating... [6m50s elapsed]
 google_alloydb_instance.default: Still creating... [7m0s elapsed]
 google_alloydb_instance.default: Creation complete after 7m7s [id=projects/gskwer-bbb/locations/us-central1/clusters/turbottest7011/instances/turbottest7011]
 
 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: 5 added, 0 changed, 0 destroyed.
 
 Outputs:
 
 project_id = "gskwer-bbb"
 resource_aka = "gcp://alloydb.googleapis.com/projects/gskwer-bbb/locations/us-central1/clusters/turbottest7011/instances/turbottest7011"
 resource_id = "projects/gskwer-bbb/locations/us-central1/clusters/turbottest7011/instances/turbottest7011"
 resource_name = "turbottest7011"
 
 Running SQL query: test-get-query.sql
 
 Time: 4.8s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0.
 
 Scans:
   1) gcp_alloydb_instance.gcp: Time: 4.6s. Fetched: 1. Hydrates: 0. Quals: cluster_name=turbottest7011, instance_display_name=turbottest7011.
 
 [
   {
     "cluster_name": "turbottest7011",
     "instance_display_name": "turbottest7011"
   }
 ]
 ✔ PASSED
 
 Running SQL query: test-list-query.sql
 
 Time: 5.2s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0.
 
 Scans:
   1) gcp_alloydb_instance.gcp: Time: 4.9s. Fetched: 1. Hydrates: 0. Quals: cluster_name=turbottest7011.
 
 [
   {
     "cluster_name": "turbottest7011",
     "instance_display_name": "turbottest7011"
   }
 ]
 ✔ PASSED
 
 Running SQL query: test-notfound-query.sql
 
 Time: 4.6s. Rows returned: 0.
 []
 ✔ PASSED
 
 Running SQL query: test-turbot-query.sql
 
 Time: 5.3s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 1.
 
 Scans:
   1) gcp_alloydb_instance.gcp: Time: 5.1s. Fetched: 1. Hydrates: 1. Quals: cluster_name=turbottest7011.
 
 [
   {
     "akas": [
       "gcp://alloydb.googleapis.com/projects/gskwer-bbb/locations/us-central1/clusters/turbottest7011/instances/turbottest7011"
     ],
     "title": "turbottest7011"
   }
 ]
 ✔ PASSED
 
 POSTTEST: tests/gcp_alloydb_instance
 
 TEARDOWN: tests/gcp_alloydb_instance
 
 SUMMARY:
 
 1/1 passed.

Example query results

Results
> select * from gcp_alloydb_instance where cluster_name = 'turbottest88930' and instance_display_name = 'turbottest88930'
+-----------------------+-----------------+----------------------------------------------------------------------------------------------+----------+--------------------------------------+---------------------------+-------------------+-------------+------+----------+->
| instance_display_name | cluster_name    | name                                                                                         | state    | uid                                  | create_time               | availability_type | delete_time | etag | gce_zone | >
+-----------------------+-----------------+----------------------------------------------------------------------------------------------+----------+--------------------------------------+---------------------------+-------------------+-------------+------+----------+->
| turbottest88930       | turbottest88930 | projects/gskwer-bbb/locations/us-central1/clusters/turbottest88930/instances/turbottest88930 | CREATING | 88a85790-a904-41c1-aad7-6cd2a7ca1dfa | 2024-06-05T14:00:13+05:30 | REGIONAL          | <null>      |      |          | >
+-----------------------+-----------------+----------------------------------------------------------------------------------------------+----------+--------------------------------------+---------------------------+-------------------+-------------+------+----------+->

Time: 2.0s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 1.

Scans:
  1) gcp_alloydb_instance.gcp: Time: 2.0s. Fetched: 1. Hydrates: 1. Quals: cluster_name=turbottest88930, instance_display_name=turbottest88930.

> select * from gcp_alloydb_instance where cluster_name = 'turbottest88930' and instance_display_name = 'turbottest88932'
+-----------------------+--------------+------+-------+-----+-------------+-------------------+-------------+------+----------+---------------+------------+-------------+---------------+-------------+-------------+--------------------------+----------------+--------+-->
| instance_display_name | cluster_name | name | state | uid | create_time | availability_type | delete_time | etag | gce_zone | instance_type | ip_address | reconciling | satisfies_pzs | update_time | annotations | client_connection_config | database_flags | labels | m>
+-----------------------+--------------+------+-------+-----+-------------+-------------------+-------------+------+----------+---------------+------------+-------------+---------------+-------------+-------------+--------------------------+----------------+--------+-->
+-----------------------+--------------+------+-------+-----+-------------+-------------------+-------------+------+----------+---------------+------------+-------------+---------------+-------------+-------------+--------------------------+----------------+--------+-->

Time: 2.4s. Rows returned: 0.
> select * from gcp_alloydb_instance where cluster_name = 'turbottest88930'
+-----------------------+-----------------+----------------------------------------------------------------------------------------------+----------+--------------------------------------+---------------------------+-------------------+-------------+------+----------+->
| instance_display_name | cluster_name    | name                                                                                         | state    | uid                                  | create_time               | availability_type | delete_time | etag | gce_zone | >
+-----------------------+-----------------+----------------------------------------------------------------------------------------------+----------+--------------------------------------+---------------------------+-------------------+-------------+------+----------+->
| turbottest88930       | turbottest88930 | projects/gskwer-bbb/locations/us-central1/clusters/turbottest88930/instances/turbottest88930 | CREATING | 88a85790-a904-41c1-aad7-6cd2a7ca1dfa | 2024-06-05T14:00:13+05:30 | REGIONAL          | <null>      |      |          | >
+-----------------------+-----------------+----------------------------------------------------------------------------------------------+----------+--------------------------------------+---------------------------+-------------------+-------------+------+----------+->

Time: 3.0s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 1.

Scans:
  1) gcp_alloydb_instance.gcp: Time: 3.0s. Fetched: 1. Hydrates: 1. Quals: cluster_name=turbottest88930.


@ParthaI ParthaI requested a review from misraved June 5, 2024 09:17
@ParthaI ParthaI self-assigned this Jun 5, 2024
This was linked to issues Jun 5, 2024
@khushboo9024 khushboo9024 merged commit 00db235 into main Jun 7, 2024
1 check passed
@khushboo9024 khushboo9024 deleted the issue-594 branch June 7, 2024 11:45
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_alloydb_instance Add table gcp_alloydb_cluster
2 participants