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_tag_binding. Closes #540 #560

Merged
merged 8 commits into from
Apr 4, 2024
Merged

Add table gcp_tag_binding. Closes #540 #560

merged 8 commits into from
Apr 4, 2024

Conversation

Priyanka-Chatterjee-2000
Copy link
Contributor

@Priyanka-Chatterjee-2000 Priyanka-Chatterjee-2000 commented Apr 1, 2024

Integration test logs

Logs
TEST: tests/gcp_tag_binding
Running terraform

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_tags_tag_binding.binding will be created
  + resource "google_tags_tag_binding" "binding" {
      + id        = (known after apply)
      + name      = (known after apply)
      + parent    = "//cloudresourcemanager.googleapis.com/projects/1111111111111"
      + tag_value = (known after apply)
    }

  # google_tags_tag_key.key will be created
  + resource "google_tags_tag_key" "key" {
      + create_time     = (known after apply)
      + description     = "Tag Key for env resources."
      + id              = (known after apply)
      + name            = (known after apply)
      + namespaced_name = (known after apply)
      + parent          = "projects/1111111111111"
      + short_name      = "env"
      + update_time     = (known after apply)
    }

  # google_tags_tag_value.value will be created
  + resource "google_tags_tag_value" "value" {
      + create_time     = (known after apply)
      + description     = "Tag Value for dev resources."
      + id              = (known after apply)
      + name            = (known after apply)
      + namespaced_name = (known after apply)
      + parent          = (known after apply)
      + short_name      = "dev"
      + update_time     = (known after apply)
    }

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

Changes to Outputs:
  + name      = (known after apply)
  + parent    = "//cloudresourcemanager.googleapis.com/projects/1111111111111"
  + tag_value = (known after apply)
google_tags_tag_key.key: Creating...
google_tags_tag_key.key: Creation complete after 4s [id=tagKeys/2222222222222]
google_tags_tag_value.value: Creating...
google_tags_tag_value.value: Creation complete after 4s [id=tagValues/2222222222222]
google_tags_tag_binding.binding: Creating...
google_tags_tag_binding.binding: Creation complete after 3s [id=tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222]

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

Outputs:

name = "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222"
parent = "//cloudresourcemanager.googleapis.com/projects/1111111111111"
tag_value = "tagValues/2222222222222"

Running SQL query: test-list-query.sql
[
  {
    "name": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111tagValues/2222222222222",
    "parent": "//cloudresourcemanager.googleapis.com/projects/1111111111111",
    "tag_value": "tagValues/2222222222222",
    "title": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222"
  }
]
✔ PASSED

Running SQL query: test-notfound-query.sql
[]
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "name": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222",
    "title": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222"
  }
]
✔ PASSED

POSTTEST: tests/gcp_tag_binding

TEARDOWN: tests/gcp_tag_binding

SUMMARY:

1/1 passed.


Example query results

Results
select * from gcp_tag_binding where parent='//cloudresourcemanager.googleapis.com/projects/555555555555'
+-----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+---------------------------+---------------------------------------------------------------------->
| name                                                                                                      | parent                                                      | tag_value                 | title                                                                >
+-----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+---------------------------+---------------------------------------------------------------------->
| tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F555555555555/tagValues/281481607494532 | //cloudresourcemanager.googleapis.com/projects/555555555555 | tagValues/281481607494532 | tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F97>
+-----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+---------------------------+---------------------------------------------------------------------->

@khushboo9024 khushboo9024 marked this pull request as ready for review April 3, 2024 15:25
@bigdatasourav bigdatasourav merged commit c1a805c into main Apr 4, 2024
1 check passed
@bigdatasourav bigdatasourav deleted the issue#540 branch April 4, 2024 14:27
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.

GCP Tags should not be copied from labels
3 participants