AWS Environment Variables

Adding an AWS account to your track also sets a list of environment variables that you can use in commands and scripts:

Environment variable

Description

INSTRUQT_AWS_ACCOUNTS

A comma-separated list of project names that can be used to fill ${NAME} in the variables below

INSTRUQT_AWS_ACCOUNT_${NAME}_ACCOUNT_NAME

This injects the account display name

INSTRUQT_AWS_ACCOUNT_${NAME}_ACCOUNT_ID

This injects the account ID

INSTRUQT_AWS_ACCOUNT_${NAME}_USERNAME

This injects the username that can be used to sign in to the IAM user

INSTRUQT_AWS_ACCOUNT_${NAME}_PASSWORD

This injects the password that can be used to sign in to the IAM user

INSTRUQT_AWS_ACCOUNT_${NAME}_AWS_ACCESS_KEY_ID

This injects the access key id for this account

INSTRUQT_AWS_ACCOUNT_${NAME}_AWS_SECRET_ACCESS_KEY

This injects the secret access key for this account

INSTRUQT_AWS_ACCOUNT_${NAME}_ADMIN_USERNAME

This injects the username that can be used to sign is as the admin IAM user (Admin credentials are only injected into lifecycle scripts)

INSTRUQT_AWS_ACCOUNT_${NAME}_ADMIN_PASSWORD

This injects the password that can be used to sign in as the admin IAM user (Admin credentials are only injected into lifecycle scripts)

INSTRUQT_AWS_ACCOUNT_${NAME}_ADMIN_AWS_ACCESS_KEY_ID

This injects the admin access key id for this account (Admin credentials are only injected into lifecycle scripts)

INSTRUQT_AWS_ACCOUNT_${NAME}_ADMIN_AWS_SECRET_ACCESS_KEY

This injects the admin secret access key for this account (Admin credentials are only injected into lifecycle scripts)

Example

This example shows the id of the AWS account from a terminal by using two environment variables. The value of the INSTRUQT_AWS_ACCOUNTS environment variable is inserted in the INSTRUQT_AWS_ACCOUNT_${NAME}_ACCOUNT_ID environment variable.

To follow along:

  1. Start your AWS account track and start the first challenge.

  2. Move over to the Cloud CLI terminal and enter the following command:

    eval echo "\${INSTRUQT_AWS_ACCOUNT_${INSTRUQT_AWS_ACCOUNTS}_ACCOUNT_ID}"

    ↳ The terminal shows the id of your AWS account project.

Last updated

Was this helpful?