Skip to content

Please update this provider to work with ephemeral resources and write-only attributes #532

@allanwilson

Description

@allanwilson

In order to help keep passwords out of the state file it would be great to have support for ephemeral resources and write-only attributes.

Example:

ephemeral "random_password" "role_password" {
length = 16
special = true
override_special = "~!#$%^&*()_-+={}[]<>,.;?:"
}

resource "postgresql_role" "role_dev" {
name = "dev"
login = true
create_database = true
password = ephemeral.random_password.role_password.result
inherit = false

lifecycle {
prevent_destroy = true
}
}

Note: password would be password_wo in postgresql_role resource.

Current state using version 1.25 of provider:

│ Error: Invalid use of ephemeral value

│ with postgresql_role.role_dev,
│ on create_pg_roles.tf line 129, in resource "postgresql_role" "role_dev":
│ 129: password = ephemeral.random_password.role_password.result

│ Ephemeral values are not valid for "password", because it is not a write-only attribute and must be persisted to state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions