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

Added is_secret_data_base64 field to google_secret_manager_secret_version #8873

Conversation

abheda-crest
Copy link
Contributor

Added the is_secret_data_base64 field to the google_secret_manager_secret_version resource
fixes hashicorp/terraform-provider-google#10129

Release Note Template for Downstream PRs (will be copied)

secretmanager: added `is_secret_data_base64` field to `google_secret_manager_secret_version` resource

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will require approval to run.

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

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 6, 2023
google_secret_manager_secret_version
@abheda-crest abheda-crest force-pushed the secret-manager-add-secret-data-base64 branch from 38ff752 to 2c461bc Compare September 6, 2023 06:21
@abheda-crest
Copy link
Contributor Author

Just to clarify, while importing the secret_version resources having the is_secret_data_base64 field set to true, the secret_data is decoded from the base64-encoded string received from API. It is potentially due to the condition of the flattener. It seems the import is working fine when the is_secret_data_base64 is not provided or set to false(again due to the same condition).

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 11, 2023
@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.

Terraform GA: Diff ( 4 files changed, 102 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 4 files changed, 102 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 1 file changed, 3 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3028
Passed tests 2729
Skipped tests: 297
Affected tests: 2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDataprocClusterIamPolicy|TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataprocClusterIamPolicy[Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@abheda-crest abheda-crest marked this pull request as ready for review September 12, 2023 05:12
@abheda-crest
Copy link
Contributor Author

@trodge This PR is now ready for review

Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this field need to be added this way as opposed to being in the yaml properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This field is a terraform-only field that decides whether the secret_data is to be sent as is or after base64-encoding and whether to decode it while flattening. As this field affects the state value of secret_data, we need to keep it ForceNew. The virtual_field property doesn't provide a way to mark the fields immutable. Hence, I've used extra_schema_entry for this purpose.

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 13, 2023
@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.

Terraform GA: Diff ( 4 files changed, 102 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 4 files changed, 102 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 1 file changed, 3 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3043
Passed tests 2745
Skipped tests: 297
Affected tests: 1

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
TestAccDataSourceGoogleServiceAccountIdToken_impersonation

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataSourceGoogleServiceAccountIdToken_impersonation[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set binary secret using google_secret_manager_secret_version
3 participants