-
Notifications
You must be signed in to change notification settings - Fork 33
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
account assignment throwing errors in master account only where we have configured SSO service #15
Comments
Hi @pavankumarshambhu, |
Getting this issue also. @pavankumarshambhu / @aurimasmick any fixes? I checked in my case and I was not running into any limits |
Got similar issues described above. Found out using the aws cli it was due to permission errors. It seems the management account does not use the Service principal and thus uses the role/user you are assigned with to create/list/update Saml identity providers required for the account assignment. I've solved it by adding the following permissions to the role running terraform:
You can see the actual error with the following commands
|
@maxvandermeij thanks a lot. "iam:CreateRole", it was missing above permissions in my case. command output which helped in determing it for one of the failed request id aws sso-admin describe-account-assignment-creation-status --instance-arn arn:aws:sso:::instance/$id--account-assignment-creation-request-id $request-id { |
Also worth mentioning that adding account assignments in the Management account requires MFA. So when using AWS cli, in the profile config (in ~/.aws/config) make sure that you have the below: |
module "sso" {
source = "../terraform-modules/sso"
permission_sets = {
}
account_assignments = [
]
}
==============
No issues when i use the module when its trying to create the permission set at first. Issue is only when i am trying to do the account assiggnment is when im seeing this issue. This happens only when trying to create the resources in master account where i have configured the sso service
================
TERRAFORM PLAN OUTPUT
Terraform will perform the following actions:
Terraform will perform the following actions:
module.sso.aws_ssoadmin_account_assignment.this["app_sso_aws_sinch_rtc_finance.master-rtc-finance.797180668684"] will be created
}
module.sso.aws_ssoadmin_permission_set.this["master-rtc-finance"] will be created
}
}
module.sso.aws_ssoadmin_permission_set_inline_policy.this["master-rtc-finance"] will be created
{
+ Statement = [
+ {
+ Action = [
+ "s3:ListBucket",
+ "s3:GetObject",
]
+ Effect = "Allow"
+ Resource = [
+ "arn:aws:s3:::rtc-monthly-invoices",
+ "arn:aws:s3:::rtc-monthly-invoices/",
]
},
+ {
+ Action = "s3:HeadBucket"
+ Effect = "Allow"
+ Resource = ""
},
]
+ Version = "2012-10-17"
}
)
}
Plan: 3 to add, 0 to change, 0 to destroy.
module.sso.aws_ssoadmin_permission_set.this["master-rtc-finance"]: Creating...
module.sso.aws_ssoadmin_permission_set.this["master-rtc-finance"]: Creation complete after 1s [id=arn:aws:sso:::permissionSet/ssoins-6987325f4070a778/ps-d3d988f762fbd9d1,arn:aws:sso:::instance/ssoins-6987325f4070a778]
module.sso.aws_ssoadmin_permission_set_inline_policy.this["master-rtc-finance"]: Creating...
module.sso.aws_ssoadmin_account_assignment.this["app_sso_aws_sinch_rtc_finance.master-rtc-finance.797180668684"]: Creating...
module.sso.aws_ssoadmin_permission_set_inline_policy.this["master-rtc-finance"]: Creation complete after 6s [id=arn:aws:sso:::permissionSet/ssoins-6987325f4070a778/ps-d3d988f762fbd9d1,arn:aws:sso:::instance/ssoins-6987325f4070a778]
╷
│ Error: waiting for SSO Account Assignment for GROUP (9967182253-cbe1a0b4-a479-43f6-9a0e-a8da3523e720) to be created: unexpected state 'FAILED', wanted target 'SUCCEEDED'. last error: %!s()
│
│ with module.sso.aws_ssoadmin_account_assignment.this["app_sso_aws_sinch_rtc_finance.master-rtc-finance.797180668684"],
│ on ../terraform-modules/sso/main.tf line 95, in resource "aws_ssoadmin_account_assignment" "this":
│ 95: resource "aws_ssoadmin_account_assignment" "this" {
The text was updated successfully, but these errors were encountered: