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

Adding Labels to google_kms_crypto_key Indirectly Forces Replacement via skip_initial_version_creation #8947

Assignees
Labels

Comments

@byronmccollum
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.14.3
+ provider registry.terraform.io/hashicorp/google v3.64.0

Affected Resource(s)

  • google_kms_crypto_key

Terraform Configuration Files

Before Config Change

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  lifecycle {
    prevent_destroy = false
  }
}

After Config Change (Labels Added)

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  lifecycle {
    prevent_destroy = false
  }

  labels = {
  	foo = "bar"
  }
}

Expected Behavior

Labels get added to crypto key.

Actual Behavior

When labels are added, the attribute skip_initial_version_creation also gets added, which forces replacement of the resource.

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key must be replaced
-/+ resource "google_kms_crypto_key" "my_crypto_key" {
      ~ id                            = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key" -> (known after apply)
      ~ labels                        = {
          + "foo" = "bar"
        }
        name                          = "my-crypto-key"
      ~ self_link                     = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key" -> (known after apply)
      + skip_initial_version_creation = false # forces replacement
        # (3 unchanged attributes hidden)

      ~ version_template {
          ~ algorithm        = "GOOGLE_SYMMETRIC_ENCRYPTION" -> (known after apply)
          ~ protection_level = "SOFTWARE" -> (known after apply)
        }
    }
@edwardmedia edwardmedia self-assigned this Apr 19, 2021
@edwardmedia
Copy link
Contributor

@byronmccollum I can't repro it. Can you share your debug log?

@byronmccollum
Copy link
Author

byronmccollum commented Apr 20, 2021

I can work on getting a debug log, but in the mean time, you might want to try creating the key ring and crypto key with a provider version prior to the introduction of skip_initial_version_creation. Then try adding labels using the latest provider version.

@ghost ghost removed the waiting-response label Apr 20, 2021
@edwardmedia
Copy link
Contributor

@byronmccollum skip_initial_version_creation is optional. Shouldn't cause diff here. I need steps to repro this

@byronmccollum
Copy link
Author

You are correct, it is optional, but it also has Default: false. Resources created prior to the addition of skip_initial_version_creation will not have anything defined for it in the state. Then using the latest provider version will attempt to set skip_initial_version_creation: false, which causes the "forces replacement" plan because ForceNew: true is set.

@ghost ghost removed the waiting-response label Apr 21, 2021
@byronmccollum
Copy link
Author

byronmccollum commented Apr 21, 2021

I'm currently working on a reduction for reproducing it.

@byronmccollum
Copy link
Author

Use Google Provider < 3.46.0

# main.tf
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "< 3.46.0"
    }
  }
}

provider "google" {
  region  = "us-central1"
  project = "my-project"
}

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  lifecycle {
    prevent_destroy = false
  }
}

Init, Plan, and Apply Changes

$ terraform init

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/google versions matching "< 3.46.0"...
- Installing hashicorp/google v3.45.0...
- Installed hashicorp/google v3.45.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform plan

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key will be created
  + resource "google_kms_crypto_key" "my_crypto_key" {
      + id              = (known after apply)
      + key_ring        = (known after apply)
      + name            = "my-crypto-key"
      + purpose         = "ENCRYPT_DECRYPT"
      + rotation_period = "7776000s"
      + self_link       = (known after apply)

      + version_template {
          + algorithm        = (known after apply)
          + protection_level = (known after apply)
        }
    }

  # google_kms_key_ring.my_key_ring will be created
  + resource "google_kms_key_ring" "my_key_ring" {
      + id        = (known after apply)
      + location  = "us-central1"
      + name      = "my-key-ring"
      + project   = (known after apply)
      + self_link = (known after apply)
    }

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
$ terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key will be created
  + resource "google_kms_crypto_key" "my_crypto_key" {
      + id              = (known after apply)
      + key_ring        = (known after apply)
      + name            = "my-crypto-key"
      + purpose         = "ENCRYPT_DECRYPT"
      + rotation_period = "7776000s"
      + self_link       = (known after apply)

      + version_template {
          + algorithm        = (known after apply)
          + protection_level = (known after apply)
        }
    }

  # google_kms_key_ring.my_key_ring will be created
  + resource "google_kms_key_ring" "my_key_ring" {
      + id        = (known after apply)
      + location  = "us-central1"
      + name      = "my-key-ring"
      + project   = (known after apply)
      + self_link = (known after apply)
    }

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

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

google_kms_key_ring.my_key_ring: Creating...
google_kms_key_ring.my_key_ring: Creation complete after 0s [id=projects/my-project/locations/us-central1/keyRings/my-key-ring]
google_kms_crypto_key.my_crypto_key: Creating...
google_kms_crypto_key.my_crypto_key: Creation complete after 0s [id=projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key]

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

Inspect State

$ terraform state show google_kms_crypto_key.my_crypto_key
# google_kms_crypto_key.my_crypto_key:
resource "google_kms_crypto_key" "my_crypto_key" {
    id              = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key"
    key_ring        = "projects/my-project/locations/us-central1/keyRings/my-key-ring"
    name            = "my-crypto-key"
    purpose         = "ENCRYPT_DECRYPT"
    rotation_period = "7776000s"
    self_link       = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key"

    version_template {
        algorithm        = "GOOGLE_SYMMETRIC_ENCRYPTION"
        protection_level = "SOFTWARE"
    }
}

Update Google Provider = 3.46.0

# main.tf
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "= 3.46.0"
    }
  }
}

provider "google" {
  region  = "us-central1"
  project = "my-project"
}

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  lifecycle {
    prevent_destroy = false
  }
}

Init and Plan Changes

$ terraform init

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/google versions matching "3.46.0"...
- Installing hashicorp/google v3.46.0...
- Installed hashicorp/google v3.46.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform plan
google_kms_key_ring.my_key_ring: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring]
google_kms_crypto_key.my_crypto_key: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key]

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.

Add Labels to Crypto Key

# main.tf
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "= 3.46.0"
    }
  }
}

provider "google" {
  region  = "us-central1"
  project = "my-project"
}

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  labels = {
    foo = "bar"
  }

  lifecycle {
    prevent_destroy = false
  }
}

