Set Up Cloud Environment for AWS¶
This guide will walk you through setting up the necessary environment that you will use throughout your installation to create cloud resources on AWS.
Fast Forward
If you have already set up your AWS environment, expand this box to fast-forward.
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deployments
Retrieve the AWS account ID:
root@rok-tools:~/ops/deployments# export AWS_ACCOUNT_ID=$(aws sts get-caller-identity \ > | jq -r '.Account')
Retrieve the default region for your profile in your AWS CLI configuration:
root@rok-tools:~/ops/deployments# export AWS_DEFAULT_REGION=$(aws configure get region)
(Optional) In case you already have a custom AWS configuration profile you want to use over the default one, export the
AWS_PROFILE
environment variable by replacing<CUSTOM_PROFILE>
with your AWS profile:root@rok-tools:~/ops/deployments# export AWS_PROFILE=<CUSTOM_PROFILE>
Save your state:
root@rok-tools:~/ops/deployments# j2 deploy/env.envvars-aws.j2 -o deploy/env.envvars-aws
Commit your changes:
root@rok-tools:~/ops/deployments# git commit -am "Set Up Cloud Environment for AWS"
Proceed to the Verify section.
Choose one of the following options to set up your cloud environment:
- Option 1: Set Up Cloud Environment for AWS Automatically (preferred).
- Option 2: Set Up Cloud Environment for AWS Manually.
Overview
What You'll Need¶
- An AWS account.
- An AWS IAM username.
- A default region for your profile in your AWS CLI configuration.
- Your clone of the Arrikto GitOps repository.
- A configured AWS CLI.
Option 1: Set Up Cloud Environment for AWS Automatically (preferred)¶
Set up your cloud environment for AWS by following the on-screen instructions
on the rok-deploy
user interface.
If rok-deploy
is not already running, start it with:
root@rok-tools:~# rok-deploy --run-from envvars-aws
Proceed to the Summary section.
Option 2: Set Up Cloud Environment for AWS Manually¶
If you want to set up your cloud environment for AWS manually, follow the instructions below.
Procedure¶
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deployments
Retrieve the AWS account ID:
root@rok-tools:~/ops/deployments# export AWS_ACCOUNT_ID=$(aws sts get-caller-identity \ > | jq -r '.Account')
Retrieve the default region for your profile in your AWS CLI configuration:
root@rok-tools:~/ops/deployments# export AWS_DEFAULT_REGION=$(aws configure get region)
(Optional) In case you already have a custom AWS configuration profile you want to use over the default one, export the
AWS_PROFILE
environment variable by replacing<CUSTOM_PROFILE>
with your AWS profile:root@rok-tools:~/ops/deployments# export AWS_PROFILE=<CUSTOM_PROFILE>
Save your state:
root@rok-tools:~/ops/deployments# j2 deploy/env.envvars-aws.j2 -o deploy/env.envvars-aws
Commit your changes:
root@rok-tools:~/ops/deployments# git commit -am "Set Up Cloud Environment for AWS"
Mark your progress:
root@rok-tools:~/ops/deployments# export DATE=$(date -u "+%Y-%m-%dT%H.%M.%SZ")
root@rok-tools:~/ops/deployments# git tag \ > -a deploy/${DATE?}/release-1.4/envvars-aws \ > -m "Set Up Cloud Environment for AWS"
Verify¶
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deployments
Restore the required context:
root@rok-tools:~/ops/deployments# source <(cat deploy/env.envvars-aws)
root@rok-tools:~/ops/deployments# export AWS_ACCOUNT_ID AWS_DEFAULT_REGION AWS_PROFILE
Obtain your AWS account ID via the AWS CLI:
root@rok-tools:~/ops/deployments# AWS_CONFIG_ACCOUNT_ID=$(aws sts get-caller-identity \ > | jq -r '.Account')
Ensure that the AWS account ID obtained via the AWS CLI matches the value of
AWS_ACCOUNT_ID
:root@rok-tools:~/ops/deployments# [[ ${AWS_ACCOUNT_ID?} == ${AWS_CONFIG_ACCOUNT_ID?} ]] \ > && echo OK \ > || echo FAIL OK
Obtain the default AWS region for your profile in your AWS CLI configuration:
root@rok-tools:~/ops/deployments# AWS_CONFIG_DEFAULT_REGION=$(aws configure get region)
Ensure that the default AWS region obtained via the AWS CLI matches the value of
AWS_DEFAULT_REGION
:root@rok-tools:~/ops/deployments# [[ ${AWS_DEFAULT_REGION?} == \ > ${AWS_CONFIG_DEFAULT_REGION?} ]] \ > && echo OK \ > || echo FAIL OK
(Optional) If you have set a custom AWS configuration profile, inspect
AWS_PROFILE
and verify that it holds the name of your custom AWS profile:root@rok-tools:~/ops/deployments# echo ${AWS_PROFILE?} arrikto-profile
Summary¶
You have successfully configured environment variables that you will later need to generate names for resources.
What's Next¶
The next step is to configure access to Arrikto's private container registry.