AWS Account Connection
Unlike Azure and GCP which use OAuth 2.0 user authentication, AWS uses IAM role assumption for cross-account access. Users configure an IAM role in their AWS account with a trust relationship to the Multi-Cloud Manager’s AWS account, then provide the role ARN to connect.Get AWS Configuration
Response
The Multi-Cloud Manager’s AWS account ID that should be trusted by the user’s IAM role
External ID to use in the IAM role trust policy for additional securityValue:
"multi-cloud-manager-app-v1-secret"Error Responses
500 Internal Server ErrorAdd AWS Account
Request Body
ARN of the IAM role in the user’s AWS accountFormat:
arn:aws:iam::{account-id}:role/{role-name}Example: "arn:aws:iam::987654321098:role/MultiCloudManagerRole"Response
201 Created - SuccessSession Data Created
Array of connected cloud provider accounts, with new AWS account added
Always “aws” for AWS accounts
Display name in format:
"AWS Account ({account_id})"The IAM role ARN provided by user
External ID used for role assumption
AWS account ID extracted from role ARN
Error Responses
400 Bad Request - Missing Role ARN- IAM role doesn’t exist
- Trust policy doesn’t allow the Multi-Cloud Manager account
- External ID doesn’t match
- Insufficient permissions
AWS Connection Flow
Step 1: Get Configuration
Client callsGET /api/account/aws/config to retrieve:
- Multi-Cloud Manager’s AWS account ID
- External ID for trust policy
Step 2: User Creates IAM Role
User creates an IAM role in their AWS account with: Trust Policy:Step 3: Add Account
Client callsPOST /api/account/aws/add with role ARN.
Step 4: Role Assumption and Verification
Backend performs the following steps:-
Assume the role using STS:
-
Extract temporary credentials:
-
Verify permissions by calling EC2 DescribeRegions:
-
Extract account ID from role ARN:
- Create account object and add to session
-
Update session accounts:
- If account with same role ARN exists, update it
- Otherwise, append new account
Account Management
Duplicate Prevention: If an AWS account with the same role ARN already exists in the session, it will be updated instead of creating a duplicate. Security: The external ID provides additional security by preventing confused deputy attacks. The user’s IAM role should require this specific external ID in the trust policy.Environment Configuration
The following environment variables must be configured:Access key ID for Multi-Cloud Manager’s AWS account (server credentials)
Secret access key for Multi-Cloud Manager’s AWS account
AWS account ID of Multi-Cloud Manager (used in trust policies)
Code Reference
Implementation inbackend/auth/aws_auth.py:15-98
External ID constant: