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

Spanner MR CMEK Integration #11319

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

panerorenn9541
Copy link

@panerorenn9541 panerorenn9541 commented Aug 1, 2024

Promote Spanner MR CMEK support to GA:

Adds the new field kmsKeyNames to encryptionConfig to support creating a Spanner MR CMEK database.

Release Note Template for Downstream PRs (will be copied)

spanner: added `kmsKeyNames` to encryptionConfig of Database

mmv1/products/spanner/Database.yaml Outdated Show resolved Hide resolved
mmv1/products/spanner/Database.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@rahul2393 rahul2393 left a comment

Choose a reason for hiding this comment

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

LGTM

@panerorenn9541 panerorenn9541 marked this pull request as ready for review August 7, 2024 19:14
Copy link

github-actions bot commented Aug 7, 2024

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

@c2thorn, 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 github-actions bot requested a review from c2thorn August 7, 2024 19:15
@modular-magician
Copy link
Collaborator

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 ( 2 files changed, 38 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 3 files changed, 173 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

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 ( 2 files changed, 38 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 3 files changed, 173 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 30
Passed tests: 18
Skipped tests: 12
Affected tests: 0

Click here to see the affected service packages
  • spanner
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek
    $\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 30
Passed tests: 18
Skipped tests: 12
Affected tests: 0

Click here to see the affected service packages
  • spanner
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek
    $\textcolor{green}{\textsf{All tests passed!}}$

View the build log

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

can you update the release note based on https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/

I'll run the test in our environment to make sure its passing

@panerorenn9541
Copy link
Author

can you update the release note based on https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/

I'll run the test in our environment to make sure its passing

Added a note.

@github-actions github-actions bot requested a review from c2thorn August 7, 2024 21:50
Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

=== RUN   TestAccSpannerDatabase_mrcmek
=== PAUSE TestAccSpannerDatabase_mrcmek
=== CONT  TestAccSpannerDatabase_mrcmek
    vcr_utils.go:152: Step 1/2 error: Error running apply: exit status 1
        Error: Error creating Database: googleapi: Error 400: Invalid CreateDatabase request.
        Details:
        [
          {
            "@type": "type.googleapis.com/google.rpc.BadRequest",
            "fieldViolations": [
              {
                "description": "Expected projects/{project ID}/locations/{location ID}/keyRings/{keyring ID}/cryptoKeys/{kms_key_name}\nGot: google_kms_crypto_key.example-key-us-central1.id\nError: Resource name 'google_kms_crypto_key.example-key-us-central1.id' does not match pattern 'projects/([^/]{1,100})/locations/([a-zA-Z0-9_-]{1,63})/keyRings/([a-zA-Z0-9_-]{1,63})/cryptoKeys/([a-zA-Z0-9_-]{1,63})'.",
                "field": "encryption_config.kms_key_names[0]"
              }
            ]
          }
        ]
          with google_spanner_database.database,
          on terraform_plugin_test.tf line 9, in resource "google_spanner_database" "database":
           9: resource "google_spanner_database" "database" {

@github-actions github-actions bot requested a review from c2thorn August 9, 2024 00:14
@panerorenn9541
Copy link
Author

I am seeing the error "The Cloud Spanner multi-region CMEK feature is currently not supported"

@modular-magician
Copy link
Collaborator

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 ( 2 files changed, 38 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 3 files changed, 173 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

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 ( 2 files changed, 38 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 3 files changed, 173 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

Use spaces rather than tabs
@modular-magician
Copy link
Collaborator

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 ( 3 files changed, 83 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

panerorenn9541 and others added 3 commits October 10, 2024 17:11
Use spaces instead of tabs
Change description of kmsKeyNames to use plurals
…ey_names.go.tmpl


Clarify comment

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
@modular-magician
Copy link
Collaborator

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 ( 3 files changed, 83 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

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 ( 3 files changed, 83 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

@modular-magician
Copy link
Collaborator

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 ( 3 files changed, 83 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

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 ( 3 files changed, 83 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

Use BootstrapKMSKey instead of crypto keys because crypto keys can't be deleted
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4153
Passed tests: 3730
Skipped tests: 418
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[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
Copy link
Collaborator

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 ( 3 files changed, 83 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 189 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 11 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4153
Passed tests: 3730
Skipped tests: 418
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4153
Passed tests: 3730
Skipped tests: 418
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[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
Copy link
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[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
Copy link
Collaborator

Tests analytics

Total tests: 4152
Passed tests: 3729
Skipped tests: 418
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4153
Passed tests: 3730
Skipped tests: 418
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[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
Copy link
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[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
Copy link
Collaborator

Tests analytics

Total tests: 4153
Passed tests: 3731
Skipped tests: 418
Affected tests: 4

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSpannerDatabase_mrcmek

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[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

Comment on lines +677 to +699
resource "google_kms_crypto_key_iam_binding" "crypto_key1" {
crypto_key_id = "%{key_name1}"
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
members = [
google_project_service_identity.ck_sa.member,
]
}

resource "google_kms_crypto_key_iam_binding" "crypto_key2" {
crypto_key_id = "%{key_name2}"
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
members = [
google_project_service_identity.ck_sa.member,
]
}

resource "google_kms_crypto_key_iam_binding" "crypto_key3" {
crypto_key_id = "%{key_name3}"
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
members = [
google_project_service_identity.ck_sa.member,
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove these IAM roles? I'll manually add them once done. Then we should be good to go here.

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

Successfully merging this pull request may close these issues.

6 participants