Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active January 18, 2022 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vfarcic/bcc3f1bb064f7d7d12cf46aebce81edb to your computer and use it in GitHub Desktop.
Save vfarcic/bcc3f1bb064f7d7d12cf46aebce81edb to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/bcc3f1bb064f7d7d12cf46aebce81edb
############################################################
# Pulumi #
# Infrastructure as Code (IaC) Using Programming Languages #
# https://youtu.be/oE3BUi_N0qc #
############################################################
#########
# Setup #
#########
# Follow the instructions from https://www.pulumi.com/docs/get-started/install/ if using Windows or Linux
brew install pulumi
# The instructions are for Google Cloud.
# The commands that follow would need to be changed if using a different Cloud provider
export PROJECT_ID=dt-$(date +%Y%m%d%H%M%S)
gcloud projects create $PROJECT_ID
open "https://console.cloud.google.com/billing/linkedaccount?project=$PROJECT_ID"
# *LINK A BILLING ACCOUNT*
rm -rf tmp
##########################
# Creating a new project #
##########################
mkdir tmp
cd tmp
pulumi new --help
echo $PROJECT_ID
pulumi new gcp-go
cat main.go
pulumi stack rm dev
cd ..
######################
# Creating a cluster #
######################
git clone https://github.com/vfarcic/pulumi-demo.git
cd pulumi-demo
pulumi config set gcp:project $PROJECT_ID
cat main.go
pulumi stack init
cat main.go
pulumi up
pulumi destroy
gcloud projects delete $PROJECT_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment