[Enhancement]: aws_iam_policy_document compact formatting. #28939
Description
Description
The current implementation of the aws_iam_policy_document generates nicely formatted json as part of its json
attribute. For most use cases this isn't a bad thing. We ran into trouble recently when moving a policy from a raw JSON string to an aws_iam_policy_document that is near the limit of what is allowed. When implemented as an aws_iam_policy_document the policy becomes longer than the allowable limit. By applying a json decode/encode to the output like jsonencode(jsondecode(data.aws_iam_policy_document.long_policy.json))
we were able to get back under the limit.
Would it be possible/advisable to remove the indenting being applied or would it be possible to add an additional attribute like compact_json
to allow easy access to a more compact representation?
Current pretty formatting is here:
Affected Resource(s) and/or Data Source(s)
- aws_iam_policy_document
Potential Terraform Configuration
No response
References
No response
Would you like to implement a fix?
None