Open agargiulo opened 2 years ago
So I did some debugging outside of the steps in the issue here.
It turns out if you JSON encode the string of the raw QR code data from the AWS API response, you get gibberish. if you JSON encode just the raw []byte
slice it base64 encodes it before marshaling it to the JSON object (This might be different for cty but I feel the issue is the same for both and I get similar looking bad PNG data from the native encoding/json
module.
Also, with the data in the format it's in, any time that QR binary data shows up in the plans, it messes with my terminal as it tries to display the binary data as best it can.
I just ran into this issue. Have you found a solution in the end? Unfortunately I don't quite get what the results of your investigation mean.
Good question, what was the fix for this?
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
https://gist.github.com/agargiulo/7a294288f65ae34fa5777f3c5ae086ed
Panic Output
Expected Behavior
The raw output from this should be a valid PNG file.
Actual Behavior
The data saved into the JSON state and then fetched and saved to disk is jumbled badly It sort of resembles a PNG but it's invalid
Steps to Reproduce
terraform apply
Important Factoids
References