Additional setup information - AWS SDK for Java
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with AWS services in China.

At Amazon Web Services (AWS), we’re focused on finding ways to improve our products and provide a better customer experience. To do that, we need your feedback. Please take 5 minutes of your time to share insights regarding your experience with Java Spring and your need for Spring integration with AWS.

Click here to take a quick survey

This survey is hosted by an external company (Qualtrics), so the link above does not lead to our website. Please note that AWS will own the data gathered via this survey, and will not share the information/results collected with survey respondents. AWS handles your information as described in the AWS Privacy Notice.

Additional setup information

This topic supplements the information in Setting up the AWS SDK for Java 2.x.

Set up credentials profiles

You can use more than one set of credentials in your application by setting up additional credentials profiles. Like the [default] profile, you can set up custom profiles to use programmatic access keys as credentials or to use temporary credentials.

To configure your own credentials profiles, use the shared credentials and config files. See the snippets below for example usage.

A profile, cloudwatch_metrics , configured in the credentials file to use a programmatic access key as credentials:

[cloudwatch_metrics] aws_access_key_id = your_access_key_id aws_secret_access_key = your_secret_access_key region = us-east-2

A profile, devuser, configured in the config file to use temporary credentials by assuming a role based on an Amazon Resource Name (ARN).

[profile devuser] role_arn = arn:aws:iam::123456789012:role/developers source_profile = dev-user region = us-west-2 output = json

A profile, user1, configured in the credentials file to use AWS single sign-on (SSO) for credentials.

[user1] sso_start_url = sso_region = us-east-1 sso_account_id = 123456789011 sso_role_name = readOnly region = us-west-2

For additional information about configuring the shared credentials and config files, see:

Set an alternate credentials file location

By default, the AWS SDK for Java looks for the credentials file at ~/.aws/credentials. To customize the location of the shared credentials file, set the AWS_SHARED_CREDENTIALS_FILE environment variable to an alternate location.

To set this variable on Linux, macOS, or Unix, use export:

export AWS_SHARED_CREDENTIALS_FILE=path/to/credentials_file

To set this variable on Windows, use set:

set AWS_SHARED_CREDENTIALS_FILE=path/to/credentials_file