-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
aws_ssoadmin_account_assignment and others won't create because of a failed provisioning #26807
Comments
What I've seem to have found, is that there seems to be quite a strict flow for the aws sso resources.
The parallelism (parallel processing) nature of terraform would sometimes cause problems if it tries to attach policies when a permission set doesn't exist or if a permission set is already assigned to an account and then when you attach policies, it would trigger the ProvisionPermissionSet API Call, due to the way that ssoadmin works for updating permission sets. It can cause unnecessarily large number of API Calls and hit throttling exception. |
version '1.2.7'
Same error , there is only one api call: Oddly in my case: The Issue only arise in ONE account in our organization: Master Account
|
I have seen this error pop up if the target account does not have the permission boundary referenced in the permission set already in the account. |
A temp solution to this is to increase the quota for "managed policies per role": (+ waiting for some time for the quota change to get propagated (even if it says it has been applied)) https://discuss.hashicorp.com/t/unexpected-state-failed-wanted-target-succeeded-last-error-s-nil/42775 |
Note that this error could also be because of a invalid IAM policy. See #31456 |
I encountered a similar issue, and here's how I discovered the solution. My setup:
Steps I followed:
One tricky aspect was that in my setup, the process was failing, but I couldn't find any meaningful CloudTrail logs. Even when using the AWS CLI in debug mode, no errors were apparent. Only when running Terraform in debug mode did I gain insight into what was happening. Please note: When assigning permission sets to the org root account or the SSO management account (which is the same in my case), be sure to add any additional permissions required by the role executing the changes. PS: I encountered 403 errors when I didn't specify the region in the provider. Make sure to specify the same region where your SSO is deployed. |
This functionality has been released in v5.14.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
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
These two resources don't work at all on a new account.
Expected Behavior
Actual Behavior
This same error happens when creating a number of sso-related resources. The docs say that the terraform module attempts to trigger a provisioning when some of them change, which is not possible when the permissions sets were not yet assigned to an account. I feel like this triggers a catch-22 where its impossible to actually use the terraform module without having created stuff manually in the ui before.
The text was updated successfully, but these errors were encountered: