-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
aws_ssm_parameter
does not support changing type from SecureString => String
#9843
Comments
Hi. I have created a pull request because I was bothered by the same thing. Thanks. |
This also happens when you do specify the |
Faced the same issue, would be happy to have this on board. |
…o String (#9843) (#10819) Output from acceptance testing: ``` --- PASS: TestAccAWSSSMParameter_disappears (14.20s) --- PASS: TestAccAWSSSMParameter_fullPath (20.62s) --- PASS: TestAccAWSSSMParameter_secure (21.53s) --- PASS: TestAccAWSSSMParameter_basic (21.98s) --- PASS: TestAccAWSSSMParameter_updateDescription (34.06s) --- PASS: TestAccAWSSSMParameter_changeNameForcesNew (34.44s) --- PASS: TestAccAWSSSMParameter_updateType (35.23s) --- PASS: TestAccAWSSSMParameter_overwrite (36.26s) --- PASS: TestAccAWSSSMParameter_Tier (46.00s) --- PASS: TestAccAWSSSMParameter_tags (48.53s) --- PASS: TestAccAWSSSMParameter_secure_with_key (51.77s) --- PASS: TestAccAWSSSMParameter_secure_keyUpdate (69.76s) ```
The fix for this has been merged and will release with version 2.47.0 of the Terraform AWS Provider, Thursday next week. Thanks to @chroju for the implementation. 👍 |
This has been released in version 2.47.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 for triage. Thanks! |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform v0.11.13
Affected Resource(s)
Terraform Configuration Files
This is the original TF code that generated the resource to begin with.
The issue comes up when I update that code to be the following:
The only change is the
type
.Debug Output
I'm going to skip the debug output here, unless requested. The root cause is
relatively plain to see, and the incidence of this I'm working with locally
contains secret values.
Panic Output
Expected Behavior
I would expect that the SSM parameter type would be updated to the String type,
as supported by the SSM
put-parameter
API.Actual Behavior
The provider forwards along the original
key_id
value originally set by TF(
alias/aws/ssm
by default). However, that value should not be included in theAPI request for a
String
type, onlySecureString
. So the AWS API complains,and does not update the parameter.
The result is the error seen here:
Steps to Reproduce
terraform apply
of original resource code above.terraform apply
again.Important Factoids
I think that the fix for this may be as simple as modifying this conditional:
https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_ssm_parameter.go#L214
I think it should only set the keyID on the request If, and only If, the
Type
on the request is
SecureString
.The
PutParameter
API call does support updating the type from SecureString toString, but it will always complain if
key_id
is set in the request but thetype is not
SecureString
.References
The text was updated successfully, but these errors were encountered: