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 skip_initial_version_creation to kms crypto key #3907

Merged

Conversation

upodroid
Copy link
Contributor

Fixes: hashicorp/terraform-provider-google#7087

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

kms: added `skip_initial_version_creation` to `google_kms_crypto_key`

@google-cla google-cla bot added the cla: yes label Aug 25, 2020
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@ndmckinley, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 24 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 4 files changed, 24 insertions(+), 5 deletions(-))
Ansible: Diff ( 2 files changed, 23 insertions(+), 1 deletion(-))
Inspec: Diff ( 4 files changed, 7 insertions(+))

@upodroid
Copy link
Contributor Author

bump

Copy link
Contributor

@nat-henderson nat-henderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, running the tests now.

@nat-henderson
Copy link
Contributor

Tests fail:

------- Stdout: -------
=== RUN   TestAccKmsCryptoKey_basic
=== PAUSE TestAccKmsCryptoKey_basic
=== CONT  TestAccKmsCryptoKey_basic
TestAccKmsCryptoKey_basic: testing.go:674: Step 0 error: errors during apply:
Error: Error creating CryptoKey: googleapi: Error 400: Invalid value at 'skip_initial_version_creation' (TYPE_BOOL),
Details:
[
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid value at 'skip_initial_version_creation' (TYPE_BOOL), ",
"field": "skip_initial_version_creation"
}
]
}
]

Copy link
Contributor

@nat-henderson nat-henderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know when you are able to fix the tests.

@upodroid
Copy link
Contributor Author

@ndmckinley There is something funny going on with the generator.

The generator creates skipInitialVersionCreation as a query parameter instead of skip_initial_version_creation. When I amend the go file manually, the tests works.

https://github.com/modular-magician/terraform-provider-google/compare/auto-pr-3907-old..auto-pr-3907#diff-346cd5ad8c45f2a15aa092b8af793d74R170 From the generated code earlier.

 REDACTED  MCW0CDP3YY  ~  go  …  github.com  hashicorp  terraform-provider-google-beta   master  10⬇  5✎  $    git diff -- '*.go'
diff --git a/google-beta/resource_kms_crypto_key.go b/google-beta/resource_kms_crypto_key.go
index 226532d1..414bc1b4 100644
--- a/google-beta/resource_kms_crypto_key.go
+++ b/google-beta/resource_kms_crypto_key.go
@@ -93,6 +93,14 @@ The first rotation will take place after the specified period. The rotation peri
 the format of a decimal number with up to 9 fractional digits, followed by the
 letter 's' (seconds). It must be greater than a day (ie, 86400).`,
                        },
+                       "skip_initial_version_creation": {
+                               Type:     schema.TypeBool,
+                               Optional: true,
+                               ForceNew: true,
+                               Description: `If set to true, the request will create a CryptoKey without any CryptoKeyVersions. 
+You must use the 'google_kms_key_ring_import_job' resource to import the CryptoKeyVersion.`,
+                               Default: false,
+                       },
                        "version_template": {
                                Type:        schema.TypeList,
                                Computed:    true,
@@ -160,7 +168,7 @@ func resourceKMSCryptoKeyCreate(d *schema.ResourceData, meta interface{}) error
                return err
        }
 
-       url, err := replaceVars(d, config, "{{KMSBasePath}}{{key_ring}}/cryptoKeys?cryptoKeyId={{name}}")
+       url, err := replaceVars(d, config, "{{KMSBasePath}}{{key_ring}}/cryptoKeys?cryptoKeyId={{name}}&skipInitialVersionCreation={{skip_initial_version_creation}}")
        if err != nil {
                return err
        }
@@ -332,7 +340,7 @@ func resourceKMSCryptoKeyDelete(d *schema.ResourceData, meta interface{}) error
 
        log.Printf(`
 [WARNING] KMS CryptoKey resources cannot be deleted from GCP. The CryptoKey %s will be removed from Terraform state,
