Skip to content

Latest commit

 

History

History
126 lines (99 loc) · 4.66 KB

File metadata and controls

126 lines (99 loc) · 4.66 KB

Week 0 — Billing and Architecture

Required Homework

Watching Video resources

  • I was able to watch all the required videos to gain more insight on the scope of the bootcamp and the scope of the entire project we will be building.

  • I implemented some of the security best practices recommended by Chirag.

Concept and Logical diagrams

  • I had issues with coming up with drawings for this aspect of the homework but I was able to get past the issues when I reached out to fellow bootcampers.

This is my own version of the concept diagram:

cruddur-concept-diagram

This reflects how I understood the project.

I was also able to recreate the Logical Architecture diagram here

cruddur-logical-architecture-diagram

Install and Verify AWS CLI

  • I followed the video resource and was able to get AWS CLI working with gitpod.

  • I did this by updating the .gitpod.yml file with this code block:

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

This code ensures AWS CLI is installed anytime I set up gitpod

  • I was able to set up my aws credentials using the environment variable with these set of commands:
export AWS_ACCESS_KEY_ID="***********"
export AWS_SECRET_ACCESS_KEY="**********"
export AWS_DEFAULT_REGION="us-east-1"
  • To ensure the environment varaibles persisted on gitpod, I ran these commands as well:
gp env AWS_ACCESS_KEY_ID="*************"
gp env AWS_SECRET_ACCESS_KEY="************"
gp env AWS_DEFAULT_REGION="us-east-1"
  • I ran this command to verify AWS CLI was installed and configured correctly:
aws sts get-caller-identity

output:
aws-cli-config

Enabling Billing

  • Using my root account on the AWS Console, on the Billing page, I set up my account to send out billing alerts to my email address.

![Billing page](./week-0-asset/billing-page-showing-alerts-set-up.png)

Creating a Billing Alarm

  • I created a billing alarm as required using the AWS CLI.
  • I did this by setting up an alarm topic - SNS topic, first using this code:
 aws sns create-topic --name billing-alarm

output: sns output

  • I also had to create a SNS subcription for the topic created. I also used the AWS CLI sns sub

  • The subcription required a confirmation via a link sent to my email.


  • I created a .json file alarm-config.json to define the metrics for the alarm.
  • I ran the following command to create the alarm:
aws cloudwatch put-metric-alarm --cli-input-json file://aws/json/alarm-config.json

Below is what it looks like on the AWS Console

billing alarm

Create a Budget

To create the budget, I did the following:

  • On gitpod, I got my Account ID by running the following command:
aws sts get-caller-identity --query Account --output text
  • I saved the output which was my account ID as an environment variable using the first command and persisted it on gitpod using the second command.
export AWS_ACCOUNT_ID="459355284738"

gp env AWS_ACCOUNT_ID="459355284738"
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

aws budget

  • I did not create a second Budget because I was concerned of budget spending going over the 2 budget free limit.
  • Finally, I learnt a great deal about markdown files from writing this one. It was fun to learn about it.