Here's a link to share on Lucid Chart
From within my GitPod terminal, i did the following:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
==> download the binary files & save it as awscliv2.zipunzip awscliv2.zip
sudo ./aws/install
To configure User Credentials via the CLI, i Change the values and export at the terminal link this :
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_DEFAULT_REGION=us-east-1
Then, to verify if it's work, we can do aws sts get-caller-identity
:
To avoid having to reconfigure our environment variables every time Gitpod was launched, we made sure to save them in the software configuration. To do this, we use the script from Andrew Brown's repo which aws-cli is installed and set the cli prompt to auto-complete :
tasks:
- name: aws-cli
env:
AWS_CLI_AUTO_PROMPT: on-partial
init: |
cd /workspace
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
cd $THEIA_WORKSPACE_ROOT
Then, to persist update on cloud environment : gp env <AWS_ENV_VARIABLE>=<AWS_VALUE>
To create Budget via AWS CLI, we based ourselves on the CLI Documentation
We persist the Account ID variable using: gp env AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
. After creating the respective json
files for the budget and notification, you can run this command in terminal:
aws budgets create-budget \
--account-id $AWS_ACCOUNT_ID \
--budget file://aws/json/budget.json \
--notifications-with-subscribers file://aws/json/budget-notifications-with-subscribers.json
To create a topic, use aws sns create-topic --name evebootcamp-billing-alarm. You must then register to receive a notification. To subscribe, use:
aws sns subscribe \
--topic-arn="arn:aws:sns:us-east-1:<your_acct_id>:<your_topic_name>" \
--protocol=email \
[email protected]
Using this json file, we will be updating the arn
section. Then, do the aws cloudwatch put-metric-alarm --cli-input-json file://aws/json/alarm_config.json
command to set up the alarm :