-and all its CryptoKeyVersions will be destroyed, but it will still be present on the server.`, cryptoKeyId.cryptoKeyId())
+and all its CryptoKeyVersions will be destroyed, but it will still be present in the project.`, cryptoKeyId.cryptoKeyId())
 
        // Delete all versions of the key
        if err := clearCryptoKeyVersions(cryptoKeyId, config); err != nil {
diff --git a/google-beta/resource_kms_crypto_key_test.go b/google-beta/resource_kms_crypto_key_test.go
index 5e81fcc4..60adaf14 100644
--- a/google-beta/resource_kms_crypto_key_test.go
+++ b/google-beta/resource_kms_crypto_key_test.go
@@ -366,20 +366,20 @@ func testAccCheckGoogleKmsCryptoKeyRotationDisabled(t *testing.T, projectId, loc
 // with undeletable resources
 func testGoogleKmsCryptoKey_basic(projectId, projectOrg, projectBillingAccount, keyRingName, cryptoKeyName string) string {
        return fmt.Sprintf(`
-resource "google_project" "acceptance" {
-  name            = "%s"
-  project_id      = "%s"
-  org_id          = "%s"
-  billing_account = "%s"
-}
-
-resource "google_project_service" "acceptance" {
-  project = google_project.acceptance.project_id
-  service = "cloudkms.googleapis.com"
-}
+// resource "google_project" "acceptance" {
+//   name            = "%s"
+//   project_id      = "%s"
+//   org_id          = "%s"
+//   billing_account = "%s"
+// }
+
+// resource "google_project_service" "acceptance" {
+//   project = google_project.acceptance.project_id
+//   service = "cloudkms.googleapis.com"
+// }
 
 resource "google_kms_key_ring" "key_ring" {
-  project  = google_project_service.acceptance.project
+//   project  = google_project_service.acceptance.project
   name     = "%s"
   location = "us-central1"
 }
@@ -424,20 +424,20 @@ resource "google_kms_crypto_key" "crypto_key" {
 
 func testGoogleKmsCryptoKey_rotationRemoved(projectId, projectOrg, projectBillingAccount, keyRingName, cryptoKeyName string) string {
        return fmt.Sprintf(`
-resource "google_project" "acceptance" {
-  name            = "%s"
-  project_id      = "%s"
-  org_id          = "%s"
-  billing_account = "%s"
-}
-
-resource "google_project_service" "acceptance" {
-  project = google_project.acceptance.project_id
-  service = "cloudkms.googleapis.com"
-}
+// resource "google_project" "acceptance" {
+//   name            = "%s"
+//   project_id      = "%s"
+//   org_id          = "%s"
+//   billing_account = "%s"
+// }
+
+// resource "google_project_service" "acceptance" {
+//   project = google_project.acceptance.project_id
+//   service = "cloudkms.googleapis.com"
+// }
 
 resource "google_kms_key_ring" "key_ring" {
-  project  = google_project_service.acceptance.project
+ // project  = google_project_service.acceptance.project
   name     = "%s"
   location = "us-central1"
 }
(END)

@upodroid
Copy link
Contributor Author

==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta -v -run TestAccKmsCryptoKey_basic -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccKmsCryptoKey_basic
=== PAUSE TestAccKmsCryptoKey_basic
=== CONT  TestAccKmsCryptoKey_basic
2020/09/23 20:38:49 [INFO] Authenticating using DefaultClient...
2020/09/23 20:38:49 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:38:49 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:38:49 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:38:49 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:38:49 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:38:49 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:38:49 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:38:51 [INFO] Authenticating using DefaultClient...
2020/09/23 20:38:51 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:38:51 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:38:51 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:38:51 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:38:51 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:38:51 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:38:51 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:38:51 [DEBUG] Creating new KeyRing: map[string]interface {}(nil)
2020/09/23 20:38:51 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:38:51 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:38:51 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:38:51 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
POST /v1/projects/REDACTED/locations/us-central1/keyRings?alt=json&keyRingId=tf-test-h9oxmupg0y HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Length: 0
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:38:53 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:38:52 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

92
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y",
  "createTime": "2020-09-23T19:38:52.901726732Z"
}

0


-----------------------------------------------------
2020/09/23 20:38:53 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:38:53 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:38:53 [DEBUG] Finished creating KeyRing "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y": map[string]interface {}{"createTime":"2020-09-23T19:38:52.901726732Z", "name":"projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y"}
2020/09/23 20:38:53 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:38:53 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:38:53 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:38:53 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y?alt=json HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:38:53 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:38:53 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

92
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y",
  "createTime": "2020-09-23T19:38:52.901726732Z"
}

0


-----------------------------------------------------
2020/09/23 20:38:53 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:38:53 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:38:53 [DEBUG] setting computed for "version_template" from ComputedKeys
2020/09/23 20:38:53 [DEBUG] Creating new CryptoKey: map[string]interface {}{"labels":map[string]string{"key":"value"}, "purpose":"ENCRYPT_DECRYPT"}
2020/09/23 20:38:53 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:38:53 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:38:53 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:38:53 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
POST /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys?alt=json&cryptoKeyId=tf-test-kn8jhjbrqd&skipInitialVersionCreation=false HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Length: 55
Content-Type: application/json
Accept-Encoding: gzip

{
 "labels": {
  "key": "value"
 },
 "purpose": "ENCRYPT_DECRYPT"
}

-----------------------------------------------------
2020/09/23 20:38:54 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:38:54 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

2dd
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd",
  "primary": {
    "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1",
    "state": "ENABLED",
    "createTime": "2020-09-23T19:38:54.480685524Z",
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
    "generateTime": "2020-09-23T19:38:54.480685524Z"
  },
  "purpose": "ENCRYPT_DECRYPT",
  "createTime": "2020-09-23T19:38:54.480685524Z",
  "labels": {
    "key": "value"
  },
  "versionTemplate": {
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
  }
}

0


-----------------------------------------------------
2020/09/23 20:38:54 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:38:54 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:38:54 [DEBUG] Finished creating CryptoKey "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd": map[string]interface {}{"createTime":"2020-09-23T19:38:54.480685524Z", "labels":map[string]interface {}{"key":"value"}, "name":"projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd", "primary":map[string]interface {}{"algorithm":"GOOGLE_SYMMETRIC_ENCRYPTION", "createTime":"2020-09-23T19:38:54.480685524Z", "generateTime":"2020-09-23T19:38:54.480685524Z", "name":"projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1", "protectionLevel":"SOFTWARE", "state":"ENABLED"}, "purpose":"ENCRYPT_DECRYPT", "versionTemplate":map[string]interface {}{"algorithm":"GOOGLE_SYMMETRIC_ENCRYPTION", "protectionLevel":"SOFTWARE"}}
2020/09/23 20:38:54 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:38:54 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:38:54 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:38:54 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd?alt=json HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:38:55 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:38:55 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

2dd
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd",
  "primary": {
    "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1",
    "state": "ENABLED",
    "createTime": "2020-09-23T19:38:54.480685524Z",
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
    "generateTime": "2020-09-23T19:38:54.480685524Z"
  },
  "purpose": "ENCRYPT_DECRYPT",
  "createTime": "2020-09-23T19:38:54.480685524Z",
  "labels": {
    "key": "value"
  },
  "versionTemplate": {
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
  }
}

