Prerequisites
- The Admin role on the folder you’ll add the account to
- Permission to create IAM roles in the AWS account
- Your Infisical organization ID, which you can copy from Organization ID in your organization’s settings
Create an IAM role
Each account assumes one IAM role. The role’s trust policy lets Infisical assume the role only when Infisical sends your organization ID as the external ID, so no other Infisical customer can get Infisical to assume it.1
In AWS, create an IAM role, such as Replace
infisical-pam-readonly, with the following trust policy:<infisical-aws-account-id> with the AWS account that Infisical runs in:2
Attach permission policies to the role. People who access the account get exactly these permissions in AWS.
3
Set the role’s Maximum session duration to cover the longest session you’ll allow, as described in Session duration.
Create an account
1
Go to Privileged Access Management > Accounts and select Add Account.
2
Select the Folder to add the account to and an AWS IAM Account Template, such as the default
aws-iam template, then select Next.3
Enter a Name for the account and the Role ARN of the role you created, such as
arn:aws:iam::123456789012:role/infisical-pam-readonly.4
Select Create.
Session duration
A session lasts for the template’s maximum session duration, unless the person requests a shorter one. AWS rejects a session that’s shorter than 15 minutes or longer than the role’s maximum session duration, so make sure both limits allow the sessions you expect.Connect
To learn how to launch a session, see Connect to an account. In the browser, the session opens the AWS Management Console, signed in as the role. The CLI writes temporary credentials to~/.aws/credentials as a profile named infisical-pam/<folder>/<account>:
AWS_PROFILE to use it for every command:
Ctrl+C to end the session. The CLI then removes the profile.