Skip to content

goFrendiAsgard/aws-ec2-rds

Repository files navigation

Setup AWS CLI

Follow this guide

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Create Access Key

Follow this guide

TL;DR:

  • Click the right top menu of your AWS console
  • Choose security credentials
  • Create access key
  • Download/write down your access + secret key

Configure AWS

Type aws configure, put the access key and secret key you've seen earlier.

Create ssh key

ssh-keygen -f app-keypair

Create EC2 + RDS instances

Follow this guide

Set configurations:

pulumi config set aws:region ap-southeast-1
pulumi config set publicKeyPath app-keypair.pub
pulumi config set privateKeyPath app-keypair
pulumi config set dbPassword Alch3mist --secret

Set passphrase (we don't use any):

mkdir -p ./pulumiLock
export PULUMI_BACKEND_URL="file://./pulumiLock"
export PULUMI_CONFIG_PASSPHRASE=

Create EC2 and RDS

# pulumi login --local
pulumi up

Show EC2 and RDS address

pulumi stack output

Remote SSH to EC2

ssh -i app-keypair ubuntu@$(pulumi stack output app-eip-public-dns)

Populate RDS

mysql -u admin -pAlch3mist --host <app-rds-address>
# Paste from ./sql

Architecture

Demo

video

References

Glue tutorial

Athena troubleshooting: insufficient permission

About

WIP: AWS EC2 + RDS, using pulumi n Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published