-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Don't mark non SecureString SSM parameters as sensitive #9090
Comments
Possible workaround (won't be suitable for all circumstances): duplicate the value as a tag. eg.
While |
I see the |
Bumping this, since it seems like nothing has happened for quite a while. I was surprised to see regular string parameters marked as "sensitive" today. They shouldn't be. The idea of parameter store is to store variables that are different per account, environment, or region. If you need to store secrets, it should be using |
This is causing an error with Terraform 0.15 I have a "String" SSM parameter whose value is used in an output value. With Terraform 0.14 this worked, but with Terraform 0.15 it fails with the following message:
Edit: I added
|
Hi @zachwhaley 👋 A fix to the output "example" {
value = nonsensitive(aws_ssm_parameter.example.value)
} |
This also impacts the data source - had to flag the whole thing when reading a remote value, eg: data "aws_ssm_parameter" "users" {
name = "/foo/users"
}
locals {
users = split(",", nonsensitive(data.aws_ssm_parameter.users.value))
} was having some random |
Having looked into the code of the aws provider plugin and the SDK module it depends on, this is caused by a limitation of the SDK which does not allow the sensitivity of data & resource attributes (like in our case, the value attribute of both the data.aws_ssm_parameter and resource.aws_ssm_parameter) to be set dynamically. So you can either have the values of all the parameters treated as a sensitive value, or none of them. It is not possible to set sensitivity dynamically (e.g. depending on the type of the parameter) which would require the Terraform SDK to be modified for this to be possible. |
How about having entirely different resources for SecretString and String? While that may require a one-time refactor for most of us, it does allow to continue using SSM without so many hacks. Keep in mind that AWS uses SSM for public information, like the ID of the AMI recommended for ECS. SSM is far from being all secrets: it's used to publish data too. |
Alternatively, I think we could also use a separate attribute (e.g. secure_value) when working with SSM parameters of the type SecureString. I think this would also work and avoid duplicating the entire code for data.aws_ssm_parameter and resource.aws_ssm_parameter. |
Unnecessarily marking all ssm parameters as secure is giving me below error when I tried to use a complex structure containing ssm parameter as for_each expression for a module. Sensitive values, or values derived from sensitive values, cannot be used as for_each arguments. If used, the sensitive value could be exposed as a resource instance key. |
@srinivas-vangari You have to add This regression has been terrible, but I guess nobody has the expertise to do something no-that-complex like #9090 (comment). |
Same issue as @srinivas-vangari and marking password as nonsensitive means it's part of plan and state, not acceptable to my TL. Error: Invalid dynamic for_each value Update: - I upgraded to 0.15.5 and seems to be fine for me. Looked at the release notes and the issue I am seeing is fixed in 0.15.4 |
This was preventing `for_each` to use the list of objects in a `dynamic` block. This seems to be a (maybe intentional) bug [[1][]], [[2][]], [[3][]], though the error message wasn't particularly helpful [1]: hashicorp/terraform#28384 [2]: hashicorp/terraform-provider-aws#9090 [3]: hashicorp/terraform-provider-aws#9090 (comment)
This functionality has been released in v4.22.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
Plans including changes to
aws_ssm_parameter
values currently mask the changes, due to thevalue
field being defined as sensitive.SSM parameters support a
type
param to define whether a value is aString
or aSecureString
.Would it be possible for
value
to only be considered sensitive iftype == "SecureString"
? This would make it easier to grok planned changes of non-secret configuration values without needing to manually verify the changes outside of Terraform.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform apply
terraform plan
type = String
parameter is maskedThe text was updated successfully, but these errors were encountered: