-
Notifications
You must be signed in to change notification settings - Fork 160
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
Suppress write-only attributes until properly supported #5215
Comments
@corymhall check if this obviates any work for the recent P1 #5288 - we can possibly remove the patches for wo_ attributes that caused the problem. |
Note from Cory: there are some validators that throw warnings that the user should use write-only attributes that might not be suppressed by the bridge yet. |
Bridge-level fix for pulumi/pulumi-aws#5215. Related to patch issues in pulumi-gcp and pulumi-azure. **NOTE:** Please advise on the shape of our TFPF schema support. I've added WriteOnly to Attribute in my last commit but may be missing some additional locations here. ~This pull request changes the shape of shim.Schema interface to include a `WriteOnly` field, and adds this to all implementations.~ This pull request adds a new schema interface, `SchemaWithWriteOnly`, to the shim package. It then uses this information to set `Omit()` on any variable that has a schema with a WriteOnly field. Of note, the bridge currently does not allow for Omit() to be set on Required fields, so a test is added that asserts the bridge errors if we ever see a filed with both WriteOnly and Required set to true. Since these write-only fields are in practice duplicates of existing (non-write-only) attributes, we believe omitting them for now will allow us to avoid future backcompat issues once we can support write-only fields properly. Wrinkle: AWS adds a few extra attributes that are meant to be used in combination with the new write-only attribute. See here for an example: https://github.com/hashicorp/terraform-provider-aws/pull/40952/files#diff-efb779173f4ffe3da1ab88d2773509d6aead150833362a6159bbee214edafcc4R80 There are three new fields, `has_value_wo`, `value_wo_version`, and our actual write-only field, `value_wo`. This fix does nothing to remove those related fields. I'm not sure it's advisable or even possible to detect these programmatially. One might argue that this is all right, since it's not actually possible to use them without the omitted write-only attribute, but it may lead to user confusion. If we truly do not want these related (currently nonsensical) fields being written to the schema, we can manually set Omit on them in the provider's resources.go config. - **Extend schemaschim to support WriteOnly** - **Set Omit to true when TF schema is WriteOnly**
Fixed in pulumi/pulumi-terraform-bridge#2933. The bridge will now automatically omit attributes with Attributes supporting the write-only-attributes will be needed to manually omitted here in the provider, and we may need to tweak validations once upstream pushes the write-only option harder than a warning/suggestion. |
Cannot close issue:
Please fix these problems and try again. |
We've got a fix but it's not in AWS yet. |
AWS provider is adding write-only attributes (hashicorp/terraform-provider-aws#41314)
The text was updated successfully, but these errors were encountered: