-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ability to authenticate with config profiles or custom session credentials #45
Comments
Hi @Tochey , thanks for this message. Control tower does not expose an official API yet and that is the whole point of this library, to provide an api. That means that the way to authenticate with control tower is to piggyback on the web front end authentication so our only option is roles that can be assumed by the logged in user with his/hers/theirs credentials. I hope this makes sense. If I misunderstood something please let me know. |
Does I log into my management account using the AWSAdministratorAccess role generated by Identity Center. When I try to use the ARN of that role, I get an InvalidCredentials error. tower = ControlTower("arn:aws:iam::111111111111:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_AWSAdministratorAccess_aaaaaaaaaaaaaaaa")
That makes sense because the role cannot assume itself. But I don't understand why a new role assumption is necessary. The workaround for now is to create an extra stack in my management account with a role whose trust policy allows it to be assumed by the AwsApiLibRole:
Type: AWS::IAM::Role
Properties:
RoleName: AwsApiLib
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
AWS: arn:aws:iam::111111111111:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_AWSAdministratorAccess_aaaaaaaaaaaaaaaa)
Action: sts:AssumeRole
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AdministratorAccess" When that resource is created I can use the ControlTower class like this: tower = ControlTower("arn:aws:iam::111111111111:role/AwsApiLib") But as @Tochey says it would be more convenient to use the existing session. |
Correct me if i am wrong but the only way of authenticating with control tower and other services is by a role arn which then uses your configured default aws profile to assume the role. It would be great to have other methods of authenticating with these services like config profiles and even custom session credentials. ex : {"sessionId": "", "sessionKey": "", "sessionToken": ""}
The text was updated successfully, but these errors were encountered: