Pulumi AI doesn’t just write code; it bridges the gap between intent and implementation by translating natural language descriptions into declarative infrastructure.

Let’s see it in action. Imagine you need to provision a simple S3 bucket in AWS. You could start by typing:

Create an AWS S3 bucket named 'my-unique-pulumi-bucket-12345' with versioning enabled.

Pulumi AI, integrated into the Pulumi CLI, would then interpret this and generate the following Python code (or your chosen language):

import pulumi
import pulumi_aws as aws

# Create an AWS S3 bucket
bucket = aws.s3.Bucket("my-unique-pulumi-bucket-12345",
    versioning=aws.s3.BucketVersioningArgs(
        enabled=True,
    ))

# Export the bucket name
pulumi.export("bucket_name", bucket.id)

This code snippet defines a Pulumi resource (aws.s3.Bucket) with specific configurations (versioning.enabled=True). When you run pulumi up, Pulumi’s engine takes this declarative definition and communicates with the AWS API to create or update the actual S3 bucket in your account. The pulumi.export line makes the bucket’s ID accessible after deployment, allowing you to reference it in other parts of your infrastructure or in your application.

The core problem Pulumi AI solves is the cognitive load of remembering and correctly syntax-ing infrastructure code. Instead of navigating complex cloud provider documentation, searching for the right resource type and its properties, you can express your desired state in plain English. Pulumi AI acts as an intelligent interpreter, understanding your intent and translating it into the precise Pulumi code that represents that intent.

Internally, Pulumi AI leverages large language models (LLMs) trained on vast amounts of code, including Pulumi programs and cloud provider APIs. When you provide a prompt, the AI analyzes the request, identifies the relevant cloud provider and resource type, and then generates the corresponding Pulumi code. It understands concepts like "bucket," "versioning," "database," "subnet," and their associated properties and configurations. It’s not just stringing words together; it’s mapping natural language concepts to programmatic resource definitions.

You control Pulumi AI through your natural language prompts. The more specific and clear your request, the more accurate the generated code will be. You can specify cloud providers (AWS, Azure, GCP, Kubernetes), resource types (EC2 instances, RDS databases, App Service Plans, GKE clusters), and configurations (instance sizes, database tiers, network settings, tags). You can even chain requests, asking for multiple resources to be created together. For example: "Create an AWS EC2 instance of type t3.micro in the us-east-1 region, and attach an EBS volume of 50GB to it."

The surprising part is how Pulumi AI handles implicit defaults and common patterns. If you ask to create a Kubernetes Deployment without specifying a replica count, it might default to 1 based on common Kubernetes practices. Similarly, if you ask for a public S3 bucket, it will generate the necessary bucket policy to allow public read access, even if you didn’t explicitly state "make it public." This predictive capability, derived from its training data, can significantly accelerate development by anticipating standard configurations.

The next logical step after generating infrastructure code is managing its lifecycle and integrating it into CI/CD pipelines.

Want structured learning?

Take the full Pulumi course →