helkhalfi / modern-cloud-engineering-aws-pulumi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modern Cloud Infrastructure with AWS and Pulumi

This is the companion github repository for the Oreilly live training Modern Cloud Infrastructure with AWS and Pulumi

Install Pulumi

https://www.pulumi.com/docs/get-started/install/

Export you AWS credentials

export AWSAccessKeyId=<your AWS Access Key Id>
export AWSSecretKey=<your AWS Secret Key>

Generates Key pair

ssh-keygen -f customerdb-keypair

Setup dev-2 environment

pulumi stack init dev-2
...

# confirgure global config
pulumi config set env_name dev_2
pulumi config set aws:region us-east-1

# Condigure RDS config
pulumi config set dbName customerdb
pulumi config set dbUsername admin
pulumi config set dbPassword s0meth1ngA32s0me2 --secret
pulumi config set dbInstanceSize db.t3.small

# Configure EC2 config
pulumi config set ec2InstanceSize t3.small
pulumi config set publicKeyPath customerdb-keypair.pub
pulumi config set privateKeyPath customerdb-keypair

Connect to the remote EC2 node, install MySQL client and connect to the RDS MySQL database.

ssh -i customerdb-keypair ec2-user@<ip of the EC2 node>

# Install mysql client on the EC2 node
sudo yum install mysql

# Connect to mysql from the EC2 node
mysql -h <dns_name of the RDS database> -P 3306 -u admin -p

About


Languages

Language:Python 100.0%