credential_source - AWS SDKs and Tools


Used within Amazon EC2 instances or containers to specify where the SDK or development tool can find credentials that have permission to assume the role you specify with the role_arn parameter.


Default value: None

Valid values:

You cannot specify both credential_source and source_profile in the same profile.

Ways to set this value

In the following example, apps that use the AWS SDKs or other AWS tools retrieve credentials for the instance's assigned role from the instance's metadata. The app or tool then uses those credentials to assume the role named my-role-name.

Location Supported Example
config file Yes
credential_source = Ec2InstanceMetadata role_arn = arn:aws:iam::123456789012:role/my-role-name
credentials file -
Environment variable -
AWS CLI parameter -

Compatibility with AWS SDKS and tools