Join us at the Cloud Engineering Summit on October 20th for a free day of learning. Save your spot.

Google-Native

The Google Cloud Native provider for Pulumi can be used to provision any of the cloud resources available in Google Cloud. The provider must be configured with credentials to deploy and update resources in Google Cloud.

See the full API documentation for complete details of the available provider APIs.

Setup

The Google Cloud Native provider supports several options for providing access to Google Cloud credentials. See setup page for details.

Getting Started

The Google Cloud Native provider is currently in public preview. The quickest way to get started with Google Cloud is to follow the steps described in the README.

Some interesting examples are available complete with instructions:

Example

import * as storage from "@pulumi/google-native/storage/v1";
import * as pulumi from "@pulumi/pulumi";

const config = new pulumi.Config("google-native");
const project = config.require("project");
const bucketName = "pulumi-goog-native-ts-01";

// Create a Google Cloud resource (Storage Bucket)
const bucket = new storage.Bucket("my-bucket", {
    name:bucketName,
    bucket:bucketName,
    project: project,
});

// Export the bucket self-link
export const bucketName = bucket.selfLink;
import pulumi
from pulumi_google_native.storage import v1 as storage

config = pulumi.Config()
project = config.require('project')
# Create a Google Cloud resource (Storage Bucket)
bucket_name = "pulumi-goog-native-bucket-py-01"
bucket = storage.Bucket('my-bucket', name=bucket_name, bucket=bucket_name, project=project)

# Export the bucket self-link
pulumi.export('bucket', bucket.self_link)
package main

import (
	storage "github.com/pulumi/pulumi-google-native/sdk/go/google/storage/v1"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	const bucketName = "pulumi-goog-native-bucket-go-01"
	pulumi.Run(func(ctx *pulumi.Context) error {
		conf := config.New(ctx, "google-native")
		project := conf.Require("project")
		// Create a Google Cloud resource (Storage Bucket)
		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
			Name:    pulumi.StringPtr(bucketName),
			Bucket:  pulumi.String(project),
			Project: project,
		})
		if err != nil {
			return err
		}
		// Export the bucket self-link
		ctx.Export("bucket", bucket.SelfLink)

		return nil
	})
}
using System.Threading.Tasks;
using Pulumi;
using Pulumi.GoogleNative.Storage.V1;

class Program
{
    static Task Main() =>
        Deployment.Run(() => {
            var config = new Config("google-native");
            var project = config.Require("project");
            var bucketName = "pulumi-goog-native-bucket-cs-01";
            // Create a Google Cloud resource (Storage Bucket)
            var bucket = new Bucket("my-bucket", new BucketArgs{
                Name = bucketName,
                Bucket = bucketName,
                Project = project,
            });
        });
}

You can find additional examples of using the Google Cloud Native provider in the Pulumi examples repo.

Libraries

The following packages are available in package managers:

The Google Cloud Native provider is open source and available in the pulumi/pulumi-google-native repo.