Plan Changes

$ terraform plan
google_kms_key_ring.my_key_ring: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring]
google_kms_crypto_key.my_crypto_key: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key must be replaced
-/+ resource "google_kms_crypto_key" "my_crypto_key" {
      ~ id                            = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key" -> (known after apply)
      ~ labels                        = {
          + "foo" = "bar"
        }
        name                          = "my-crypto-key"
      ~ self_link                     = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key" -> (known after apply)
      + skip_initial_version_creation = false # forces replacement
        # (3 unchanged attributes hidden)

      ~ version_template {
          ~ algorithm        = "GOOGLE_SYMMETRIC_ENCRYPTION" -> (known after apply)
          ~ protection_level = "SOFTWARE" -> (known after apply)
        }
    }

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

@billyfoss
Copy link

We are seeing this but not consistently. We have shared VPC projects with multiple GKE clusters that are encrypting application secrets with KMS keys. It is odd that of 5 projects with GKE clusters and Cloud KMS keys, 3 of them see the issue, but the other 2 have a plan where the skip_initial_version_creation is already seen as false.
Each of these projects are built using the same level of code.

One thing I can see different between the projects is that the ones that fail have 1 or 2 keyrings. The ones that pass have 3 keyrings in the project. The ones that pass were also created in January 2021, but the other 3 failing cases were created prior to 2021.

@billyfoss
Copy link

I figured out by the timing that the working clusters were created after skip_initial_version_creation was included in 3.46.0.

@edwardmedia
Copy link
Contributor

@byronmccollum I tested by starting v3.44.0 and then upgrading to v3.46.0, still couldn't repro it. I don't see that field in the api response, and not sure why this could be an issue. Do you mind sharing the debug log that should include all the requests & responses?

@byronmccollum
Copy link
Author

Thanks @billyfoss for the additional confirmation of what you're seeing.

@ghost ghost removed waiting-response labels Apr 22, 2021
@byronmccollum
Copy link
Author

@edwardmedia The above with debug logs...

Use Google Provider < 3.46.0

# main.tf
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "< 3.46.0"
    }
  }
}

provider "google" {
  region  = "us-central1"
  project = "my-project"
}

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  lifecycle {
    prevent_destroy = false
  }
}

Init, Plan, and Apply Changes

$ terraform init

2021/04/21 16:05:17 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:05:17 [INFO] Terraform version: 0.14.3  
2021/04/21 16:05:17 [INFO] Go runtime version: go1.15.2
2021/04/21 16:05:17 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "init"}
2021/04/21 16:05:17 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:05:17 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:05:17 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:05:17 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:05:17 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:05:17 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:05:17 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:05:17 [INFO] CLI command args: []string{"init"}
2021/04/21 16:05:17 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----

Initializing the backend...
2021/04/21 16:05:17 [DEBUG] New state was assigned lineage "686122b2-81e2-a43d-1f98-38b12b89c7c5"
2021/04/21 16:05:17 [DEBUG] checking for provisioner in "."
2021/04/21 16:05:17 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:05:17 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory

2021/04/21 16:05:17 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
Initializing provider plugins...
- Finding hashicorp/google versions matching "< 3.46.0"...
2021/04/21 16:05:17 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:05:17 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/google/versions
2021/04/21 16:05:17 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:05:17 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/google/3.45.0/download/linux/amd64
2021/04/21 16:05:17 [DEBUG] GET https://releases.hashicorp.com/terraform-provider-google/3.45.0/terraform-provider-google_3.45.0_SHA256SUMS
2021/04/21 16:05:17 [DEBUG] GET https://releases.hashicorp.com/terraform-provider-google/3.45.0/terraform-provider-google_3.45.0_SHA256SUMS.sig
- Installing hashicorp/google v3.45.0...
2021/04/21 16:05:18 [DEBUG] Provider signed by 51852D87348FFC4C HashiCorp Security <[email protected]>
- Installed hashicorp/google v3.45.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform plan

2021/04/21 16:05:46 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:05:46 [INFO] Terraform version: 0.14.3  
2021/04/21 16:05:46 [INFO] Go runtime version: go1.15.2
2021/04/21 16:05:46 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "plan"}
2021/04/21 16:05:46 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:05:46 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:05:46 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:05:46 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:05:46 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:05:46 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:05:46 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:05:46 [INFO] CLI command args: []string{"plan"}
2021/04/21 16:05:46 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:05:46 [DEBUG] New state was assigned lineage "0807ddf3-9574-2623-e4f0-eb16186ccb09"
2021/04/21 16:05:46 [DEBUG] checking for provisioner in "."
2021/04/21 16:05:46 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:05:46 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2021/04/21 16:05:46 [INFO] backend/local: starting Plan operation
2021-04-21T16:05:46.919Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:05:46.963Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:05:46.965Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=475
2021-04-21T16:05:46.965Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:05:46.996Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:05:46.996Z
2021-04-21T16:05:47.039Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:05:47.039Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin891974482 network=unix timestamp=2021-04-21T16:05:47.039Z
2021-04-21T16:05:47.221Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:05:47.226Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=475
2021-04-21T16:05:47.226Z [DEBUG] plugin: plugin exited
2021/04/21 16:05:47 [INFO] terraform: building graph: GraphTypeValidate
2021/04/21 16:05:47 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:05:47 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: [google_kms_key_ring.my_key_ring]
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:05:47 [DEBUG] Starting graph walk: walkValidate
2021-04-21T16:05:47.231Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:05:47.266Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:05:47.269Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=486
2021-04-21T16:05:47.269Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:05:47.309Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:05:47.309Z
2021-04-21T16:05:47.348Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:05:47.348Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: network=unix address=/tmp/plugin062285185 timestamp=2021-04-21T16:05:47.348Z
2021-04-21T16:05:47.570Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:05:47.577Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=486
2021-04-21T16:05:47.577Z [DEBUG] plugin: plugin exited
2021/04/21 16:05:47 [INFO] backend/local: plan calling Plan
2021/04/21 16:05:47 [INFO] terraform: building graph: GraphTypePlan
2021/04/21 16:05:47 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:05:47 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring (expand)" references: []
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key (expand)" references: [google_kms_key_ring.my_key_ring (expand)]
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:05:47 [DEBUG] Starting graph walk: walkPlan
2021-04-21T16:05:47.581Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:05:47.618Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:05:47.620Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=497
2021-04-21T16:05:47.620Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:05:47.709Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:05:47.709Z
2021-04-21T16:05:47.754Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:05:47.754Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin633450804 network=unix timestamp=2021-04-21T16:05:47.753Z
2021-04-21T16:05:47.928Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:05:47 [INFO] Authenticating using DefaultClient...
2021-04-21T16:05:47.928Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:05:47 [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]
2021/04/21 16:05:47 [DEBUG] Resource instance state not found for node "google_kms_key_ring.my_key_ring", instance google_kms_key_ring.my_key_ring
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:05:47 [DEBUG] refresh: google_kms_key_ring.my_key_ring: no state, so not refreshing
2021/04/21 16:05:47 [DEBUG] Resource instance state not found for node "google_kms_crypto_key.my_crypto_key", instance google_kms_crypto_key.my_crypto_key
2021/04/21 16:05:47 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: []
2021/04/21 16:05:47 [DEBUG] refresh: google_kms_crypto_key.my_crypto_key: no state, so not refreshing
2021/04/21 16:05:47 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_kms_crypto_key.my_crypto_key, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .purpose: planned value cty.StringVal("ENCRYPT_DECRYPT") does not match config value cty.NullVal(cty.String)
      - .version_template: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead
