Skip to content

Latest commit

 

History

History
91 lines (80 loc) · 2.83 KB

File metadata and controls

91 lines (80 loc) · 2.83 KB

Workshop Environment Setup

Prerequisites

  • Launch devcontainer based devcontainer.json file. (If you VSCode then 'Ctrl + P (Win)'/'Cmd + P (MacOS)': > Reopen folder in Container).
  • You can customize the IDE libraries, extensions, and settings in the devcontainer.json file.
  • You can also customize the Dockerfile in the .devcontainer folder.

Install nvm

Link: NVM Repo

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Install cdk

npm install -g aws-cdk

Change Directory to 'workshop-2'

cd workshop-2

Setup AWS CLI Profile

  • Create a new AWS CLI profile (You can skip this step if you had configured a profile).
aws configure --profile <PROFILE_NAME>
  • Test the configured profile with this command.
aws s3 ls --profile <PROFILE_NAME>

Init CDK

cdk bootstrap

Install Dependencies

# Install dependencies
npm install

Initialize environment variables

  • Create a .env file in the root of the project.
# Copy the .env.example file to .env
cp .env.example .env
  • Update the .env file with the appropriate values.
  • Expose the environment variables to the shell.
# Expose the environment variables to the shell
export $(grep -v '^#' .env | xargs)

Import API Collection

  • Import Postman Collection in folder docs/api
  • Import Postman Environment in folder docs/api

Repository Structure

|-- .devcontainer               # VSCode devcontainer configuration
|   |-- Dockerfile              # Dockerfile for devcontainer
|   |-- devcontainer.json       # VSCode devcontainer configuration
|-- workshop-2                  # Workshop 2 root folder
|   |-- README.md               # Workshop 2 README
|   |-- .env.example            # Environment variables example
|   |-- .env
|   |-- .gitignore
|   |-- cdk.json                # CDK configuration
|   |-- package.json            # NPM package configuration
|   |-- tsconfig.json           # Typescript configuration
|   |-- bin                     # CDK Entrypoint
|   |-- cdk.outs                # CDK outputs
|   |-- docs                    # Workshop 2 documentation
|   |-- lib                     # Construct Libraries
|   |   |-- component           # Common Components
|   |   |-- book-stack.ts       # Book Nested Stack
|   |   |-- cognito-stack.ts    # Cognito nested stack
|   |   |-- order-stack.ts      # Order Nested Stack
|   |   |-- main.ts             # Main Stack
|   |-- src                     # Source code
|   |   |-- books               # Books lambda functions
|   |   |-- reviews             # Reviews lambda functions
|   |   |-- orders              # Orders lambda functions
|   |   |-- requirements.txt    # Python dependencies
|   |-- test                    # Unit tests