Benefits of Pulumi
Real Code
Pulumi is infrastructure as real code. This means you get all the benefits of your favorite language and tool for provisioning cloud infrastructure: code completion, error checking, versioning, IDE support, and general productivity gains — without the need to manage YAML and DSL syntax.
Reusable Components
As Pulumi is code, you can build up a library of packages to further enhance efficiency. Build repeatable practices through versioned packages such as: standard policies, network best practices, architecture blueprints — and deploy them to your team.
Immutable Infrastructure
Pulumi provides the computation of necessary cloud resources with a 'Cloud Resource DAG' ensuring successful deployment of cloud infrastructure — efficiently building, updating, and destroying cloud resources as required.
Build and deploy a GKE cluster
Pulumi supports programming against Kubernetes – Minikube, custom on-premises, or cloud-hosted custom clusters or in managed clusters such as Google GKE.
This code defines a GKE cluster with configurable settings which could be used in a module which could then be used to deploy an app to the cluster.
// Define a GKE cluster with configurable settings
import * as gcp from "@pulumi/gcp";
import { nodeCount, nodeMachineType, password, username } from "./config";
const engineVersion = gcp.container.getEngineVersions().then(v => v.latestMasterVersion);
export const k8sCluster = new gcp.container.Cluster("gke-cluster", {
initialNodeCount: nodeCount,
minMasterVersion: engineVersion,
nodeVersion: engineVersion,
masterAuth: { username, password },
nodeConfig: {
machineType: nodeMachineType,
oauthScopes: [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring"
],
},
});
Build and deploy Kubernetes apps to GKE
Pulumi supports programming against Azure's ACI container orchestrator. Pulumi is entirely unopinionated about how containers are built, published, and deployed to your orchestrator.
This code makes use of our previously defined GKE cluster and deploys an nginx canary onto the cluster with 1 replica.
// Deploy an nginx canary to GKE
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
import { k8sProvider, k8sConfig } from "./cluster";
// Create a canary deployment to test that this cluster works.
const name = pulumi.getProject() + "-" + pulumi.getStack();
const canaryLabels = { app: "canary-" + name };
const canary = new k8s.apps.v1beta1.Deployment("canary", {
spec: {
selector: { matchLabels: canaryLabels },
replicas: 1,
template: {
metadata: { labels: canaryLabels },
spec: { containers: [{ name, image: "nginx" }] },
},
},
}, { provider: k8sProvider });
// Export the Kubeconfig so that clients can easily access our cluster.
export let kubeConfig = k8sConfig;
Creating a Simple Web Server
Pulumi gives you a way to express infrastructure configuration using your favorite programming language.
This code uses TypeScript on Node.js to define the necessary environment, defines a very simple web server, and then creates the instance, before exporting the IP and Hostname.
const gcp = require("@pulumi/gcp");
const computeNetwork = new gcp.compute.Network("network", {
autoCreateSubnetworks: true,
});
const computeFirewall = new gcp.compute.Firewall("firewall", {
network: computeNetwork.selfLink,
allows: [{
protocol: "tcp",
ports: [ "22", "80" ],
}],
});
// Create a simple web server.
const startupScript =
"#!/bin/bash \n" +
"echo 'Hello, World!' > index.html \n" +
"nohup python -m SimpleHTTPServer 80 &";
const computeInstance = new gcp.compute.Instance("instance", {
machineType: "f1-micro",
metadataStartupScript: startupScript,
bootDisk: {
initializeParams: {
image: "debian-cloud/debian-8",
},
},
networkInterfaces: [{
network: computeNetwork.id,
accessConfigs: [{}], // must be empty
}],
serviceAccount: {
scopes: ["https://www.googleapis.com/auth/cloud-platform"],
},
}, { dependsOn: [computeFirewall] });
exports.instanceName = computeInstance.name;
exports.instanceIP = computeInstance.networkInterfaces.apply(ni => ni[0].accessConfigs[0].natIp);
Creating a Google Cloud Function
With Pulumi, you can combine infrastructure definitions and application code in one program. This example shows how to create a simple Google Cloud Function that returns a message when invoked.
import * as gcp from "@pulumi/gcp";
let greetingFunction = new gcp.cloudfunctions.HttpFunction("greeting", (req, res) => {
res.send("Greetings from " + (req.body.name || "Google Cloud Functions") + "!");
});
export let url = greetingFunction.httpsTriggerUrl;
How Pulumi Works
1
Create
- Code in real languages
- Share and reuse patterns
- Use your favorite IDE and tools
2
Deploy
- Preview changes
- Run
pulumi up
to deploy - Integrate with CI/CD
3
Manage
- Audit all changes
- Manage complex environments
- Implement policies and controls



Featured Customer
Learning Machine
Learning Machine, a blockchain SaaS company faced two challenges with their cloud infrastructure:
- Skills gaps between Dev and DevOps creating silos, and fragility.
- The need to more rapidly provision their expanding roster of new customers.
By moving to Pulumi, Learning Machine were able to solve both challenges with significant increases in capability:
Pulumi has given our team the tools and framework to achieve a unified development and DevOps model, boosting productivity and taking our business to any cloud environment that our customers need. We retired 25,000 lines of complex code that few team members understood and replaced it with 100s of lines in a real programming language.
— Kim Hamilton, CTO Learning Machine
Get Started with Pulumi
Use Pulumi's open source SDK to create, deploy, and manage infrastructure on any cloud.
Learn how top engineering teams are using Pulumi's SDK to create, deploy, and manage GCP resources.
We are building a distributed-database-as-a-service product that runs on Kubernetes clusters across multiple public clouds including GCP, AWS and others. Pulumi's declarative model, the support for real programming languages, and the uniform workflow on any cloud make our SRE team much more efficient.