Google Cloud (GCP) Classic
The Google Cloud Platform (GCP) provider for Pulumi can provision many of the cloud resources available inGoogle Cloud.
The GCP provider must be configured with credentials to deploy and update resources in Google Cloud; seeInstallation & Configuration for instructions.
New to Pulumi and Google Cloud?Get started with Google Cloud using our tutorial
Example
constgcp=require("@pulumi/gcp")constbucket=newgcp.storage.Bucket("my-bucket");import*asgcpfrom"@pulumi/gcp";constbucket=newgcp.storage.Bucket("my-bucket");frompulumi_gcpimportstoragebucket=storage.Bucket('my-bucket')import("github.com/pulumi/pulumi/sdk/v3/go/pulumi""github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage")funcmain(){pulumi.Run(func(ctx*pulumi.Context)error{bucket,err:=storage.NewBucket(ctx,"my-bucket",nil)iferr!=nil{returnerr}returnnil})}usingPulumi;usingGcp=Pulumi.Gcp;awaitDeployment.RunAsync(()=>{varbucket=newGcp.Storage.Bucket("my-bucket");});importcom.pulumi.Context;importcom.pulumi.Pulumi;importcom.pulumi.gcp.storage.Bucket;publicclassApp{publicstaticvoidmain(String[]args){Pulumi.run(App::stack);}privatestaticvoidstack(Contextctx){finalvarbucket=newBucket("my-bucket");ctx.export("bucketName",bucket.name());}}resources:my-bucket:type:gcp:storage:BucketVisit theHow-to Guides to find step-by-step guides for specific scenarios like creating a serverless application using Google Cloud Functions or setting up a Google Kubernetes Engine (GKE) cluster.