2021-04-21T16:05:47.949Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:05:47.954Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=497
2021-04-21T16:05:47.954Z [DEBUG] plugin: plugin exited
2021/04/21 16:05:47 [INFO] backend/local: plan operation completed

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key will be created
  + resource "google_kms_crypto_key" "my_crypto_key" {
      + id              = (known after apply)
      + key_ring        = (known after apply)
      + name            = "my-crypto-key"
      + purpose         = "ENCRYPT_DECRYPT"
      + rotation_period = "7776000s"
      + self_link       = (known after apply)

      + version_template {
          + algorithm        = (known after apply)
          + protection_level = (known after apply)
        }
    }

  # google_kms_key_ring.my_key_ring will be created
  + resource "google_kms_key_ring" "my_key_ring" {
      + id        = (known after apply)
      + location  = "us-central1"
      + name      = "my-key-ring"
      + project   = (known after apply)
      + self_link = (known after apply)
    }

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
$ terraform apply

2021/04/21 16:06:53 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:06:53 [INFO] Terraform version: 0.14.3  
2021/04/21 16:06:53 [INFO] Go runtime version: go1.15.2
2021/04/21 16:06:53 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "apply"}
2021/04/21 16:06:53 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:06:53 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:06:53 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:06:53 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:06:53 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:06:53 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:06:53 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:06:53 [INFO] CLI command args: []string{"apply"}
2021/04/21 16:06:53 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:06:53 [DEBUG] New state was assigned lineage "2cffc4fb-74df-3f28-4500-ccaf84e0e212"
2021/04/21 16:06:53 [DEBUG] checking for provisioner in "."
2021/04/21 16:06:53 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:06:53 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2021/04/21 16:06:53 [INFO] backend/local: starting Apply operation
2021-04-21T16:06:53.534Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:06:53.577Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:06:53.581Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=550
2021-04-21T16:06:53.581Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:06:53.614Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:06:53.614Z
2021-04-21T16:06:53.659Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin584412209 network=unix timestamp=2021-04-21T16:06:53.659Z
2021-04-21T16:06:53.660Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:06:53.847Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:06:53.852Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=550
2021-04-21T16:06:53.852Z [DEBUG] plugin: plugin exited
2021/04/21 16:06:53 [INFO] terraform: building graph: GraphTypeValidate
2021/04/21 16:06:53 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:06:53 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:06:53 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:06:53 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: [google_kms_key_ring.my_key_ring]
2021/04/21 16:06:53 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:06:53 [DEBUG] Starting graph walk: walkValidate
2021-04-21T16:06:53.861Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:06:53.897Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:06:53.900Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=561
2021-04-21T16:06:53.900Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:06:53.948Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:06:53.947Z
2021-04-21T16:06:53.989Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin478224980 network=unix timestamp=2021-04-21T16:06:53.989Z
2021-04-21T16:06:53.989Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:06:54.218Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:06:54.224Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=561
2021-04-21T16:06:54.224Z [DEBUG] plugin: plugin exited
2021/04/21 16:06:54 [INFO] backend/local: apply calling Plan
2021/04/21 16:06:54 [INFO] terraform: building graph: GraphTypePlan
2021/04/21 16:06:54 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:06:54 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:06:54 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring (expand)" references: []
2021/04/21 16:06:54 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key (expand)" references: [google_kms_key_ring.my_key_ring (expand)]
2021/04/21 16:06:54 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:06:54 [DEBUG] Starting graph walk: walkPlan
2021-04-21T16:06:54.230Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:06:54.270Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:06:54.272Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=572
2021-04-21T16:06:54.272Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:06:54.310Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:06:54.310Z
2021-04-21T16:06:54.349Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:06:54.349Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin548513327 network=unix timestamp=2021-04-21T16:06:54.348Z
2021-04-21T16:06:54.524Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:06:54 [INFO] Authenticating using DefaultClient...
2021-04-21T16:06:54.524Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:06:54 [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]
2021/04/21 16:06:54 [DEBUG] Resource instance state not found for node "google_kms_key_ring.my_key_ring", instance google_kms_key_ring.my_key_ring
2021/04/21 16:06:54 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:06:54 [DEBUG] refresh: google_kms_key_ring.my_key_ring: no state, so not refreshing
2021/04/21 16:06:54 [DEBUG] Resource instance state not found for node "google_kms_crypto_key.my_crypto_key", instance google_kms_crypto_key.my_crypto_key
2021/04/21 16:06:54 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: []
2021/04/21 16:06:54 [DEBUG] refresh: google_kms_crypto_key.my_crypto_key: no state, so not refreshing
2021/04/21 16:06:54 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_kms_crypto_key.my_crypto_key, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .purpose: planned value cty.StringVal("ENCRYPT_DECRYPT") does not match config value cty.NullVal(cty.String)
      - .version_template: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead
2021-04-21T16:06:54.555Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:06:54.561Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=572
2021-04-21T16:06:54.562Z [DEBUG] plugin: plugin exited

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

2021/04/21 16:06:54 [DEBUG] command: asking for input: "Do you want to perform these actions?"
Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key will be created
  + resource "google_kms_crypto_key" "my_crypto_key" {
      + id              = (known after apply)
      + key_ring        = (known after apply)
      + name            = "my-crypto-key"
      + purpose         = "ENCRYPT_DECRYPT"
      + rotation_period = "7776000s"
      + self_link       = (known after apply)

      + version_template {
          + algorithm        = (known after apply)
          + protection_level = (known after apply)
        }
    }

  # google_kms_key_ring.my_key_ring will be created
  + resource "google_kms_key_ring" "my_key_ring" {
      + id        = (known after apply)
      + location  = "us-central1"
      + name      = "my-key-ring"
      + project   = (known after apply)
      + self_link = (known after apply)
    }

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

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

2021/04/21 16:07:18 [INFO] backend/local: apply calling Apply
2021/04/21 16:07:18 [INFO] terraform: building graph: GraphTypeApply
2021/04/21 16:07:18 [DEBUG] Resource state not found for node "google_kms_crypto_key.my_crypto_key", instance google_kms_crypto_key.my_crypto_key
2021/04/21 16:07:18 [DEBUG] Resource state not found for node "google_kms_key_ring.my_key_ring", instance google_kms_key_ring.my_key_ring
2021/04/21 16:07:18 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:07:18 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:07:18 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:07:18 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:07:18 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key (expand)" references: []
2021/04/21 16:07:18 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:07:18 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: [google_kms_key_ring.my_key_ring google_kms_key_ring.my_key_ring google_kms_key_ring.my_key_ring (expand)]
2021/04/21 16:07:18 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:07:18 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring (expand)" references: []
2021/04/21 16:07:18 [DEBUG] Starting graph walk: walkApply
2021-04-21T16:07:18.253Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:07:18.291Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:07:18.294Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=583
2021-04-21T16:07:18.294Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:07:18.333Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:07:18.332Z
2021-04-21T16:07:18.373Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin882476006 network=unix timestamp=2021-04-21T16:07:18.373Z
2021-04-21T16:07:18.374Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:07:18.542Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [INFO] Authenticating using DefaultClient...
2021-04-21T16:07:18.542Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [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]
2021/04/21 16:07:18 [DEBUG] EvalApply: ProviderMeta config value set
2021/04/21 16:07:18 [DEBUG] google_kms_key_ring.my_key_ring: applying the planned Create change
google_kms_key_ring.my_key_ring: Creating...
2021-04-21T16:07:18.564Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [DEBUG] Creating new KeyRing: map[string]interface {}(nil)
2021-04-21T16:07:18.564Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:07:18.566Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:07:18.566Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:07:18.566Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:18 [DEBUG] Google API Request Details:
2021-04-21T16:07:18.566Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:07:18.567Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: POST /v1/projects/my-project/locations/us-central1/keyRings?alt=json&keyRingId=my-key-ring HTTP/1.1
2021-04-21T16:07:18.567Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:07:18.567Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.45.0
2021-04-21T16:07:18.568Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Length: 0
2021-04-21T16:07:18.568Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json
2021-04-21T16:07:18.568Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Accept-Encoding: gzip
2021-04-21T16:07:18.568Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:18.568Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:18.568Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:19.206Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Google API Response Details:
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: HTTP/1.1 200 OK
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Connection: close
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Transfer-Encoding: chunked
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Cache-Control: private
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Date: Wed, 21 Apr 2021 16:07:19 GMT
2021-04-21T16:07:19.207Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Server: ESF
2021-04-21T16:07:19.208Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Origin
2021-04-21T16:07:19.209Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: X-Origin
2021-04-21T16:07:19.209Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Referer
2021-04-21T16:07:19.210Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:07:19.213Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:07:19.213Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Xss-Protection: 0
2021-04-21T16:07:19.213Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.213Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 82
2021-04-21T16:07:19.213Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: {
2021-04-21T16:07:19.213Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring",
2021-04-21T16:07:19.214Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "createTime": "2021-04-21T16:07:19.133608453Z"
2021-04-21T16:07:19.214Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: }
2021-04-21T16:07:19.214Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.214Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 0
2021-04-21T16:07:19.214Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.214Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.215Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:19.215Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:07:19.215Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: Returning after 1 attempts
2021-04-21T16:07:19.215Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Finished creating KeyRing "projects/my-project/locations/us-central1/keyRings/my-key-ring": map[string]interface {}{"createTime":"2021-04-21T16:07:19.133608453Z", "name":"projects/my-project/locations/us-central1/keyRings/my-key-ring"}
2021-04-21T16:07:19.215Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:07:19.215Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:07:19.216Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:07:19.216Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Google API Request Details:
2021-04-21T16:07:19.216Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:07:19.216Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: GET /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring?alt=json HTTP/1.1
2021-04-21T16:07:19.216Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:07:19.217Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.45.0
2021-04-21T16:07:19.217Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json
2021-04-21T16:07:19.217Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Accept-Encoding: gzip
2021-04-21T16:07:19.217Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.217Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.217Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:19.476Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Google API Response Details:
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: HTTP/1.1 200 OK
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Connection: close
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Transfer-Encoding: chunked
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Cache-Control: private
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Date: Wed, 21 Apr 2021 16:07:19 GMT
2021-04-21T16:07:19.477Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Server: ESF
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Origin
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: X-Origin
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Referer
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Xss-Protection: 0
2021-04-21T16:07:19.478Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.479Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 82
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: {
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring",
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "createTime": "2021-04-21T16:07:19.133608453Z"
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: }
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 0
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.480Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:19.481Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:07:19.481Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: Returning after 1 attempts
google_kms_key_ring.my_key_ring: Creation complete after 0s [id=projects/my-project/locations/us-central1/keyRings/my-key-ring]
2021/04/21 16:07:19 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_kms_crypto_key.my_crypto_key, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .purpose: planned value cty.StringVal("ENCRYPT_DECRYPT") does not match config value cty.NullVal(cty.String)
      - .version_template: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead
