-
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
[Bug]: SID validation at plan time is invalidly applied to ALL policies #40639
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Who let the intern push to production? |
Not too sure why this is considered invalid 🤔 |
@asvinours react with a thumbs up to OP please to help get this escalated - #40639 (comment) |
Relates #40562. |
We've encountered the same issue just now, which blocked our deployments as we have some older For now, we're using the following workaround, hope this helps anyone who might face the same issue: terraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
# TODO: this is temporary to fix the following error, we should eventually fix our SID to make them alphanumeric
# https://github.com/hashicorp/terraform-provider-aws/issues/40639
# https://github.com/hashicorp/terraform-provider-aws/pull/40562
version = "5.81.0"
}
}
} |
AWS Key Management Service documentation, Creating a key policy, Key policy format:
KMS policy Sids can include spaces, and there are dozens of examples of KMS policy Sids with spaces throughout AWS documentation. |
This is a temporary workaround for active releases, this issue will continue to affect clients which deploy tagged old releases with |
My apologies for the inconvenience with this. We used the regex AWS provides for the SID but that does not seem to match with the reality of usage. We will work on a fix for this right away! |
I put together a PR to revert this change: #40640 Landing + tagging a new minor version should mitigate issues users pinned to a major version are seeing. |
I already started renaming stuff, only to realize how many more I have to change, and the stress that this causes on what was supposed to be a chill morning before the holidays... should I just wait for the provider to get updated? My team is waiting to hear back on this hot fix going out... |
Just set the AWS provider version to exactly 5.81.0. See the above comment #40639 (comment) |
thanks, that makes sense... sorry for the vent, this was so unexpected |
We used the regex that AWS provides for valid IAM Sids but, obviously, we're seeing how much this is used outside of IAM. Again our apologies for the problems this is causing! We will have a fix soon. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.82.1 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. Thank you! |
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
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
The text was updated successfully, but these errors were encountered: