exo Verified current stable Not installed? Cloud Infrastructure

Exo / Create New Api Key

Create New Api Key

Create a new API key associated with a specified IAM role using the Exo CLI.

$
Terminal
exo iam api-key create <api_key_name> <iam_role_name>

When To Use

When setting up access for a new application module requiring API integration with specific role privileges.

Pro Tip

Use a strong naming convention for your API key to prevent conflicts and help with management, and ensure that you rotate keys periodically.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
exo iam api-key create <api_key_name> <iam_role_name>

Anatomy of Output

Understanding the result

API key created successfully: abc123xyz Creation Status

Confirms that the API key is successfully generated.

Associated IAM Role: UserRole Role Association

Displays which role the key is tied to.

Key expiration date: 2024-10-01 Expiration Info

Indicates when the key will expire.

Troubleshooting

Common pitfalls

Error: IAM role not found.

Solution: Check the spelling of the IAM role name or verify that it exists.

Error: API key name already exists.

Solution: Choose a different name for the API key; names must be unique.

Error: Insufficient permissions to create API key.

Solution: Ensure your user/role has the 'iam:CreateApiKey' permission.

Command Breakdown

What each part is doing

exo
Base Command
The executable that performs this operation. Here it runs Exo before the shell applies any redirect operators.
<api_key_name>
api key name
The value supplied for api key name.
<iam_role_name>
iam role name
The value supplied for iam role name.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.