google_kms_crypto_key.my_crypto_key: Creating...
2021/04/21 16:07:19 [DEBUG] EvalApply: ProviderMeta config value set
2021/04/21 16:07:19 [DEBUG] google_kms_crypto_key.my_crypto_key: applying the planned Create change
2021-04-21T16:07:19.510Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] setting computed for "version_template" from ComputedKeys
2021-04-21T16:07:19.510Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Creating new CryptoKey: map[string]interface {}{"nextRotationTime":"2021-07-20T16:07:19.5107176Z", "purpose":"ENCRYPT_DECRYPT", "rotationPeriod":"7776000s"}
2021-04-21T16:07:19.510Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Google API Request Details:
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: POST /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys?alt=json&cryptoKeyId=my-crypto-key HTTP/1.1
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.45.0
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Length: 108
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Accept-Encoding: gzip
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.511Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: {
2021-04-21T16:07:19.512Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:  "nextRotationTime": "2021-07-20T16:07:19.5107176Z",
2021-04-21T16:07:19.512Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:  "purpose": "ENCRYPT_DECRYPT",
2021-04-21T16:07:19.512Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:  "rotationPeriod": "7776000s"
2021-04-21T16:07:19.512Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: }
2021-04-21T16:07:19.512Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.512Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Google API Response Details:
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: HTTP/1.1 200 OK
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Connection: close
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Transfer-Encoding: chunked
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Cache-Control: private
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Date: Wed, 21 Apr 2021 16:07:19 GMT
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Server: ESF
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Origin
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: X-Origin
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Referer
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Xss-Protection: 0
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2e2
2021-04-21T16:07:19.761Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: {
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "primary": {
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key/cryptoKeyVersions/1",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "state": "ENABLED",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "generateTime": "2021-04-21T16:07:19.668159306Z"
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   },
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "purpose": "ENCRYPT_DECRYPT",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "nextRotationTime": "2021-07-20T16:07:19.510717Z",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "rotationPeriod": "7776000s",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "versionTemplate": {
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   }
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: }
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 0
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.762Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:19.763Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:07:19.763Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: Returning after 1 attempts
2021-04-21T16:07:19.764Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Finished creating CryptoKey "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key": map[string]interface {}{"createTime":"2021-04-21T16:07:19.668159306Z", "name":"projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key", "nextRotationTime":"2021-07-20T16:07:19.510717Z", "primary":map[string]interface {}{"algorithm":"GOOGLE_SYMMETRIC_ENCRYPTION", "createTime":"2021-04-21T16:07:19.668159306Z", "generateTime":"2021-04-21T16:07:19.668159306Z", "name":"projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key/cryptoKeyVersions/1", "protectionLevel":"SOFTWARE", "state":"ENABLED"}, "purpose":"ENCRYPT_DECRYPT", "rotationPeriod":"7776000s", "versionTemplate":map[string]interface {}{"algorithm":"GOOGLE_SYMMETRIC_ENCRYPTION", "protectionLevel":"SOFTWARE"}}
2021-04-21T16:07:19.764Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:19 [DEBUG] Google API Request Details:
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: GET /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key?alt=json HTTP/1.1
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.45.0
2021-04-21T16:07:19.765Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json
2021-04-21T16:07:19.766Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Accept-Encoding: gzip
2021-04-21T16:07:19.766Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.766Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:19.766Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:20 [DEBUG] Google API Response Details:
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: HTTP/1.1 200 OK
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Connection: close
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Transfer-Encoding: chunked
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Cache-Control: private
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Date: Wed, 21 Apr 2021 16:07:19 GMT
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Server: ESF
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Origin
2021-04-21T16:07:20.008Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: X-Origin
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: Vary: Referer
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: X-Xss-Protection: 0
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2e2
rovider-google_v3.45.0_x5: {
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "primary": {
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key/cryptoKeyVersions/1",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "state": "ENABLED",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "generateTime": "2021-04-21T16:07:19.668159306Z"
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   },
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "purpose": "ENCRYPT_DECRYPT",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "nextRotationTime": "2021-07-20T16:07:19.510717Z",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "rotationPeriod": "7776000s",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   "versionTemplate": {
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5:   }
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: }
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 0
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: -----------------------------------------------------
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:20 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:07:20.009Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: 2021/04/21 16:07:20 [DEBUG] Retry Transport: Returning after 1 attempts
google_kms_crypto_key.my_crypto_key: Creation complete after 0s [id=projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key]
2021-04-21T16:07:20.023Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:07:20.031Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=583
2021-04-21T16:07:20.031Z [DEBUG] plugin: plugin exited

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

Inspect State

$ terraform state show google_kms_crypto_key.my_crypto_key

2021/04/21 16:07:55 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:07:55 [INFO] Terraform version: 0.14.3  
2021/04/21 16:07:55 [INFO] Go runtime version: go1.15.2
2021/04/21 16:07:55 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "state", "show", "google_kms_crypto_key.my_crypto_key"}
2021/04/21 16:07:55 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:07:55 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:07:55 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:07:55 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:07:55 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:07:55 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:07:55 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:07:55 [INFO] CLI command args: []string{"state", "show", "google_kms_crypto_key.my_crypto_key"}
2021/04/21 16:07:55 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:07:55 [DEBUG] New state was assigned lineage "c108d545-579d-2d1b-b491-8ddf0c43bc9d"
2021/04/21 16:07:55 [DEBUG] checking for provisioner in "."
2021/04/21 16:07:55 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:07:55 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2021/04/21 16:07:55 [DEBUG] backend/local: skipping refresh of managed resources
2021-04-21T16:07:55.878Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:07:55.921Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5]
2021-04-21T16:07:55.923Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=635
2021-04-21T16:07:55.924Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5
2021-04-21T16:07:55.965Z [INFO]  plugin.terraform-provider-google_v3.45.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:07:55.964Z
2021-04-21T16:07:56.006Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:07:56.006Z [DEBUG] plugin.terraform-provider-google_v3.45.0_x5: plugin address: address=/tmp/plugin542471426 network=unix timestamp=2021-04-21T16:07:56.005Z
2021-04-21T16:07:56.195Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:07:56.200Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.45.0/linux_amd64/terraform-provider-google_v3.45.0_x5 pid=635
2021-04-21T16:07:56.201Z [DEBUG] plugin: plugin exited
# google_kms_crypto_key.my_crypto_key:
resource "google_kms_crypto_key" "my_crypto_key" {
    id              = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key"
    key_ring        = "projects/my-project/locations/us-central1/keyRings/my-key-ring"
    name            = "my-crypto-key"
    purpose         = "ENCRYPT_DECRYPT"
    rotation_period = "7776000s"
    self_link       = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key"

    version_template {
        algorithm        = "GOOGLE_SYMMETRIC_ENCRYPTION"
        protection_level = "SOFTWARE"
    }
}

