What is @pulumi/gcp?
@pulumi/gcp is a Pulumi package that allows developers to create, deploy, and manage Google Cloud Platform (GCP) resources using Pulumi's infrastructure as code approach. It provides a wide range of functionalities to manage various GCP services such as Compute Engine, Cloud Storage, BigQuery, and more.
What are @pulumi/gcp's main functionalities?
Compute Engine
This feature allows you to create and manage Google Compute Engine instances. The code sample demonstrates how to create a new Compute Engine instance with specific configurations.
const gcp = require('@pulumi/gcp');
const compute = new gcp.compute.Instance('my-instance', {
machineType: 'f1-micro',
zone: 'us-central1-a',
bootDisk: {
initializeParams: {
image: 'debian-cloud/debian-9'
}
},
networkInterfaces: [{
network: 'default',
accessConfigs: [{}]
}]
});
Cloud Storage
This feature allows you to create and manage Google Cloud Storage buckets. The code sample demonstrates how to create a new Cloud Storage bucket with specific configurations.
const gcp = require('@pulumi/gcp');
const bucket = new gcp.storage.Bucket('my-bucket', {
location: 'US',
forceDestroy: true
});
BigQuery
This feature allows you to create and manage Google BigQuery datasets. The code sample demonstrates how to create a new BigQuery dataset with specific configurations.
const gcp = require('@pulumi/gcp');
const dataset = new gcp.bigquery.Dataset('my-dataset', {
datasetId: 'my_dataset',
friendlyName: 'My Dataset',
description: 'A sample dataset'
});
Cloud Functions
This feature allows you to create and manage Google Cloud Functions. The code sample demonstrates how to create a new Cloud Function with specific configurations.
const gcp = require('@pulumi/gcp');
const function = new gcp.cloudfunctions.Function('my-function', {
runtime: 'nodejs10',
entryPoint: 'helloWorld',
sourceArchiveBucket: bucket.name,
sourceArchiveObject: bucketObject.name,
triggerHttp: true
});
Other packages similar to @pulumi/gcp
@pulumi/aws
@pulumi/aws is a Pulumi package that allows developers to create, deploy, and manage Amazon Web Services (AWS) resources using Pulumi's infrastructure as code approach. It provides similar functionalities to @pulumi/gcp but for AWS services.
@pulumi/azure
@pulumi/azure is a Pulumi package that allows developers to create, deploy, and manage Microsoft Azure resources using Pulumi's infrastructure as code approach. It provides similar functionalities to @pulumi/gcp but for Azure services.
terraform
Terraform is an open-source infrastructure as code software tool created by HashiCorp. It allows users to define and provision data center infrastructure using a high-level configuration language. Terraform supports multiple cloud providers, including GCP, AWS, and Azure, making it a versatile alternative to @pulumi/gcp.
Google Cloud Platform Resource Provider
The Google Cloud Platform (GCP) resource provider for Pulumi lets you use GCP resources in your cloud programs. To use
this package, install the Pulumi CLI. For a streamlined Pulumi walkthrough, including language runtime installation and GCP configuration, select "Get Started" below.
Installing
This package is available in many languages in the standard packaging formats.
Node.js (JavaScript/TypeScript)
To use from JavaScript or TypeScript in Node.js, install using either npm
:
$ npm install @pulumi/gcp
or yarn
:
$ yarn add @pulumi/gcp
Python
To use from Python, install using pip
:
$ pip install pulumi_gcp
Go
To use from Go, use go get
to grab the latest version of the library
$ go get github.com/pulumi/pulumi-gcp/sdk/v6
.NET
To use from .NET, install using dotnet add package
:
$ dotnet add package Pulumi.Gcp
Reference
For further information, visit GCP in the Pulumi Registry
or for detailed API reference documentation, visit GCP API Docs in the Pulumi Registry.