0


-----------------------------------------------------
2020/09/23 20:38:55 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:38:55 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:38:58 [INFO] Authenticating using DefaultClient...
2020/09/23 20:38:58 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:38:58 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:38:58 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:38:58 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:38:58 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:38:58 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:38:58 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:39:00 [INFO] Authenticating using DefaultClient...
2020/09/23 20:39:00 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:39:00 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:39:00 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:39:00 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:39:00 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:39:00 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:39:00 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:39:00 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:39:00 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:39:00 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:39:00 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y?alt=json HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:39:01 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:39:01 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

92
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y",
  "createTime": "2020-09-23T19:38:52.901726732Z"
}

0


-----------------------------------------------------
2020/09/23 20:39:01 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:39:01 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:39:01 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:39:01 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:39:01 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:39:01 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd?alt=json HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:39:02 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:39:02 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

2dd
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd",
  "primary": {
    "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1",
    "state": "ENABLED",
    "createTime": "2020-09-23T19:38:54.480685524Z",
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
    "generateTime": "2020-09-23T19:38:54.480685524Z"
  },
  "purpose": "ENCRYPT_DECRYPT",
  "createTime": "2020-09-23T19:38:54.480685524Z",
  "labels": {
    "key": "value"
  },
  "versionTemplate": {
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
  }
}

0


-----------------------------------------------------
2020/09/23 20:39:02 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:39:02 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:39:03 [INFO] Authenticating using DefaultClient...
2020/09/23 20:39:03 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:39:03 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:39:03 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:39:03 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:39:03 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:39:03 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:39:03 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:39:10 [INFO] Authenticating using DefaultClient...
2020/09/23 20:39:10 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:39:10 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:39:10 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:39:10 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:39:10 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:39:10 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:39:10 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:39:10 [DEBUG] Waiting for state to become: [success]
2020/09/23 20:39:10 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:39:10 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:39:10 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd?alt=json HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:39:11 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:39:11 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

2dd
{
  "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd",
  "primary": {
    "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1",
    "state": "ENABLED",
    "createTime": "2020-09-23T19:38:54.480685524Z",
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
    "generateTime": "2020-09-23T19:38:54.480685524Z"
  },
  "purpose": "ENCRYPT_DECRYPT",
  "createTime": "2020-09-23T19:38:54.480685524Z",
  "labels": {
    "key": "value"
  },
  "versionTemplate": {
    "protectionLevel": "SOFTWARE",
    "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
  }
}

0


-----------------------------------------------------
2020/09/23 20:39:11 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:39:11 [DEBUG] Retry Transport: Returning after 1 attempts
    TestAccKmsCryptoKey_basic: provider_test.go:268: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=1) {
         (string) (len=29) "skip_initial_version_creation": (string) (len=5) "false"
        }
2020/09/23 20:39:15 [INFO] Authenticating using DefaultClient...
2020/09/23 20:39:15 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2020/09/23 20:39:15 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/beta/projects/
2020/09/23 20:39:15 [INFO] Instantiating GCE Beta client for path https://www.googleapis.com/compute/beta/projects/
2020/09/23 20:39:15 [INFO] Instantiating GKE client for path https://container.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating GKE Beta client for path https://container.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud DNS client for path https://dns.googleapis.com
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud DNS Beta client for path https://www.googleapis.com
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Stackdriver Logging client for path https://logging.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2020/09/23 20:39:15 [INFO] Instantiating Google SqlAdmin client for path https://sqladmin.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Pubsub client for path https://pubsub.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Dataflow client for path https://dataflow.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud ResourceManager V client for path https://cloudresourcemanager.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Runtimeconfig client for path https://runtimeconfig.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud IAM client for path https://iam.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud IAMCredentials client for path https://iamcredentials.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Service Management client for path https://servicemanagement.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Service Usage client for path https://serviceusage.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Build client for path https://cloudbuild.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud BigQuery client for path https://bigquery.googleapis.com/bigquery/v2/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud CloudFunctions Client for path https://cloudfunctions.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud BigtableAdmin for path https://bigtableadmin.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Source Repo client for path https://sourcerepo.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Spanner client for path https://spanner.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Dataproc client for path https://dataproc.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Dataproc Beta client for path https://dataproc.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Filestore client for path https://file.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud IoT Core client for path 
2020/09/23 20:39:15 [INFO] Instantiating App Engine client for path https://appengine.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Cloud Composer client for path https://composer.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Service Networking client for path https://servicenetworking.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud Healthcare client for path https://healthcare.googleapis.com/
2020/09/23 20:39:15 [INFO] Instantiating Google Cloud CloudIdentity client for path https://cloudidentity.googleapis.com/
2020/09/23 20:39:15 
[WARNING] KMS CryptoKey resources cannot be deleted from GCP. The CryptoKey projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd will be removed from Terraform state,
and all its CryptoKeyVersions will be destroyed, but it will still be present in the project.
2020/09/23 20:39:15 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:39:15 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:39:15 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions?alt=json&prettyPrint=false HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
X-Goog-Api-Client: gl-go/1.14.4 gdcl/20200911
Accept-Encoding: gzip


-----------------------------------------------------
2020/09/23 20:39:16 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:39:16 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

169
{
 "cryptoKeyVersions": [
  {
   "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1",
   "state": "ENABLED",
   "createTime": "2020-09-23T19:38:54.480685524Z",
   "protectionLevel": "SOFTWARE",
   "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
   "generateTime": "2020-09-23T19:38:54.480685524Z"
  }
 ],
 "totalSize": 1
}
0


-----------------------------------------------------
2020/09/23 20:39:16 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:39:16 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:39:16 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020/09/23 20:39:16 [DEBUG] Retry Transport: request attempt 0
2020/09/23 20:39:16 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
POST /v1/projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1:destroy?alt=json&prettyPrint=false HTTP/1.1
Host: cloudkms.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.12.29 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Length: 3
Content-Type: application/json
X-Goog-Api-Client: gl-go/1.14.4 gdcl/20200911
Accept-Encoding: gzip

{}

-----------------------------------------------------
2020/09/23 20:39:17 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 23 Sep 2020 19:39:17 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

179
{
 "name": "projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y/cryptoKeys/tf-test-kn8jhjbrqd/cryptoKeyVersions/1",
 "state": "DESTROY_SCHEDULED",
 "createTime": "2020-09-23T19:38:54.480685524Z",
 "destroyTime": "2020-09-24T19:39:17.154907Z",
 "protectionLevel": "SOFTWARE",
 "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
 "generateTime": "2020-09-23T19:38:54.480685524Z"
}
0


