Closed
Description
Terraform Core Version
1.7
AWS Provider Version
5.82
Affected Resource(s)
aws_iam_policy_document
Expected Behavior
We should not blanket apply plan time validation against the SID because each service may have it's own policies on allowed characters. This is a breaking change.
Actual Behavior
We blanket apply the plan time validation against the SID.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
resource "aws_kms_key" "name" {
description = "something"
policy = data.aws_iam_policy_document.name.json
}
data "aws_iam_policy_document" "name" {
version = "2012-10-17"
statement {
sid = "Allow spaces"
effect = "Allow"
actions = [
"kms:Decrypt"
]
resources = ["*"]
}
}
Steps to Reproduce
Create an IAM policy document resource, have the SID include spaces
Attach the policy as a KMS policy
Debug Output
│ with aws_iam_policy_document.name,
│ on file line X, in data "aws_iam_policy_document" "name":
│ line#: sid = "Allow spaces"
Panic Output
No response
Important Factoids
No response
References
https://github.com/hashicorp/terraform-provider-aws/blob/main/CHANGELOG.md
https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-overview.html
Would you like to implement a fix?
No