Skip to content

Conversation

@Kartikeyapise
Copy link
Member

@Kartikeyapise Kartikeyapise commented Jan 5, 2026

kms: added `key_project_resolution_mode` field and project-level support to `google_kms_autokey_config` resource

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 5, 2026
@github-actions github-actions bot requested a review from shuyama1 January 5, 2026 14:29
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

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.

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

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

The code generator was migrated from Ruby to Go.

Could you please update the code in this PR to align with the current Go-based implementation?

https://googlecloudplatform.github.io/magic-modules/reference/ruby-go-changes/
https://googlecloudplatform.github.io/magic-modules/develop/add-resource/

@Kartikeyapise Kartikeyapise force-pushed the autokey-project-support branch from e3894b9 to b37cd93 Compare January 6, 2026 10:07
@github-actions github-actions bot requested a review from shuyama1 January 6, 2026 10:08
@Kartikeyapise
Copy link
Member Author

The code generator was migrated from Ruby to Go.

Could you please update the code in this PR to align with the current Go-based implementation?

https://googlecloudplatform.github.io/magic-modules/reference/ruby-go-changes/ https://googlecloudplatform.github.io/magic-modules/develop/add-resource/

Have migrated to go @shuyama1

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

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

@modular-magician modular-magician added service/cloudkms and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jan 9, 2026
@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 ( 7 files changed, 931 insertions(+), 155 deletions(-))
google-beta provider: Diff ( 8 files changed, 1020 insertions(+), 223 deletions(-))
terraform-google-conversion: Diff ( 8 files changed, 208 insertions(+), 368 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_kms_autokey_config (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_kms_autokey_config" "primary" {
  key_project_resolution_mode = # value needed
}

Resource: google_kms_google_kms_autokey_config (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_kms_google_kms_autokey_config" "primary" {
  folder = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 50
Passed tests: 40
Skipped tests: 6
Affected tests: 4

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsAutokeyConfig_basic
  • TestAccKMSAutokeyConfig_kmsAutokeyConfigFolderExample
  • TestAccKMSAutokeyConfig_kmsAutokeyConfigProjectExample
  • TestAccKMSKeyHandle_kmsKeyHandleBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataSourceGoogleKmsAutokeyConfig_basic [Error message] [Debug log]
TestAccKMSAutokeyConfig_kmsAutokeyConfigFolderExample [Error message] [Debug log]
TestAccKMSAutokeyConfig_kmsAutokeyConfigProjectExample [Error message] [Debug log]
TestAccKMSKeyHandle_kmsKeyHandleBasicExample [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

@Kartikeyapise Kartikeyapise force-pushed the autokey-project-support branch from e8f3efd to e769021 Compare January 12, 2026 12:36
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 12, 2026
@Kartikeyapise Kartikeyapise force-pushed the autokey-project-support branch 2 times, most recently from 9bbb447 to e517c6c Compare January 12, 2026 13:05
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 12, 2026
@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, 403 insertions(+), 152 deletions(-))
google-beta provider: Diff ( 4 files changed, 475 insertions(+), 220 deletions(-))
terraform-google-conversion: Diff ( 7 files changed, 96 insertions(+), 368 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_kms_autokey_config (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_kms_autokey_config" "primary" {
  key_project_resolution_mode = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 50
Passed tests: 40
Skipped tests: 6
Affected tests: 4

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsAutokeyConfig_basic
  • TestAccKMSAutokeyConfig_kmsAutokeyConfigFolderExample
  • TestAccKMSAutokeyConfig_kmsAutokeyConfigProjectExample
  • TestAccKMSKeyHandle_kmsKeyHandleBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataSourceGoogleKmsAutokeyConfig_basic [Error message] [Debug log]
TestAccKMSAutokeyConfig_kmsAutokeyConfigFolderExample [Error message] [Debug log]
TestAccKMSAutokeyConfig_kmsAutokeyConfigProjectExample [Error message] [Debug log]
TestAccKMSKeyHandle_kmsKeyHandleBasicExample [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

@github-actions
Copy link

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

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

TestAccDataSourceGoogleKmsAutokeyConfig_basic and TestAccKMSKeyHandle_kmsKeyHandleBasicExample seem to fail due to the change in this PR. Could you investigate the failures and get them fixed. The failures are not due to if the new feature is released and I think we can get them fixed now. Please let me know if you have any questions. Thanks!

Comment on lines 82 to 115
custom_code:
custom_import: templates/terraform/custom_import/kms_autokey_config.go.erb
encoder: templates/terraform/encoders/kms_autokey_config_update.go.erb
decoder: templates/terraform/decoders/kms_autokey_config.go.erb
custom_update: templates/terraform/custom_update/kms_autokey_config.go.erb
custom_create: templates/terraform/custom_create/kms_autokey_config.go.erb
pre_delete: templates/terraform/pre_delete/kms_autokey_config.go.erb
test_check_destroy: 'templates/terraform/custom_check_destroy/kms_autokey_config.go.tmpl'
constants: 'templates/terraform/constants/autokey_config_folder_diff.go.tmpl'

timeouts:
insert_minutes: 20
update_minutes: 20
delete_minutes: 20

# Removed static create_url, update_url, delete_url, id_format, self_link from the top level
# These are now dynamic and handled by custom code.
exclude_sweeper: true
examples:
- name: 'kms_autokey_config_folder' # Example for folder
primary_resource_id: 'example-autokeyconfig-folder'
min_version: 'beta'
vars:
folder_name: 'my-folder'
key_project_name: 'key-proj'
org_id: 'ORG_ID'
billing_account: 'BILLING_ACCT'
- name: 'kms_autokey_config_project' # Example for project
primary_resource_id: 'example-autokeyconfig-project'
min_version: 'beta'
vars:
project_name: 'my-resource-proj'
org_id: 'ORG_ID'
billing_account: 'BILLING_ACCT'
Copy link
Member

Choose a reason for hiding this comment

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

Could you move all these before the parameters section?

Copy link
Member Author

Choose a reason for hiding this comment

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

made the change as per the comment.

Comment on lines 25 to 31
variable "org_id" {
type = string
}

variable "billing_account" {
type = string
}
Copy link
Member

Choose a reason for hiding this comment

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

You'll need to pass billing account and org as test env vars. Please follow the existing example https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/templates/terraform/examples/kms_autokey_config_all.tf.tmpl

More details at https://googlecloudplatform.github.io/magic-modules/reference/resource/#examples

similar for the other example

Copy link
Member Author

Choose a reason for hiding this comment

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

changed accordingly.

@Kartikeyapise
Copy link
Member Author

TestAccDataSourceGoogleKmsAutokeyConfig_basic and TestAccKMSKeyHandle_kmsKeyHandleBasicExample seem to fail due to the change in this PR. Could you investigate the failures and get them fixed. The failures are not due to if the new feature is released and I think we can get them fixed now. Please let me know if you have any questions. Thanks!

I saw this error in these failures:
{
"description": "Invalid JSON payload received. Unknown name "keyProjectResolutionMode" at 'autokey_config': Cannot find field.",
"field": "autokey_config"
}

This is indeed due to code changes not deployed in production as keyProjectResolutionMode field is not visible. It'll be resolved once the code is deployed.

@github-actions github-actions bot requested a review from shuyama1 January 20, 2026 18:29
@Kartikeyapise Kartikeyapise force-pushed the autokey-project-support branch from 5339af3 to 39f5e82 Compare January 20, 2026 18:30
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 20, 2026
@Kartikeyapise Kartikeyapise force-pushed the autokey-project-support branch from 9c4e88f to d681fc5 Compare January 20, 2026 18:42
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 22, 2026
@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, 381 insertions(+), 156 deletions(-))
google-beta provider: Diff ( 4 files changed, 440 insertions(+), 223 deletions(-))
terraform-google-conversion: Diff ( 7 files changed, 96 insertions(+), 370 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 50
Passed tests: 40
Skipped tests: 6
Affected tests: 4

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsAutokeyConfig_basic
  • TestAccKMSAutokeyConfig_kmsAutokeyConfigFolderExample
  • TestAccKMSAutokeyConfig_kmsAutokeyConfigProjectExample
  • TestAccKMSKeyHandle_kmsKeyHandleBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataSourceGoogleKmsAutokeyConfig_basic [Error message] [Debug log]
TestAccKMSAutokeyConfig_kmsAutokeyConfigFolderExample [Error message] [Debug log]
TestAccKMSAutokeyConfig_kmsAutokeyConfigProjectExample [Error message] [Debug log]
TestAccKMSKeyHandle_kmsKeyHandleBasicExample [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

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