magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Add kmskeyname to datastore

Open jialei-chen opened this issue 6 months ago • 20 comments

Fixes https://github.com/hashicorp/terraform-provider-google/issues/19041

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

discoveryengine: added `kms_key_name` field to `google_discovery_engine_data_store` resource

jialei-chen avatar May 30 '25 21:05 jialei-chen

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

github-actions[bot] avatar May 30 '25 21:05 github-actions[bot]

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 110 insertions(+)) google-beta provider: Diff ( 4 files changed, 110 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+)) Open in Cloud Shell: Diff ( 4 files changed, 112 insertions(+))

modular-magician avatar May 30 '25 21:05 modular-magician

Tests analytics

Total tests: 16 Passed tests: 15 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample

Get to know how VCR tests work

modular-magician avatar May 30 '25 21:05 modular-magician

🔴 Tests failed during RECORDING mode: TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

modular-magician avatar May 30 '25 21:05 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 110 insertions(+)) google-beta provider: Diff ( 4 files changed, 110 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+)) Open in Cloud Shell: Diff ( 4 files changed, 112 insertions(+))

modular-magician avatar May 30 '25 21:05 modular-magician

Tests analytics

Total tests: 16 Passed tests: 15 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample

Get to know how VCR tests work

modular-magician avatar May 30 '25 21:05 modular-magician

🔴 Tests failed during RECORDING mode: TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

modular-magician avatar May 30 '25 21:05 modular-magician

Checked the [Error message],

  • Resource google_kms_key_ring exists:
    • https://screenshot.googleplex.com/4ZCC4dChUWhxGr3
    • "projects/ci-test-project-188019/locations/us/keyRings/tftest-shared-keyring-1"
  • Resource google_kms_crypto_key and google_kms_crypto_key_version exist:
    • https://screenshot.googleplex.com/8ckQiCigB5GTRpL
    • "projects/ci-test-project-188019/locations/us/keyRings/tftest-shared-keyring-1/cryptoKeys/tftest-shared-key-1"
    • "projects/ci-test-project-188019/locations/us/keyRings/tftest-shared-keyring-1/cryptoKeys/tftest-shared-key-1/cryptoKeyVersions/1"
  • Error was generated while creating target resource google_discovery_engine_data_store: https://screenshot.googleplex.com/5344TXzxec5Bztn
    • Code pointer
    • Error reason: there is no corresponding CmekConfig: https://screenshot.googleplex.com/9zkvmVSp8kvqbLU
    • Solution: Manually create CmekConfig https://screenshot.googleplex.com/8WAUBqF8n5bxUuf but failed for permission issue https://screenshot.googleplex.com/BPpBzJixCEp5fuV

jialei-chen avatar May 30 '25 22:05 jialei-chen

@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 04 '25 09:06 github-actions[bot]

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 06 '25 09:06 github-actions[bot]

@jialei-chen could you clarify the state of this PR? The code looks sufficient, and the bootstrapped key appears to be hooked up correctly, but the API is not handling it. Does that imply a bug with the API, or that more needs to be done client side for this behavior to work?

Hi @roaks3, thanks for your review. Yes, it's a small PR, where the code and bootstrapped key look good. Checked the error message, I think the API is failing for some reason. And I've reached out to our API owner for the fix: b/422249102. Once this ticket is closed, I will verify locally and re-trigger the VCR-test.

jialei-chen avatar Jun 09 '25 18:06 jialei-chen

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 110 insertions(+)) google-beta provider: Diff ( 4 files changed, 110 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+)) Open in Cloud Shell: Diff ( 4 files changed, 112 insertions(+))

modular-magician avatar Jun 13 '25 18:06 modular-magician

Hi @roaks3, the bug with API was fixed b/359238429#comment28. I re-retriggered the auto tests by "Sync fork -> Update branch", but got timeout. Do you know what happened or do I need to retry?

jialei-chen avatar Jun 16 '25 16:06 jialei-chen

/gcbrun

melinath avatar Jun 17 '25 17:06 melinath

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 110 insertions(+)) google-beta provider: Diff ( 4 files changed, 110 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+)) Open in Cloud Shell: Diff ( 4 files changed, 112 insertions(+))

modular-magician avatar Jun 17 '25 17:06 modular-magician

