Open cecedille1 opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
I encountered this issue as well recently. On terraform 1.6.3 and aws provider 5.24.0
Moreover the vice-versa is also the case: if ssm param was initially created with "insecure_value", later change to "value" leads to value not being updated anymore, only version gets updated without changes to actual content.
To add to the discussion. Here is a warning message from Terraform logs when applying @cecedille1's snippet.
2023-11-07T13:40:17.180-0500 [WARN] Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_ssm_parameter.foo, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .insecure_value: planned value cty.UnknownVal(cty.String) does not match config value cty.StringVal("NOT SO SECRET")
- .tags: planned value cty.MapValEmpty(cty.String) for a non-computed attribute
- .allowed_pattern: planned value cty.StringVal("") for a non-computed attribute
- .description: planned value cty.StringVal("") for a non-computed attribute
I've had to destroy and re-create to work around this issue.
It also impact the import of a parameter to a resource with an insecure_value.
Terraform Core Version
1.4.0
AWS Provider Version
4.60.0
Affected Resource(s)
aws_ssm_parameter
Expected Behavior
First I create a aws_ssm_parameter with a type "String" and a value set in the
value
attribute, it creates the AWS SSM parameter with the expected content. Then I change the way to provide the content to the aws_ssm_parameter fromvalue
toinsecure_value
. I expect the value of my AWS SSM Parameter to become theinsecure_value
Actual Behavior
The apply succeeds but the value stays with the old secret value.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Initial
Second
Steps to Reproduce
Apply this snippet
In a second step, apply this snippet in the same state
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No