-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
FR: aws_organizations_account account closure with all SCP's detached causes error. #26797
Comments
I don’t have the provider error so can’t see exactly where it’s happening. Assuming it’s coming from |
The error is in the initial request. Here is a snippet from the log.
|
This functionality has been released in v4.56.0 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! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
As a practice, upon account creation, all policies are attached through Terraform while removing
FULLAWSAccess
using a provisioner. When Terraform tries to destroy the account it first tries to destroy resourceaws_organization_policy_attachment
and hence tries to detach all SCPs one by one, but fails to detach the last SCP from account as AWS does not allow detaching the last SCP from account.This results in the following error:
Is there a way or switch outside of manually manipulating the state that will not attempt to detach all SCP's prior to deleting the
aws_organizations_account
?Can there be a dependency such that resource "aws_organizations_policy_attachment" is destroyed after resource "aws_organizations_account" "account" is destroyed? At which point we do not care about deployment error given account is already closed.
References
The text was updated successfully, but these errors were encountered: