pulumi and AWS

If you are familiar with Infrastructure as code (think Terraform() this will sound familiar to you. I wanted to a very quick test before reading about it more.

Their website tag line is "Infrastructure as code in any programming language"

  • https://github.com/pulumi/examples
  • https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucket/

copy the example files manually

➜ ls main.py NOTES.md Pulumi.website-testing.yaml Pulumi.yaml pycache requirements.txt venv www ➜ ls www favicon.png index.html python.png

using venv for python

➜ source venv/bin/activate ➜ pip install -r requirements.txt Collecting pulumi<4.0.0,>=3.5.1 (from -r requirements.txt (line 1)) ...

NOTE:

  1. Remember your config password in next step.
  2. This is working because I have a default profile in AWS config. Should rather configure for profile.

up

➜ pulumi up Enter your passphrase to unlock config/secrets (set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember): Previewing update (website-testing): Type Name Plan

  • pulumi:pulumi:Stack aws-py-s3-folder-website-testing create
  • ├─ aws:s3:Bucket s3-website-bucket create
  • ├─ aws:s3:BucketPublicAccessBlock public-access-block create
  • ├─ aws:s3:BucketObject index.html create
  • ├─ aws:s3:BucketObject favicon.png create
  • ├─ aws:s3:BucketObject python.png create
  • └─ aws:s3:BucketPolicy bucket-policy create

Outputs: bucket_name: output website_url: output

Resources:

  • 7 to create

Do you want to perform this update? yes Updating (website-testing): Type Name Status

  • pulumi:pulumi:Stack aws-py-s3-folder-website-testing created (4s)
  • ├─ aws:s3:Bucket s3-website-bucket created (3s)
  • ├─ aws:s3:BucketPublicAccessBlock public-access-block created (0.53s)
  • ├─ aws:s3:BucketObject index.html created (0.58s)
  • ├─ aws:s3:BucketObject favicon.png created (0.64s)
  • ├─ aws:s3:BucketObject python.png created (0.72s)
  • └─ aws:s3:BucketPolicy bucket-policy created (0.14s)

check

via 💠 default on ☁️ (us-east-1) ➜ aws s3 ls | grep s3-website 2023-08-19 11:04:21 s3-website-bucket-11a088d

Next Post Previous Post