Skip to content

aws-profile

The AWS CLI resource reference. This resource will install the latest version of AWS CLI v3.

Parameters:

  • awsAccessKeyId: (string) The access key id from AWS to use for the profile. The aws-profile resource requires either awsAccessKeyId and awsSecretAccessKey or csvCredentials to be specified.

  • awsSecretAccessKey: (string) The secret access key to be added to the profile.

  • csvCredentials: (string) Instead of passing in credentials in plaintext, a csv credentials file path can be used instead. Both relative and absolute paths are supported.

  • profile: (string, required) The profile to configure

Dependencies

The aws cli must be installed before aws-profile can be used.

Example usage:

codify.json
[
{ "type": "aws-cli" },
{
"type": "aws-profile",
"profile": "sandbox",
"csvCredentials": "~/Documents/rootkey.csv"
},
// Multiple profiles can be specified
{
"type": "aws-profile",
"profile": "production",
"awsAccessKeyId": "AKIA...",
"awsSecretAccessKey": "adADSjsada..."
}
]

Setting up AWS CLI locally

Basic instructions for getting AWS CLI up and running locally using Codify.

  1. Login to your AWS environment and navigate to IAM > Security credentials

  2. Under the access keys section click Create access key. Note that it is not recommended to create access keys for the root account.

  3. On the Retrieve access key page, click Download .csv file.

  4. Apply the following codify.json file to install AWS CLI with that account as the default profile.

codify.json
[
{ "type": "aws-cli" },
{
"type": "aws-profile",
"profile": "default",
"csvCredentials": "path/to/csv/file.csv"
}
]