
Techwondoe Toastmasters: Personal & Professional Growth.
Discover how Techwondoe Toastmasters empowers employees with confidence, leadership, public speaking, and communication skills through engaging and collaborative sessions.
Explore how Pulumi simplifies cloud infrastructure management using modern programming languages and infrastructure as code practices.
Founder & CEO

Founder & CEO
Before we jump into the usage of tool whose purpose is to serve as a universal infrastructure as code solution, we must first understand what exactly is Infrastructure As Code or IaC.
In terms that I understand IaC is a way to manage infrastructure in a more structured and systematic manner. The main advantage I see of going down this path is
It helps keep track of the infrastructure setup we did as part of supporting our application
Helps create environments quicker
Helps keep entire source code not just application specific but infra specific as well in the same place.
The above is my understanding but to get an even more detailed understanding I would recommend checking out the definition Red Hat has posted here
Now that we have formed a bit of understanding let’s have a quick look at some of the most common IaC tools that were used to service this purpose (before Pulumi)
Amongst all this I have worked with the most common providers like Terraform and AWS Cloud formation and both of them have served the purpose they were build for quite well. Obviously terraform is a major player in this space and is highly extensible and most widely solution for managing infrastructure as code.
Now the question if terraform is so great why did I had the urge to explore Pulumi? Well, there are a few reasons as to why I tried out Pulumi
As I personally the best way to explore a new technology or a tool is by giving it a try, let’s try Pulumi. For this example I would be using the following
/.aws/credentials or have exported the key and secret as environment variablesDescription: As part of this project setup we are going to create a simple s3 bucket and attach some policies to it, later as part of other series we might explore a more complicated setup around creating an api gateway with the lambda function.
Now that the environment pre-requisites setup is done, let us get into setting up the project pre-requisites
git clone git@github.com:Techwondoe/pulumi.git
brew install pulumi/tap/pulumi
pulumi --version
Make sure the directory is empty in which you run the following command or else pulumi cli fails
pulumi new aws-python
aws-python is the template combination we are going withap-southeast-2 as my region.app
│ README.md
└───venv
│ └─── bin
│ └─── lib
│ │ ...
│ requirements.txt
│ __main.py__
│ Pulumi.dev.yaml
│ Pulumi.yaml
__main__.py you would a small sample code has already been created for us, which basically by the looks of it would create our bucket"""An AWS Python Pulumi program"""
import pulumi from pulumi_aws import s3
# Create an AWS resource (S3 Bucket) bucket = s3.Bucket('my-bucket')
# Export the name of the bucket pulumi.export('bucket_name', bucket.id)
terraform apply and terraform output# Create an AWS resource (S3 Bucket) https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucket/ bucket = s3.Bucket(resource_name='techwondoe-public-bucket', acl=s3.CannedAcl.PUBLIC_READ,
versioning=s3.BucketVersioningArgs(enabled=True))
public read policy to our bucketdef public_read_policy_for_bucket(bucket_name: str): return json.dumps({ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": "*", "Action": [ "s3:GetObject" ],
"Resource": [ f"arn:aws:s3:::{bucket_name}/*", ]
}]
})
BucketPolicy function defined under s3 resource of pulumi_awsbucket_name = bucket.id bucket_policy = s3.BucketPolicy(resource_name='bucket-policy', bucket=bucket_name,
policy=bucket_name.apply(public_read_policy_for_bucket))
pulumi up
terraform planPreviewing update (dev)
View Live: https://app.pulumi.com/utsav_sharma/app/dev/previews/486d2313-abdb-4dff-900e-385e6795674e
Type Name Plan
+ pulumi:pulumi:Stack app-dev create
+ ├─ aws:s3:Bucket techwondoe-public-bucket create
+ └─ aws:s3:BucketPolicy bucket-policy create
Outputs:
bucket_name: output<string>
Resources:
+ 3 to create
Do you want to perform this update? [Use arrows to move, enter to select, type to filter]
yes
> no details
details to get a more detailed plan output. In this instance I will just apply the changesUpdating (dev)
View Live: https://app.pulumi.com/utsav_sharma/app/dev/updates/1
Type Name Status
+ pulumi:pulumi:Stack app-dev created (4s)
+ ├─ aws:s3:Bucket techwondoe-public-bucket created (3s)
+ └─ aws:s3:BucketPolicy bucket-policy created (0.70s)
Outputs:
bucket_name: "techwondoe-public-bucket-8b455af"
Resources:
+ 3 created
Duration: 7s
pulumi destroy
Destroying (dev)
View Live: https://app.pulumi.com/utsav_sharma/app/dev/updates/3
Type Name Status
- pulumi:pulumi:Stack app-dev deleted
- ├─ aws:s3:BucketPolicy bucket-policy deleted (1s)
- └─ aws:s3:Bucket techwondoe-public-bucket deleted (0.62s)
Outputs:
- bucket_name: "techwondoe-public-bucket-8b455af"
Resources:
- 3 deleted
Duration: 4s
pulumi stack rm
This brings us end to a quick intro around Pulumi, it definitely is something I am super keen to explore further. The first impression has been really good and I feel like this tool is here to stay. Having said that in the next blog I would further go and explore it a bit more as I do have so impeding questions like
And we want also look into a bit more complicated example around setting up an API with Lambda and Api Gateway. But this is all for now.
Key Takeaways
Key Takeaways
End of Article · 6 min

Discover how Techwondoe Toastmasters empowers employees with confidence, leadership, public speaking, and communication skills through engaging and collaborative sessions.

A reflection on continuous learning, personal growth, and the importance of constantly improving technical and professional skills.

Discover how daily stand-ups and continuous communication improve collaboration, transparency, and productivity in Agile software development teams.