Pulumi series – Lesson 1 – hello world

Tram Ho

Setting

Official installation instructions can be easily found here https://www.pulumi.com/docs/get-started/install/

There are basically 2 main steps

download and install

set env, here I use ubuntu

verified

image.png

done!

Instructions for creating an S3 bucket and deploying a static web to s3

This article is also sourced from the homepage https://www.pulumi.com/docs/get-started/aws/

  1. The first step is to configure the aws account
  • If you don’t know this, you need to find out on google yourself, create an aws account to get access and fill in the secret key

  1. new project:

image.png

If you have a question, please fill it out

project name:

project description:

stack name: this I will explain later

Enter your passphrase to protect config/secrets: passphrase to secure your stack

aws:region: The AWS region to deploy into: us-east-1 (enter the aws region you want)

result:

image.png

requirements.txt => file containing details of packages with versions in the current python environment

folder evenv => this is the folder containing the files of python’s virtual environment

basically, we don’t need to care about these 2 files, pulumi will automatically manage these 2 files for us.

Pulumi.yaml: contains project information

Pulumi.dev.yaml: contains the newly initialized stack information

main.py program content

keep running

image.png

choose yes

image.png

successful, let’s go to s3 and check

image.png

next create the file index.html

then modify main.py

keep running

image.png

successfully updated the index file to the bucket image.png

So basically we know the steps to successfully create s3 bucket with Pulumi as well as update a file into that bucket.

After reading this, you will probably wonder many things like what is pulli login –local then what is stack and many other things, I will explain gradually in the following articles.

Share the news now

Source : Viblo