-----------------------------------------------------
2020/09/23 20:39:17 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository.
2020/09/23 20:39:17 [DEBUG] Retry Transport: Returning after 1 attempts
2020/09/23 20:39:17 [WARNING] KMS KeyRing resources cannot be deleted from GCP. The resource projects/REDACTED/locations/us-central1/keyRings/tf-test-h9oxmupg0y will be removed from Terraform state, but will still be present on the server.
--- FAIL: TestAccKmsCryptoKey_basic (36.96s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-google-beta/google-beta	42.488s
FAIL

products/kms/api.yaml Outdated Show resolved Hide resolved
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 11 files changed, 38 insertions(+), 19 deletions(-))
Terraform Beta: Diff ( 14 files changed, 44 insertions(+), 25 deletions(-))
Ansible: Diff ( 2 files changed, 23 insertions(+), 1 deletion(-))
Inspec: Diff ( 4 files changed, 7 insertions(+))

@nat-henderson
Copy link
Contributor

Okay, just one more problem:

------- Stdout: -------
=== RUN   TestAccKmsCryptoKey_basic
=== PAUSE TestAccKmsCryptoKey_basic
=== CONT  TestAccKmsCryptoKey_basic
TestAccKmsCryptoKey_basic: provider_test.go:267: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) {
}
(map[string]string) (len=1) {
(string) (len=29) "skip_initial_version_creation": (string) (len=5) "false"
}
--- FAIL: TestAccKmsCryptoKey_basic (79.35s)
FAIL

Same issue in TestAccKmsCryptoKey_template and TestAccKmsCryptoKey_rotation.

@upodroid
Copy link
Contributor Author

It is fixed now

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 11 files changed, 42 insertions(+), 19 deletions(-))
Terraform Beta: Diff ( 14 files changed, 48 insertions(+), 25 deletions(-))
Ansible: Diff ( 2 files changed, 23 insertions(+), 1 deletion(-))
Inspec: Diff ( 4 files changed, 7 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 11 files changed, 42 insertions(+), 19 deletions(-))
Terraform Beta: Diff ( 14 files changed, 48 insertions(+), 25 deletions(-))
Ansible: Diff ( 2 files changed, 23 insertions(+), 1 deletion(-))
Inspec: Diff ( 4 files changed, 7 insertions(+))

@nat-henderson
Copy link
Contributor

The tests are still failing for me. Are they working for you?

------- Stdout: -------
=== RUN   TestAccKmsCryptoKeyIamPolicy_withCondition
=== PAUSE TestAccKmsCryptoKeyIamPolicy_withCondition
=== CONT  TestAccKmsCryptoKeyIamPolicy_withCondition
TestAccKmsCryptoKeyIamPolicy_withCondition: provider_test.go:266: Step 2/2 error running import: 2020/10/26 23:56:35 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0
Error: Cannot import non-existent remote object
While attempting to import an existing object to
google_kms_crypto_key_iam_policy.foo, the provider detected that no object
exists with the given id. Only pre-existing objects can be imported; check
that the id is correct and that it is associated with the provider's
configured region or endpoint, or use "terraform apply" to create a new remote
object for this resource.
TestAccKmsCryptoKeyIamPolicy_withCondition: testing_new.go:22: WARNING: destroy failed, so remote objects may still exist and be subject to billing
TestAccKmsCryptoKeyIamPolicy_withCondition: testing_new.go:22: failed to destroy: 2020/10/26 23:56:38 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0
Error: Error setting IAM policy for KMS CryptoKey "projects/tf-test-1875581241416289889/locations/us-central1/keyRings/tf-test-uuynesj7w2/cryptoKeys/tf-test-db9vbslx10": googleapi: Error 404: Project 'tf-test-1875581241416289889' not found., notFound
--- FAIL: TestAccKmsCryptoKeyIamPolicy_withCondition (103.10s)
FAIL

@upodroid
Copy link
Contributor Author

Hmm, I ran the TestAccKmsCryptoKey_basic test. I'll run that one now and see what the error is.

@upodroid
Copy link
Contributor Author

Works fine.

 REDACTED  MCW0CDP3YY  ~  go  …  github.com  hashicorp  terraform-provider-google-beta   master  100⬇  592✎  46+  $    make testacc TEST=./google-beta TESTARGS="-run TestAccKmsCryptoKeyIamPolicy_withCondition"
