-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
EphemeralWriteOnly: add secretAccessKeyWo
#12967
EphemeralWriteOnly: add secretAccessKeyWo
#12967
Conversation
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo = # value needed
}
}
|
Tests analyticsTotal tests: 1 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
}
|
Tests analyticsTotal tests: 1 Click here to see the affected service packages
🟢 All tests passed! View the build log |
Thanks for the PR, could you share more about this change? Is it in response to an issue or bug or feature request? |
Edit: this has been resolved after coming across: https://cloud.google.com/bigquery/docs/s3-transfer#bq |
0518175
to
fb20012
Compare
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
}
|
Tests analyticsTotal tests: 0 Click here to see the affected service packages
🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR. View the build log |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
}
|
Tests analyticsTotal tests: 0 Click here to see the affected service packages
🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR. View the build log |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
}
|
Tests analyticsTotal tests: 0 Click here to see the affected service packages
🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR. View the build log |
Glad you were able to find the documentation on the field. Is the support for write-only attributes being rolled out to all google-provider (and other providers)? Do I understand correctly that the recommendation is to use the write-only attribute and deprecate the other one over time? I took only a quick glance at https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/write-only-arguments so maybe it's covered there but what happens if user wants to change the value if it's not part of the planning phase? |
Currently there is no way for Terraform to allow you to update a write-only value. The design perspective is that every ephemeral value is different on every action performed by terraform. The current work around though that would allow this would be a sidecar field that's meant for triggering an update on an ephemeral value assuming you are in a case where the ephemeral write-only value itself is in a stable state that doesn't change unless manually triggered by a user. Hope this was clear. On a side note I'll be moving this to the we required the use of |
@@ -40,6 +40,13 @@ for _, sp := range sensitiveParams { | |||
} | |||
} | |||
|
|||
for _, sp := range sensitiveWoParams { | |||
if auth, _ := d.GetRawConfigAt(cty.GetAttrPath("sensitive_params").IndexInt(0).GetAttr(sp)); !auth.IsNull() { | |||
sp = sp[:len(sp)-3] // removes _wo from the end of the param name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a convention that these should always be suffixed "_wo"? Can we communicate it more in the YAML comment or somewhere so people know the name takes part in this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest of the PR LGTM. Wanted to see if you have ideas to make the sp = sp[:len(sp)-3]
part more future-proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it's convention to mark write-only attributes with the _wo
suffix. I can include this as a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment would help, thanks.
Thanks. I'm trying to understand from the user side, if they create a resource with a |
The idea is that write-only attributes are different during every action performed by Terraform. Although some values may stay stable it doesn't allow for identifying whether an update of a value occurred or not. Since write-only attributes can accept ephemeral values, write-only attribute configuration values are not expected to be consistent between plan and apply. So for a typical user they wouldn't need to handle any |
I see thanks. This PR looks good to me, but two more questions on the best use case of write-only fields in general:
|
295493c
to
ba84f7a
Compare
The use-case is more to prevent sensitive information from being stored in state. You can prevent values from beiung shown in the plan with
It does, however we intend to keep both the WriteOnly and non-Writeonly included with their being Validation added to push users to use the new WriteOnly Attribute. The non-writeOnly attribute would be removed in an upcoming major release. This is an example of the validation being shown to users. PR would support Resource Validation to support this: #13048 [this must be merged before we merge this PR] |
3eb6ea6
to
13bcd7f
Compare
mmv1/templates/terraform/validation/bigquery_data_transfer_config.go.tmpl
Outdated
Show resolved
Hide resolved
Thank you for the additional context. I left two in-line comments but the change looks good otherwise. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
sensitive_params_wo_version = # value needed
}
|
7cb5fb1
to
4aa4956
Compare
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
sensitive_params_wo_version = # value needed
}
|
Tests analyticsTotal tests: 1 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key = # value needed
secret_access_key_wo = # value needed
}
sensitive_params_wo_version = # value needed
}
|
Tests analyticsTotal tests: 1 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
recent pushes were just rebasing |
81a26f8
into
GoogleCloudPlatform:FEATURE-BRANCH-ephemeral-write-only
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.