Skip to content

madisonjordan/aws-bootcamp-cruddur-2023

Repository files navigation

FREE AWS Cloud Project Bootcamp

  • Application: Cruddur
  • Cohort: 2023-A1

Cruddur Graphic

Cruddur Screenshot

Journaling Homework

The /journal directory contains

Instructions

Local Environment (Development)

The local environment uses a local Postgres container for users and their activities.

  1. Set env variables in backend-flask[.erb,.env] and frontend-react-js[.erb,.env]:
    • update CONNECTION_URL in the backend-flask scope to use your local postgres container url
    • update AWS_ENDPOINT_URL in the backend-flask scope to use http://host.docker.internal:8000/ if you are running on a local machine outside of gitpod
  2. Run docker-compose.yaml from the project root
  3. Run the Postgres database setup script to create the database, tables, seed users and activities, and update seeded users' UUIDs from Cognito
  4. Run the DynamoDB schema-load and seed scripts to created seed conversations between the seeded users

Production Environment

The production environment uses RDS (Postgres) for users and their activities.

  1. If user and activities tables DO NOT EXIST in the RDS, run the Postgres database schema-load script with prod as the first argument to initialize the tables in the RDS
  2. If the backend-flask and frontend-react-js services are NOT deployed to ECS, create the services from the json files.
aws ecs create-service --cli-input-json file://aws/json/service-backend-flask.json
aws ecs create-service --cli-input-json file://aws/json/service-frontend-react-js.json

If the service's task definitions DO NOT EXIST, you must create them

aws ecs register-task-definition --cli-input-json file://aws/task-definitions/backend-flask.json
aws ecs register-task-definition --cli-input-json file://aws/task-definitions/frontend-react-js.json

Troubleshooting

Local:

  • Check container logs
  • Inspect on browser using Developer Tools

AWS Production:

  • Check logs from the deployed services on CloudWatch
  • Connect to the ECS task and check whether functions can run and if any errors are displayed
  • Check security groups and inbound rules on each of the services used (eg. ALB, EC2, RDS) for connectivity issues between them
  • Inspect on browser using Developer Tools