Update Google Provider = 3.46.0

# main.tf
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "= 3.46.0"
    }
  }
}

provider "google" {
  region  = "us-central1"
  project = "my-project"
}

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  lifecycle {
    prevent_destroy = false
  }
}

Clean Out Provider Configs

$ rm -rf .terraform*

Init and Plan Changes

$ terraform init

2021/04/21 16:10:14 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:10:14 [INFO] Terraform version: 0.14.3  
2021/04/21 16:10:14 [INFO] Go runtime version: go1.15.2
2021/04/21 16:10:14 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "init"}
2021/04/21 16:10:14 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:10:14 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:10:14 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:10:14 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:10:14 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:10:14 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:10:14 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:10:14 [INFO] CLI command args: []string{"init"}
2021/04/21 16:10:14 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----

Initializing the backend...
2021/04/21 16:10:14 [DEBUG] New state was assigned lineage "328764df-a4fd-3464-de52-71021ada56d2"
2021/04/21 16:10:14 [DEBUG] checking for provisioner in "."
2021/04/21 16:10:14 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:10:14 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory

2021/04/21 16:10:14 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
Initializing provider plugins...
- Finding hashicorp/google versions matching "3.46.0"...
2021/04/21 16:10:14 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:10:14 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/google/versions
2021/04/21 16:10:15 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:10:15 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/google/3.46.0/download/linux/amd64
2021/04/21 16:10:15 [DEBUG] GET https://releases.hashicorp.com/terraform-provider-google/3.46.0/terraform-provider-google_3.46.0_SHA256SUMS
2021/04/21 16:10:15 [DEBUG] GET https://releases.hashicorp.com/terraform-provider-google/3.46.0/terraform-provider-google_3.46.0_SHA256SUMS.sig
- Installing hashicorp/google v3.46.0...
2021/04/21 16:10:16 [DEBUG] Provider signed by 51852D87348FFC4C HashiCorp Security <[email protected]>
- Installed hashicorp/google v3.46.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform plan

2021/04/21 16:10:24 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:10:24 [INFO] Terraform version: 0.14.3  
2021/04/21 16:10:24 [INFO] Go runtime version: go1.15.2
2021/04/21 16:10:24 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "plan"}
2021/04/21 16:10:24 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:10:24 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:10:24 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:10:24 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:10:24 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:10:24 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:10:24 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:10:24 [INFO] CLI command args: []string{"plan"}
2021/04/21 16:10:24 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:10:24 [DEBUG] New state was assigned lineage "cba2ee13-5cbb-d62f-0ab5-a0491747264e"
2021/04/21 16:10:24 [DEBUG] checking for provisioner in "."
2021/04/21 16:10:24 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:10:24 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2021/04/21 16:10:24 [INFO] backend/local: starting Plan operation
2021-04-21T16:10:24.643Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:10:24.684Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5]
2021-04-21T16:10:24.687Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=716
2021-04-21T16:10:24.687Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5
2021-04-21T16:10:24.725Z [INFO]  plugin.terraform-provider-google_v3.46.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:10:24.725Z
2021-04-21T16:10:24.774Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:10:24.774Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: plugin address: address=/tmp/plugin744098771 network=unix timestamp=2021-04-21T16:10:24.773Z
2021-04-21T16:10:24.967Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:10:24.973Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=716
2021-04-21T16:10:24.973Z [DEBUG] plugin: plugin exited
2021/04/21 16:10:24 [INFO] terraform: building graph: GraphTypeValidate
2021/04/21 16:10:24 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:10:24 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:10:24 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:10:24 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: [google_kms_key_ring.my_key_ring]
2021/04/21 16:10:24 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:10:24 [DEBUG] Starting graph walk: walkValidate
2021-04-21T16:10:24.978Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:10:25.012Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5]
2021-04-21T16:10:25.015Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=727
2021-04-21T16:10:25.015Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5
2021-04-21T16:10:25.059Z [INFO]  plugin.terraform-provider-google_v3.46.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:10:25.058Z
2021-04-21T16:10:25.101Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: plugin address: address=/tmp/plugin777264670 network=unix timestamp=2021-04-21T16:10:25.100Z
2021-04-21T16:10:25.101Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:10:25.336Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:10:25.342Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=727
2021-04-21T16:10:25.343Z [DEBUG] plugin: plugin exited
2021/04/21 16:10:25 [INFO] backend/local: plan calling Plan
2021/04/21 16:10:25 [INFO] terraform: building graph: GraphTypePlan
2021/04/21 16:10:25 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:10:25 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:10:25 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring (expand)" references: []
2021/04/21 16:10:25 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key (expand)" references: [google_kms_key_ring.my_key_ring (expand)]
2021/04/21 16:10:25 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:10:25 [DEBUG] Starting graph walk: walkPlan
2021-04-21T16:10:25.349Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:10:25.386Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5]
2021-04-21T16:10:25.388Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=738
2021-04-21T16:10:25.389Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5
2021-04-21T16:10:25.429Z [INFO]  plugin.terraform-provider-google_v3.46.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:10:25.428Z
2021-04-21T16:10:25.475Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: plugin address: address=/tmp/plugin210598313 network=unix timestamp=2021-04-21T16:10:25.474Z
2021-04-21T16:10:25.475Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:10:25.651Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:25 [INFO] Authenticating using DefaultClient...
2021-04-21T16:10:25.652Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:25 [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]
2021/04/21 16:10:25 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
google_kms_key_ring.my_key_ring: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring]
2021-04-21T16:10:25.664Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:25 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:25 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:25 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:25 [DEBUG] Google API Request Details:
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: GET /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring?alt=json HTTP/1.1
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.46.0
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json
2021-04-21T16:10:25.665Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Accept-Encoding: gzip
2021-04-21T16:10:25.666Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:25.666Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:25.666Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Google API Response Details:
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: HTTP/1.1 200 OK
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Connection: close
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Transfer-Encoding: chunked
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Cache-Control: private
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Date: Wed, 21 Apr 2021 16:10:26 GMT
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Server: ESF
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Origin
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: X-Origin
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Referer
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Xss-Protection: 0
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 82
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: {
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring",
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "createTime": "2021-04-21T16:07:19.133608453Z"
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: }
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.123Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 0
2021-04-21T16:10:26.124Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.124Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.124Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:10:26.124Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:10:26.124Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Retry Transport: Returning after 1 attempts
2021/04/21 16:10:26 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: []
google_kms_crypto_key.my_crypto_key: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key]
2021-04-21T16:10:26.141Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:10:26.142Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:10:26.142Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Google API Request Details:
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: GET /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key?alt=json HTTP/1.1
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.46.0
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Accept-Encoding: gzip
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.143Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Google API Response Details:
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: HTTP/1.1 200 OK
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Connection: close
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Transfer-Encoding: chunked
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Cache-Control: private
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Date: Wed, 21 Apr 2021 16:10:26 GMT
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Server: ESF
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Origin
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: X-Origin
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Referer
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Xss-Protection: 0
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2e2
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: {
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key",
2021-04-21T16:10:26.381Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "primary": {
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key/cryptoKeyVersions/1",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "state": "ENABLED",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "generateTime": "2021-04-21T16:07:19.668159306Z"
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   },
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "purpose": "ENCRYPT_DECRYPT",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:10:26.382Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "nextRotationTime": "2021-07-20T16:07:19.510717Z",
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "rotationPeriod": "7776000s",
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "versionTemplate": {
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   }
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: }
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 0
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:10:26.383Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:10:26 [DEBUG] Retry Transport: Returning after 1 attempts
2021/04/21 16:10:26 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an unexpected new value for google_kms_crypto_key.my_crypto_key during refresh.
      - .labels: was null, but now cty.MapValEmpty(cty.String)
