Skip to content

Add support for Spanner CMEK Re-encryption#17671

Open
panerorenn9541 wants to merge 12 commits into
GoogleCloudPlatform:mainfrom
panerorenn9541:main
Open

Add support for Spanner CMEK Re-encryption#17671
panerorenn9541 wants to merge 12 commits into
GoogleCloudPlatform:mainfrom
panerorenn9541:main

Conversation

@panerorenn9541
Copy link
Copy Markdown
Contributor

@panerorenn9541 panerorenn9541 commented May 21, 2026

Support Spanner CMEK Re-encryption

Allow going from CMEK to GMEK, GMEK to CMEK, and CMEK to CMEK

Release Note Template for Downstream PRs (will be copied)

spanner: added CMEK Re-encryption support

Remove the immutable: true flag from the kmsKeyName
Remove the immutable: true flag from encryptionConfig
Remove the immutable: true flag from kmsKeyNames
Add send_empty_value: true to encryptionConfig
Remove ForceNew to not force creating a new database when the key changes
@github-actions github-actions Bot requested a review from shuyama1 May 21, 2026 17:39
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

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

@trodge, 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.

Add MR CMEK Re-encryption tests
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 131 insertions(+), 5 deletions(-)
google-beta provider View Diff 2 files changed, 131 insertions(+), 5 deletions(-)
terraform-google-conversion View Diff 4 files changed, 5 insertions(+), 7 deletions(-)

Step 1: Replaying Mode

Caution

Build Failure during VCR tests

🔴 REPLAYING mode: The following packages failed to build:

  • spanner

Please fix the compilation errors to complete your PR.

View the build log

@panerorenn9541, @shuyama1 VCR tests complete for 1b4039c!

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 225 insertions(+), 5 deletions(-)
google-beta provider View Diff 2 files changed, 225 insertions(+), 5 deletions(-)
terraform-google-conversion View Diff 4 files changed, 8 insertions(+), 7 deletions(-)

Step 1: Replaying Mode

Caution

Build Failure during VCR tests

🔴 REPLAYING mode: The following packages failed to build:

  • spanner

Please fix the compilation errors to complete your PR.

View the build log

@panerorenn9541, @shuyama1 VCR tests complete for 2b1bc27!

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 228 insertions(+), 8 deletions(-)
google-beta provider View Diff 2 files changed, 228 insertions(+), 8 deletions(-)
terraform-google-conversion View Diff 4 files changed, 8 insertions(+), 7 deletions(-)

Step 1: Replaying Mode

Caution

Build Failure during VCR tests

🔴 REPLAYING mode: The following packages failed to build:

  • spanner

Please fix the compilation errors to complete your PR.

View the build log

@panerorenn9541, @shuyama1 VCR tests complete for dc6b78f!

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 228 insertions(+), 8 deletions(-)
google-beta provider View Diff 2 files changed, 228 insertions(+), 8 deletions(-)
terraform-google-conversion View Diff 4 files changed, 8 insertions(+), 7 deletions(-)

Step 1: Replaying Mode

Caution

Build Failure during VCR tests

🔴 REPLAYING mode: The following packages failed to build:

  • spanner

Please fix the compilation errors to complete your PR.

View the build log

@panerorenn9541, @shuyama1 VCR tests complete for 3214cff!

Replace acctest.Bootstrap with resourcemanager.BootstrapIamMembers and kms.BootstrapKMSKey
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 228 insertions(+), 8 deletions(-)
google-beta provider View Diff 2 files changed, 228 insertions(+), 8 deletions(-)
terraform-google-conversion View Diff 4 files changed, 8 insertions(+), 7 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
55 33 5 17
Affected Service Packages
  • spanner

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 17 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccDataSourceSpannerDatabase_basic
  • TestAccSpannerBackupSchedule_CMEKFullBackup
  • TestAccSpannerBackupSchedule_spannerBackupScheduleDailyFullExample
  • TestAccSpannerBackupSchedule_spannerBackupScheduleDailyIncrementalExample
  • TestAccSpannerBackupSchedule_update
  • TestAccSpannerDatabaseIamBinding
  • TestAccSpannerDatabaseIamMember
  • TestAccSpannerDatabaseIamPolicy
  • TestAccSpannerDatabase_basic
  • TestAccSpannerDatabase_cmekReencryption
  • TestAccSpannerDatabase_defaultTimeZone
  • TestAccSpannerDatabase_deletionProtection
  • TestAccSpannerDatabase_enableDropProtection
  • TestAccSpannerDatabase_mrcmekReencryption
  • TestAccSpannerDatabase_postgres
  • TestAccSpannerDatabase_spannerDatabaseBasicExample
  • TestAccSpannerDatabase_versionRetentionPeriod

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccDataSourceSpannerDatabase_basic
✅ Log TestAccSpannerBackupSchedule_CMEKFullBackup
✅ Log TestAccSpannerBackupSchedule_spannerBackupScheduleDailyFullExample
✅ Log TestAccSpannerBackupSchedule_spannerBackupScheduleDailyIncrementalExample
✅ Log TestAccSpannerBackupSchedule_update
✅ Log TestAccSpannerDatabaseIamBinding
✅ Log TestAccSpannerDatabaseIamMember
✅ Log TestAccSpannerDatabaseIamPolicy
✅ Log TestAccSpannerDatabase_basic
✅ Log TestAccSpannerDatabase_defaultTimeZone
✅ Log TestAccSpannerDatabase_deletionProtection
✅ Log TestAccSpannerDatabase_enableDropProtection
✅ Log TestAccSpannerDatabase_postgres
✅ Log TestAccSpannerDatabase_spannerDatabaseBasicExample
✅ Log TestAccSpannerDatabase_versionRetentionPeriod
❌ Error · Log - TestAccSpannerDatabase_cmekReencryption
❌ Error · Log - TestAccSpannerDatabase_mrcmekReencryption

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@panerorenn9541, @shuyama1 VCR tests complete for 2199b07!

@shuyama1
Copy link
Copy Markdown
Member

Sorry, I won't have time to review this PR and I'll be out for a week. Assigning a new reviewer.

@modular-magician reassign-reviewer

@github-actions github-actions Bot requested review from trodge and removed request for shuyama1 May 21, 2026 20:31
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.

3 participants