top of page
Search

Pulumi Tutorial: Provisioning a GCP Bucket

  • Writer: Mohammed  Juyel Haque
    Mohammed Juyel Haque
  • Dec 2, 2024
  • 2 min read

Updated: Apr 4

Welcome to the first session of our Pulumi Tutorial series! In this post, you'll learn how to create a Google Cloud Platform (GCP) bucket using Pulumi with Python. I'll cover everything from setting up the tools to deploying infrastructure. Let's dive in! 🚀



Prerequisites

  1. Pulumi: Install and configure Pulumi CLI.

  2. Google Cloud SDK: Set up and authenticate your GCP account.

  3. Python: Ensure Python is installed on your system.(Also you must know the python coding or any other programming language coding like Go,NodeJs etc)

  4. Visual Studio Code (VS Code): Recommended for writing and running the code.

Step 1: Download and Set Up Pulumi

  1. Download Pulumi: Follow the official Pulumi installation guide to download and set it up for your operating system.

  2. Verify the installation by running:

pulumi version

Step 2: Set Up Google Cloud SDK

  1. Install GCP SDK: Follow the official GCP documentation for installation instructions.

  2. Verify the installation by running:

gcloud --version

Step 3: Login to Pulumi Console

  1. Go to the Pulumi Console.

  2. Create an organization to manage your projects.

  3. Access the Pulumi CLI:

  4. Generate an access token by following the instructions on the console.

  5. Use the token to log in to Pulumi from your terminal:

pulumi login

Step 4: Write code your own or clone my repo to learn

Clone the example code from the tutorial repository:

git clone https://github.com/HaqueJuyel/pulumi_tutorial
cd pulumi_tutorial/Bucket

Step 5: Configure Google Cloud Project

  1. Authenticate your GCP project using:

gcloud auth login
  1. Set the project ID in Pulumi using:

pulumi config set gcp:project "your-gcp-project-id"

Step 7: Deploy the GCP Bucket

Use the following command to provision the bucket in GCP:

pulumi up
  • Pulumi will preview the changes and prompt you for confirmation.

  • Confirm the operation, and Pulumi will create the bucket.

Bonus: Watch the Tutorial Video

For a hands-on walkthrough, check out my Pulumi Tutorial videos: Watch on YouTube

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating*

© 2024 Mohammed Juyel Haque. All rights reserved.

bottom of page