==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta -v -run TestAccKmsCryptoKeyIamPolicy_withCondition -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccKmsCryptoKeyIamPolicy_withCondition
=== PAUSE TestAccKmsCryptoKeyIamPolicy_withCondition
=== CONT  TestAccKmsCryptoKeyIamPolicy_withCondition
--- PASS: TestAccKmsCryptoKeyIamPolicy_withCondition (170.92s)
PASS
ok      github.com/hashicorp/terraform-provider-google-beta/google-beta 173.015s

@upodroid
Copy link
Contributor Author

I bumped the api client in another PR which is breaking things.

 REDACTED  MCW0CDP3YY  ~  go  …  github.com  hashicorp  terraform-provider-google-beta   master  100⬇  592✎  46+  USAGE  $    make testacc TEST=./google-beta TESTARGS="-run TestAccKmsCryptoKeyIamPolicy_withCondition"
==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta -v -run TestAccKmsCryptoKeyIamPolicy_withCondition -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
# github.com/hashicorp/terraform-provider-google-beta/google-beta [github.com/hashicorp/terraform-provider-google-beta/google-beta.test]
google-beta/resource_storage_transfer_job.go:430:73: not enough arguments in call to config.NewStorageTransferClient(userAgent).TransferJobs.Get
        have (string)
        want (string, string)
google-beta/resource_storage_transfer_job.go:430:79: config.NewStorageTransferClient(userAgent).TransferJobs.Get(name).ProjectId undefined (type *storagetransfer.TransferJobsGetCall has no field or method ProjectId)
google-beta/resource_storage_transfer_job_test.go:106:82: not enough arguments in call to config.NewStorageTransferClient(config.userAgent).TransferJobs.Get
        have (string)
        want (string, string)
google-beta/resource_storage_transfer_job_test.go:106:88: config.NewStorageTransferClient(config.userAgent).TransferJobs.Get(name).ProjectId undefined (type *storagetransfer.TransferJobsGetCall has no field or method ProjectId)
FAIL    github.com/hashicorp/terraform-provider-google-beta/google-beta [build failed]
FAIL
make: *** [testacc] Error 2

@nat-henderson
Copy link
Contributor

Are you running the tests in the beta provider, or the GA one? I am using the beta provider.

@upodroid
Copy link
Contributor Author

Beta provider

@upodroid
Copy link
Contributor Author

@nat-henderson
Copy link
Contributor

Hm, that's very odd. I'll rerun generation and see what happens.

@nat-henderson
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=154637"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 11 files changed, 42 insertions(+), 19 deletions(-))
Terraform Beta: Diff ( 14 files changed, 48 insertions(+), 25 deletions(-))
Ansible: Diff ( 2 files changed, 23 insertions(+), 1 deletion(-))
Inspec: Diff ( 4 files changed, 7 insertions(+))

@nat-henderson
Copy link
Contributor

Yep, passed for me this time! Okay, merging.

@nat-henderson nat-henderson merged commit 0b4fd20 into GoogleCloudPlatform:master Oct 27, 2020
@upodroid
Copy link
Contributor Author

Cool

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSpannerInstance_basic|TestAccBigQueryJob_bigqueryJobCopyExample|TestAccBigQueryJob_bigqueryJobCopyTableReferenceExample|TestAccBigqueryDataTransferConfig|TestAccCloudAssetFolderFeed_cloudAssetFolderFeedExample|TestAccCloudAssetProjectFeed_cloudAssetProjectFeedExample|TestAccCloudAssetOrganizationFeed_cloudAssetOrganizationFeedExample|TestAccComputeInstanceFromTemplate_overrideScratchDisk|TestAccComputeInstanceFromTemplate_overrideAttachedDisk|TestAccComputeInstanceFromTemplate_basic|TestAccComputeInstanceFromTemplate_overrideBootDisk|TestAccComputeInstanceFromTemplate_012_removableFields|TestAccComputeInstanceFromTemplate_overrideMetadataDotStartupScript|TestAccKmsCryptoKey_basic|TestAccKmsCryptoKeyIamBinding|TestAccKmsCryptoKey_template|TestAccKmsCryptoKeyIamMember|TestAccKmsCryptoKeyIamBinding_withCondition|TestAccKmsCryptoKeyIamMember_withCondition|TestAccKmsCryptoKeyIamPolicy|TestAccKmsCryptoKeyIamPolicy_withCondition You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=154643"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add skipInitialVersionCreation to KMS crypto key
3 participants