resource/aws_ssm_document: Issues with Document Permissions #5308
Labels
bug
Addresses a defect in current functionality.
service/ssm
Issues and PRs that pertain to the ssm service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Output
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform apply
to create the initial stateterraform apply
to apply the above changesterraform plan
to show above changes were not appliedImportant Factoids
Reviewing the code for resourceAwsSsmDocumentUpdate and setDocumentPermissions, it looks like on resource updates, Terraform only attempts to add AWS Accounts. The AWS API for modifying Document permissions expects a separate list of Accounts to remove.
Also, there appears to be a related issue with removing all sharing permissions. Using the same code above, after removing the permissions block, Terraform detects the changes, but when it's run to apply them, it skips over modifying permissions.
Lastly, it's not possible to delete Documents without explicitly removing sharing permissions. I understand that this is how the AWS API works, but I think updating the provider to automatically remove all permissions on a delete would improve the user experience.
For these latter two issues, I'm happy to open separate issues if that's preferred.
The text was updated successfully, but these errors were encountered: