Skip to content

HuckStream/ky-python-workshop

Repository files navigation

ky-workshop-python

Workshop example deploying an VPC, S3 Bucket, RDS Aurora PostgreSQL, and EC2 instances to AWS using Python

Step 0 - Setup

Pulumi Cloud

Accept invite to Pulumi Cloud organization and login to dashboard

AWS SSO

Log into AWS SSO via the start URL and verify access to account

Stack Configuration

  • Find your username, i.e. bcenter

  • Set required configuration:

    pulumi config set aws:region us-east-1
    pulumi config set namespace your-namespace
    pulumi config set name your-username
    pulumi config set my_ip your-public-ip
    pulumi config set vpcStack vpc-stack-name
  • Create stack

    pulumi stack init your-username
  • Select stack

    pulumi stack select your-username

Step 1 - Using Stack References & Outputs

  • Uncomment code related to Step 1 in __main__.py

  • Run update

    pulumi up
  • Verify update successful in Pulumi Cloud

Step 2 - Deploy VPC

  • Uncomment code related to Step 2 in __main__.py

  • Run update

    pulumi up
  • Compare resource graph in Pulumi Cloud to AWS Console

Step 3 - Deploy Ping Instances

  • Uncomment code related to Step 3 in __main__.py

  • Run update

    pulumi up
  • Connect to main vpc private ping instance using SSM connect

  • Verify network connectivity between instances

Step 4 - Deploy Encrypted S3 Bucket

  • Uncomment code related to Step 4 in __main__.py

  • Run update

    pulumi up
  • Connect to main vpc private ping instance using SSM connect

  • Create a test file

    echo "your-username" > test.txt
    
    aws s3 cp \
      test.txt \
      s3://huckstream-wksp-your-username/test.txt \
      --sse aws:kms \
      --sse-kms-key-id alias/huckstream-wksp-your-username
  • Get version ID from AWS console e.g. 86BPXBR7RHyN7ZlgSGF3sesAZlPSEwxO

  • Delete test file

    aws s3api delete-object \
      --bucket huckstream-wksp-your-username \
      --key test.txt \
      --version-id 86BPXBR7RHyN7ZlgSGF3sesAZlPSEwxO

Step 5 - Deploy Database

  • Uncomment code related to Step 5 in __main__.py

  • Run update

    pulumi up
  • Connect to the RDS Aurora PostgreSQL database using the connection details from Pulumi outputs

  • Verify database connectivity and configuration in AWS Console

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages