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 table gcp_secret_manager_secret Closes #592 #593

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented May 29, 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_secret_manager_secret []

PRETEST: tests/gcp_secret_manager_secret

TEST: tests/gcp_secret_manager_secret
Running terraform
data.google_project.current: Reading...
data.google_client_config.current: Reading...
data.google_client_config.current: Read complete after 0s [id=projects/"pdket-aaa"/regions/"us-east1"/zones/"us-east1-b"]
data.null_data_source.resource: Reading...
data.null_data_source.resource: Read complete after 0s [id=static]
data.google_project.current: Read complete after 3s [id=projects/pdket-aaa]

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_secret_manager_secret.named_test_resource will be created
  + resource "google_secret_manager_secret" "named_test_resource" {
      + create_time           = (known after apply)
      + effective_annotations = (known after apply)
      + effective_labels      = {
          + "label" = "turbottest31021"
        }
      + expire_time           = (known after apply)
      + id                    = (known after apply)
      + labels                = {
          + "label" = "turbottest31021"
        }
      + name                  = (known after apply)
      + project               = "pdket-aaa"
      + secret_id             = "turbottest31021"
      + terraform_labels      = {
          + "label" = "turbottest31021"
        }

      + replication {
          + user_managed {
              + replicas {
                  + location = "us-central1"
                }
              + replicas {
                  + location = "us-east1"
                }
            }
        }
    }

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

Changes to Outputs:
  + project_id     = "pdket-aaa"
  + project_number = "342342523453"
  + resource_aka   = "gcp://secretmanager.googleapis.com/projects/342342523453/secrets/turbottest31021"
  + resource_id    = "projects/342342523453/secrets/turbottest31021"
  + resource_name  = "turbottest31021"
google_secret_manager_secret.named_test_resource: Creating...
google_secret_manager_secret.named_test_resource: Creation complete after 3s [id=projects/pdket-aaa/secrets/turbottest31021]

Warning: Deprecated

  with data.null_data_source.resource,
  on variables.tf line 35, in data "null_data_source" "resource":
  35: 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: 1 added, 0 changed, 0 destroyed.

Outputs:

project_id = "pdket-aaa"
project_number = "342342523453"
resource_aka = "gcp://secretmanager.googleapis.com/projects/342342523453/secrets/turbottest31021"
resource_id = "projects/342342523453/secrets/turbottest31021"
resource_name = "turbottest31021"

Running SQL query: test-get-query.sql

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

Scans:
  1) gcp_secret_manager_secret.gcp: Time: 1.3s. Fetched: 1. Hydrates: 1. Quals: name=turbottest31021.

[
  {
    "name": "turbottest31021",
    "project": "pdket-aaa",
    "title": "projects/342342523453/secrets/turbottest31021"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql

Time: 1.2s. Rows returned: 1. Rows fetched: 3. Hydrate calls: 0.

Scans:
  1) gcp_secret_manager_secret.gcp: Time: 1.0s. Fetched: 3. Hydrates: 0.

[
  {
    "name": "turbottest31021",
    "title": "projects/342342523453/secrets/turbottest31021"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql

Time: 1.5s. Rows returned: 0.
[]
✔ PASSED

Running SQL query: test-turbot-query.sql

Time: 1.4s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0.

Scans:
  1) gcp_secret_manager_secret.gcp: Time: 1.1s. Fetched: 1. Hydrates: 0. Quals: name=turbottest31021.

[
  {
    "akas": [
      "gcp://secretmanager.googleapis.com/projects/342342523453/secrets/turbottest31021"
    ],
    "title": "projects/342342523453/secrets/turbottest31021"
  }
]
✔ PASSED

POSTTEST: tests/gcp_secret_manager_secret

TEARDOWN: tests/gcp_secret_manager_secret

SUMMARY:

1/1 passed.

Example query results

Results
> select * from gcp_secret_manager_secret
+----------+---------------------------+------------------+--------+---------------------------+-----------------------------------------------------------+---------------+-----------------+--------+-----------------+----------------------------------------+----------->
| name     | create_time               | etag             | ttl    | expire_time               | replication                                               | labels        | annotations     | topics | version_aliases | title                                  | akas      >
+----------+---------------------------+------------------+--------+---------------------------+-----------------------------------------------------------+---------------+-----------------+--------+-----------------+----------------------------------------+----------->
| testew34 | 2024-05-29T19:01:26+05:30 | "161997c46740ba" | <null> | 2024-06-29T00:00:00+05:30 | {"userManaged":{"replicas":[{"location":"me-central1"}]}} | <null>        | <null>          | <null> | <null>          | projects/342342523453/secrets/testew34 | ["gcp://se>
| test234  | 2024-05-29T18:23:34+05:30 | "16199807b9333b" | <null> | <null>                    | {"automatic":{}}                                          | {"foo":"bar"} | {"foo1":"bar1"} | <null> | {"v1":"1"}      | projects/342342523453/secrets/test234  | ["gcp://se>
+----------+---------------------------+------------------+--------+---------------------------+-----------------------------------------------------------+---------------+-----------------+--------+-----------------+----------------------------------------+----------->

Time: 1.1s. Rows returned: 2. Rows fetched: 2. Hydrate calls: 2.

Scans:
  1) gcp_secret_manager_secret.gcp: Time: 1.1s. Fetched: 2. Hydrates: 2.

> select * from gcp_secret_manager_secret where name = 'testew34'
+----------+---------------------------+------------------+--------+---------------------------+-----------------------------------------------------------+--------+-------------+--------+-----------------+----------------------------------------+---------------------->
| name     | create_time               | etag             | ttl    | expire_time               | replication                                               | labels | annotations | topics | version_aliases | title                                  | akas                 >
+----------+---------------------------+------------------+--------+---------------------------+-----------------------------------------------------------+--------+-------------+--------+-----------------+----------------------------------------+---------------------->
| testew34 | 2024-05-29T19:01:26+05:30 | "161997c46740ba" | <null> | 2024-06-29T00:00:00+05:30 | {"userManaged":{"replicas":[{"location":"me-central1"}]}} | <null> | <null>      | <null> | <null>          | projects/342342523453/secrets/testew34 | ["gcp://secretmanager>
+----------+---------------------------+------------------+--------+---------------------------+-----------------------------------------------------------+--------+-------------+--------+-----------------+----------------------------------------+---------------------->

Time: 36ms. Rows returned: 1. Rows fetched: 2 (cached). Hydrate calls: 0.

@ParthaI ParthaI requested a review from misraved May 29, 2024 16:46
@ParthaI ParthaI self-assigned this May 29, 2024
@ParthaI ParthaI linked an issue May 29, 2024 that may be closed by this pull request
@misraved misraved merged commit 35abe44 into main Jun 6, 2024
1 check passed
@misraved misraved deleted the issue-gcp_secret_manager_secret branch June 6, 2024 14:40
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_secret_manager_secret
2 participants