Tests analytics

Total tests: 16 Passed tests: 15 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample

Get to know how VCR tests work

modular-magician avatar Jun 17 '25 17:06 modular-magician

🔴 Tests failed during RECORDING mode: TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

modular-magician avatar Jun 17 '25 17:06 modular-magician

Hi reviewer, I checked Debug log above. The error seems to be impacted by "legacy plugin SDK" and I don't think it can be fixed on my side. Specifically,

  1. [Expected] Create DataStore operation finished successfully with bootstrapped KMS key. https://screenshot.googleplex.com/9Rjjfgf3gWsfqVv
  2. [Expected] Get DataStore operation finished successfully. https://screenshot.googleplex.com/4xQmTrptKSNz2mr
  3. [Unexpected] Warning of an unexpected new value for KMS key name https://screenshot.googleplex.com/4CzyQTF24oPYqe8
Provider "provider[\"registry.terraform.io/hashicorp/google\"]" produced an unexpected new value for google_discovery_engine_data_store.kms_key_name, 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:
      - .kms_key_name: was cty.StringVal("projects/ci-test-project-188019/locations/us/keyRings/tftest-shared-keyring-1/cryptoKeys/tftest-shared-key-1"), but now cty.StringVal("")

This warning causes the following ~ update in-place error for this PR.

error=
  | After applying this test step, the plan was not empty.
  | stdout:
  | 
  | 
  | Terraform used the selected providers to generate the following execution
  | plan. Resource actions are indicated with the following symbols:
  |   ~ update in-place
  | 
  | Terraform will perform the following actions:
  | 
  |   # google_discovery_engine_data_store.kms_key_name will be updated in-place
  |   ~ resource "google_discovery_engine_data_store" "kms_key_name" {
  |         id                           = "projects/ci-test-project-188019/locations/us/collections/default_collection/dataStores/tf-test-data-store-id6botvp678c"
  |       + kms_key_name                 = "projects/ci-test-project-188019/locations/us/keyRings/tftest-shared-keyring-1/cryptoKeys/tftest-shared-key-1"
  |         name                         = "projects/1067888929963/locations/us/collections/default_collection/dataStores/tf-test-data-store-id6botvp678c"
  |         # (11 unchanged attributes hidden)
  |     }
  | 
  | Plan: 0 to add, 1 to change, 0 to destroy.
  1. [Expected] Deleted DataStore operation finished successfully. https://screenshot.googleplex.com/8StCQkXJJEYo7DR

jialei-chen avatar Jun 18 '25 00:06 jialei-chen

@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 18 '25 09:06 github-actions[bot]

Hmm, I think we should be able to resolve this in the PR. If you look at the POST request made for the datastore, it sends the kmsKeyName correctly, but then the response appears to be missing the field, instead including a cmekConfig.kmsKey. I think we can model this in TF, but it is a bit strange. Is there any option to make the request/response field consistent here?

I don't understand why it's needed to keep request/response field consistent. If it's need, I think we need to change API implementation. Let me discuss with the API owner within our team, because this change will introduce duplicated info in the response.

jialei-chen avatar Jun 18 '25 22:06 jialei-chen

@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 23 '25 09:06 github-actions[bot]

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 25 '25 09:06 github-actions[bot]

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 110 insertions(+)) google-beta provider: Diff ( 4 files changed, 110 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+)) Open in Cloud Shell: Diff ( 4 files changed, 112 insertions(+))

modular-magician avatar Jun 27 '25 01:06 modular-magician

Tests analytics

Total tests: 16 Passed tests: 15 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample

Get to know how VCR tests work

modular-magician avatar Jun 27 '25 01:06 modular-magician

🟢 Tests passed during RECORDING mode: TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

modular-magician avatar Jun 27 '25 01:06 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 108 insertions(+), 5 deletions(-)) google-beta provider: Diff ( 4 files changed, 108 insertions(+), 5 deletions(-)) terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+)) Open in Cloud Shell: Diff ( 4 files changed, 112 insertions(+))

modular-magician avatar Jun 27 '25 01:06 modular-magician

Tests analytics

Total tests: 16 Passed tests: 16 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • discoveryengine
🟢 All tests passed!

View the build log

modular-magician avatar Jun 27 '25 01:06 modular-magician