2021/04/21 16:10:26 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_kms_crypto_key.my_crypto_key, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .version_template: block count in plan (1) disagrees with count in config (0)
2021-04-21T16:10:26.391Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:10:26.397Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=738
2021-04-21T16:10:26.397Z [DEBUG] plugin: plugin exited
2021/04/21 16:10:26 [INFO] backend/local: plan operation completed

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.

Add Labels to Crypto Key

# main.tf
terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "= 3.46.0"
    }
  }
}

provider "google" {
  region  = "us-central1"
  project = "my-project"
}

resource "google_kms_key_ring" "my_key_ring" {
  name     = "my-key-ring"
  location = "us-central1"

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_kms_crypto_key" "my_crypto_key" {
  name            = "my-crypto-key"
  key_ring        = google_kms_key_ring.my_key_ring.self_link
  rotation_period = "7776000s"

  labels = {
    foo = "bar"
  }

  lifecycle {
    prevent_destroy = false
  }
}

Plan Changes

$ terraform plan

2021/04/21 16:11:22 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:11:22 [INFO] Terraform version: 0.14.3  
2021/04/21 16:11:22 [INFO] Go runtime version: go1.15.2
2021/04/21 16:11:22 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.14", "plan"}
2021/04/21 16:11:22 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021/04/21 16:11:22 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/04/21 16:11:22 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/04/21 16:11:22 [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2021/04/21 16:11:22 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021/04/21 16:11:22 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021/04/21 16:11:22 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021/04/21 16:11:22 [INFO] CLI command args: []string{"plan"}
2021/04/21 16:11:22 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/04/21 16:11:22 [DEBUG] New state was assigned lineage "39ebc5e1-31d0-d56b-0191-ea8245a1ba3c"
2021/04/21 16:11:22 [DEBUG] checking for provisioner in "."
2021/04/21 16:11:22 [DEBUG] checking for provisioner in "/usr/local/bin"
2021/04/21 16:11:22 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2021/04/21 16:11:22 [INFO] backend/local: starting Plan operation
2021-04-21T16:11:22.433Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:11:22.474Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5]
2021-04-21T16:11:22.477Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=772
2021-04-21T16:11:22.478Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5
2021-04-21T16:11:22.514Z [INFO]  plugin.terraform-provider-google_v3.46.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:11:22.514Z
2021-04-21T16:11:22.555Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: plugin address: address=/tmp/plugin024422743 network=unix timestamp=2021-04-21T16:11:22.555Z
2021-04-21T16:11:22.555Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:11:22.740Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:11:22.745Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=772
2021-04-21T16:11:22.746Z [DEBUG] plugin: plugin exited
2021/04/21 16:11:22 [INFO] terraform: building graph: GraphTypeValidate
2021/04/21 16:11:22 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:11:22 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:11:22 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
2021/04/21 16:11:22 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: [google_kms_key_ring.my_key_ring]
2021/04/21 16:11:22 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:11:22 [DEBUG] Starting graph walk: walkValidate
2021-04-21T16:11:22.752Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:11:22.789Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5]
2021-04-21T16:11:22.791Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=784
2021-04-21T16:11:22.791Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5
2021-04-21T16:11:22.830Z [INFO]  plugin.terraform-provider-google_v3.46.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:11:22.830Z
2021-04-21T16:11:22.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: plugin address: network=unix address=/tmp/plugin836903819 timestamp=2021-04-21T16:11:22.873Z
2021-04-21T16:11:22.873Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:11:23.120Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:11:23.124Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=784
2021-04-21T16:11:23.124Z [DEBUG] plugin: plugin exited
2021/04/21 16:11:23 [INFO] backend/local: plan calling Plan
2021/04/21 16:11:23 [INFO] terraform: building graph: GraphTypePlan
2021/04/21 16:11:23 [DEBUG] ProviderTransformer: "google_kms_crypto_key.my_crypto_key (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:11:23 [DEBUG] ProviderTransformer: "google_kms_key_ring.my_key_ring (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/04/21 16:11:23 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/04/21 16:11:23 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring (expand)" references: []
2021/04/21 16:11:23 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key (expand)" references: [google_kms_key_ring.my_key_ring (expand)]
2021/04/21 16:11:23 [DEBUG] Starting graph walk: walkPlan
2021-04-21T16:11:23.129Z [INFO]  plugin: configuring client automatic mTLS
2021-04-21T16:11:23.164Z [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5]
2021-04-21T16:11:23.166Z [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=795
2021-04-21T16:11:23.167Z [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5
2021-04-21T16:11:23.202Z [INFO]  plugin.terraform-provider-google_v3.46.0_x5: configuring server automatic mTLS: timestamp=2021-04-21T16:11:23.202Z
2021-04-21T16:11:23.243Z [DEBUG] plugin: using plugin: version=5
2021-04-21T16:11:23.243Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: plugin address: address=/tmp/plugin762782126 network=unix timestamp=2021-04-21T16:11:23.243Z
2021-04-21T16:11:23.416Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [INFO] Authenticating using DefaultClient...
2021-04-21T16:11:23.416Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [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]
2021/04/21 16:11:23 [DEBUG] ReferenceTransformer: "google_kms_key_ring.my_key_ring" references: []
google_kms_key_ring.my_key_ring: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring]
2021-04-21T16:11:23.426Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:11:23.426Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:11:23.427Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:11:23.427Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Google API Request Details:
2021-04-21T16:11:23.427Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:11:23.427Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: GET /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring?alt=json HTTP/1.1
2021-04-21T16:11:23.427Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:11:23.427Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.46.0
2021-04-21T16:11:23.429Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json
2021-04-21T16:11:23.429Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Accept-Encoding: gzip
2021-04-21T16:11:23.430Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.430Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.430Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Google API Response Details:
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: HTTP/1.1 200 OK
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Connection: close
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Transfer-Encoding: chunked
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Cache-Control: private
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Date: Wed, 21 Apr 2021 16:11:23 GMT
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Server: ESF
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Origin
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: X-Origin
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Referer
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:11:23.872Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Xss-Protection: 0
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 82
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: {
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring",
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "createTime": "2021-04-21T16:07:19.133608453Z"
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: }
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 0
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:11:23.873Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Retry Transport: Returning after 1 attempts
2021/04/21 16:11:23 [DEBUG] ReferenceTransformer: "google_kms_crypto_key.my_crypto_key" references: []
2021-04-21T16:11:23.886Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Waiting for state to become: [success]
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Retry Transport: request attempt 0
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:23 [DEBUG] Google API Request Details:
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ REQUEST ]---------------------------------------
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: GET /v1/projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key?alt=json HTTP/1.1
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Host: cloudkms.googleapis.com
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: User-Agent: Terraform/0.14.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google/3.46.0
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Accept-Encoding: gzip
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:23.887Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
google_kms_crypto_key.my_crypto_key: Refreshing state... [id=projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key]
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:24 [DEBUG] Google API Response Details:
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: ---[ RESPONSE ]--------------------------------------
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: HTTP/1.1 200 OK
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Connection: close
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Transfer-Encoding: chunked
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Cache-Control: private
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Content-Type: application/json; charset=UTF-8
2021-04-21T16:11:24.144Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Date: Wed, 21 Apr 2021 16:11:24 GMT
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Server: ESF
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Origin
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: X-Origin
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: Vary: Referer
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Content-Type-Options: nosniff
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Frame-Options: SAMEORIGIN
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: X-Xss-Protection: 0
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2e2
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: {
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key",
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "primary": {
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "name": "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key/cryptoKeyVersions/1",
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "state": "ENABLED",
2021-04-21T16:11:24.145Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION",
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "generateTime": "2021-04-21T16:07:19.668159306Z"
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   },
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "purpose": "ENCRYPT_DECRYPT",
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "createTime": "2021-04-21T16:07:19.668159306Z",
2021-04-21T16:11:24.146Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "nextRotationTime": "2021-07-20T16:07:19.510717Z",
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "rotationPeriod": "7776000s",
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   "versionTemplate": {
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "protectionLevel": "SOFTWARE",
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:     "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION"
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5:   }
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: }
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 0
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:24.147Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 
2021-04-21T16:11:24.148Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: -----------------------------------------------------
2021-04-21T16:11:24.148Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:24 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021-04-21T16:11:24.148Z [DEBUG] plugin.terraform-provider-google_v3.46.0_x5: 2021/04/21 16:11:24 [DEBUG] Retry Transport: Returning after 1 attempts
2021/04/21 16:11:24 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an unexpected new value for google_kms_crypto_key.my_crypto_key during refresh.
      - .labels: was null, but now cty.MapValEmpty(cty.String)
2021/04/21 16:11:24 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_kms_crypto_key.my_crypto_key, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .skip_initial_version_creation: planned value cty.False does not match config value cty.NullVal(cty.Bool)
      - .version_template: block count in plan (1) disagrees with count in config (0)
2021-04-21T16:11:24.158Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-04-21T16:11:24.165Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.46.0/linux_amd64/terraform-provider-google_v3.46.0_x5 pid=795
2021-04-21T16:11:24.165Z [DEBUG] plugin: plugin exited
2021/04/21 16:11:24 [INFO] backend/local: plan operation completed

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # google_kms_crypto_key.my_crypto_key must be replaced
-/+ resource "google_kms_crypto_key" "my_crypto_key" {
      ~ id                            = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key" -> (known after apply)
      ~ labels                        = {
          + "foo" = "bar"
        }
        name                          = "my-crypto-key"
      ~ self_link                     = "projects/my-project/locations/us-central1/keyRings/my-key-ring/cryptoKeys/my-crypto-key" -> (known after apply)
      + skip_initial_version_creation = false # forces replacement
        # (3 unchanged attributes hidden)

      ~ version_template {
          ~ algorithm        = "GOOGLE_SYMMETRIC_ENCRYPTION" -> (known after apply)
          ~ protection_level = "SOFTWARE" -> (known after apply)
        }
    }

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

@edwardmedia
Copy link
Contributor

@byronmccollum now I see. Thanks for providing the details

@ghost
Copy link

ghost commented May 24, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.