Google Cloud Platform
The Google Cloud Platform (GCP) provider for Pulumi can be used to provision any of the cloud resources available in GCP. The GCP 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 GCP provider APIs.
The GCP provider supports several options for providing access to Google Cloud credentials. See GCP setup page for details.
The easiest way to start with Pulumi for GCP is to follow the tutorial:
- Virtual Machine: Create a Debian virtual machine web server instance
In addition to the tutorial, several interesting examples are available complete with instructions:
- Google Cloud Functions: Create a serverless function
- Google Kubernetes Engine: Create a GKE cluster and deploy an NGINX pod into it
- Ruby on Rails on GKE and Google Cloud SQL: Containerized Ruby on Rails app using Google Cloud SQL PostgresSQL, GKE and Docker Hub.
const gcp = require("@pulumi/gcp") const bucket = new gcp.storage.Bucket("my-bucket");
You can find additional examples of using Google Cloud in the Pulumi examples repo.
The following packages are available in packager managers:
The CGP provider is open source and available in the pulumi/pulumi-gcp repo.
The GCP provider accepts the following configuration settings. These can be provided to the default GCP provider via
pulumi config set gcp:<option>, or passed to the constructor of
new gcp.Provider to construct a specific instance of the GCP provider.
project: (Required) The ID of the project to apply any resources to. This can also be specified using any of the following environment variables (listed in order of precedence):
credentials: (Optional) Contents of a file that contains your service account private key in JSON format. You can download your existing Google Cloud service account file from the Google Cloud Console, or you can create a new one from the same page. Credentials can also be specified using any of the following environment variables (listed in order of precedence):
GOOGLE_APPLICATION_CREDENTIALSenvironment variable can also contain the path of a file to obtain credentials from. If no credentials are specified, the provider will fall back to using the Google Application Default Credentials. If you are running Pulumi from a GCE instance, see Creating and Enabling Service Accounts for Instances for details.
region: (Optional) The region to operate under, if not specified by a given resource. This can also be specified using any of the following environment variables (listed in order of precedence):
zone: (Optional) The zone to operate under, if not specified by a given resource. This can also be specified using any of the following environment variables (listed in order of precedence):