Setting AWS Credentials

From NovaOrdis Knowledge Base
Revision as of 20:02, 24 October 2018 by Ovidiu (talk | contribs) (Created page with "=Internal= =Procedure= Provision the API access keys for the Amazon IAM user that will use the API. More details about access keys here: Amazon AWS Security Concepts#API_A...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Procedure

Provision the API access keys for the Amazon IAM user that will use the API. More details about access keys here: Amazon AWS API Access Keys.

Access keys can be specified on command line every time an ec2 command is issued, with:

-aws-access-key or -O
--aws-secret-key or -W 

or by setting the following environment variables:

export AWS_ACCESS_KEY=your-aws-access-key-id 
export AWS_SECRET_KEY=your-aws-secret-key

In case the Java process that is performing the call does not have access to the environment, the credentials may be specified in .aws/credentials:

[default]
aws_access_key_id=...
aws_secret_access_key=...

For more methods of configuring credentials see:

https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-file-format