- Create a Github account
- Set up an AWS account
- Create a Pulumi account
We use Github Codespaces for this workshop. To start your Github codespace:
- Open up your browser and log in to Github
- Click the green
Code
button and then theCodespaces
tab - Click
Create codespace on main
After a few moments, a new tab will open with VS code and our environment. Even though it runs in the browser, this environment behaves like you would run it on your local machine.
Important: In order to attend this workshop you need to create your own AWS account. We won't be generating any costs during this workshop. We will also close the account after the workshop is completed.
To create an AWS account, please follow these instructions
Please visit Pulumi sign up page to create an account.
You can also look at the video below.
- Log in with the root user account (see above)
- Go to IAM dashboard
- Select Users on the left side and click Add users button in the top right
- For username, please use the following convention -cloud-workshop e.g. neni-cloud-workshop
- Select both Provide user access to the AWS Management Console and I want to create an IAM user options
- You can untick the Users must create a new password at next sign-in box
- Go to the next page
- Select the Attach policies directly box
- Search and select AdministratorAccess
- Go to the next page
- We won't be adding any tags so we can skip this one
- Review the details and click the Create user button
- Important: Download the
.csv
file with credentials and store it. You won't be able to access this page anymore - Click the newly created user and open the Security credentials tab
- Scroll to the Access keys section and click Create access key
- Select Command line interface (CLI) and check the recommendation box
- We won't be adding any tags so we can skip this one
- Important: Download the
.csv
file with the keys and store it. You won't be able to access this page anymore
You can also look at the video below.
- Open the terminal in your Github codespace
- Run
aws configure --profile <your-zuhlke-shortcode>-cloud-workshop
- Follow the steps and copy the secret and access key from the
<your-zuhlke-shortcode>-cloud-workshop_accessKeys.csv
file. See above step on creating AWS user - For region please key in
ap-southeast-1
- For output name you can skip by pressing
Enter
You can also look at the video below.
- Log in to your Pulumi account
- Click Settings and select Personal access Tokens in the top right menu
- Create a new token and store the token somewhere
- Open the terminal
- Run
npm install
- Run
pulumi login
and pass the token that we just created - Run
pulumi stack
and select create new stack - Name your stack
dev
- Configure Pulumi to use your AWS profile by running and adapting the below command
echo export AWS_PROFILE=<your-zuhlke-shortcode>-cloud-workshop >> ~/.bashrc
source ~/.bashrc
Our infrastructure is located in index.ts
. To deploy it we need to run pulumi up --stack dev
command.
chmod +x deploy-eb.sh
./deploy-eb.sh
This script will create a zip file called web-app.zip
. The zip file then needs to be uploaded to ElasticBeanstalk via AWS console.
chmod +x deploy-s3.sh
./deploy-s3.sh
This script will build your app and deploy it to the bucket.
cd
into src/web-app
and run npm start
.
cd
into src/admin-app
and run npm start
.
To reduce effort in preparing the dev environment we use Github Codespaces. However, you can still run the environment on your local machine. Please read this document on how to do that.
- Run
chmod +x empty-s3-buckets.sh
- Run
./empty-s3-buckets.sh
- Run
pulumi destroy
- Run
pulumi stack rm dev
- Remove Beanstalk bucket manually
- Delete your Github codespace
- Delete your Pulumi account
- Log in as a root user to AWS and close the AWS account