-
Notifications
You must be signed in to change notification settings - Fork 3.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_secretsmanager crashes on non-string JSON values #10421
Comments
My golang-fu is too weak to know the proper solution here, but I think the offending code is here: https://github.com/hashicorp/packer-plugin-sdk/blob/main/template/interpolate/aws/secretsmanager/secretsmanager.go#L79-L87 |
Yeah, it looks like the template function only supports string values for secrets; the docs should be clearer on this. |
you're right about the location of the issue -- we could probably unmarshal into a map[string]interface{} and cast it into the map[string]string var. |
@SwampDragons I can take a look into this if that's alright |
@SwampDragons I created this PR to address the outlined issue. Please let me know if there's anything that needs to be changed. There is still the question of if this should be changed to return an interface instead of string, but my understanding is that would be a more large scale refactor. |
@SwampDragons This should be able to be closed now that PR is merged. |
Right ! Thanks @teddylear |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Overview of the Issue
An AWS secret manager JSON secret that contains non-string values will cause packer to crash with a go marshaling error:
Reproduction Steps
Steps to reproduce this issue
aws_secretsmanager
function to retrieve a secret in a packer configObserved result: attempting to retrieve any key will throw a JSON marshaling failure.
Packer version
1.6.6
Simplified Packer Buildfile
Operating system and Environment details
Ubuntu 20 amd64
The text was updated successfully, but these errors were encountered: