Module compute

@pulumi/gcp > compute

Index ▾

compute/address.ts compute/attachedDisk.ts compute/autoscalar.ts compute/backendBucket.ts compute/backendService.ts compute/disk.ts compute/firewall.ts compute/forwardingRule.ts compute/getAddress.ts compute/getBackendService.ts compute/getDefaultServiceAccount.ts compute/getForwardingRule.ts compute/getGlobalAddress.ts compute/getImage.ts compute/getInstance.ts compute/getInstanceGroup.ts compute/getLBIPRanges.ts compute/getNetblockIPRanges.ts compute/getNetwork.ts compute/getRegionInstanceGroup.ts compute/getRegions.ts compute/getSSLPolicy.ts compute/getSubnetwork.ts compute/getVPNGateway.ts compute/getZones.ts compute/globalAddress.ts compute/globalForwardingRule.ts compute/healthCheck.ts compute/httpHealthCheck.ts compute/httpsHealthCheck.ts compute/image.ts compute/instance.ts compute/instanceFromTemplate.ts compute/instanceGroup.ts compute/instanceGroupManager.ts compute/instanceTemplate.ts compute/interconnectAttachment.ts compute/network.ts compute/networkPeering.ts compute/projectMetadata.ts compute/projectMetadataItem.ts compute/regionAutoscaler.ts compute/regionBackendService.ts compute/regionDisk.ts compute/regionInstanceGroupManager.ts compute/route.ts compute/router.ts compute/routerInterface.ts compute/routerNat.ts compute/routerPeer.ts compute/sSLCertificate.ts compute/sSLPolicy.ts compute/securityPolicy.ts compute/sharedVPCHostProject.ts compute/sharedVPCServiceProject.ts compute/snapshot.ts compute/subnetwork.ts compute/subnetworkIAMBinding.ts compute/subnetworkIAMMember.ts compute/subnetworkIAMPolicy.ts compute/targetHttpProxy.ts compute/targetHttpsProxy.ts compute/targetPool.ts compute/targetSSLProxy.ts compute/targetTCPProxy.ts compute/uRLMap.ts compute/vPNGateway.ts compute/vPNTunnel.ts

class Address

extends CustomResource

Represents an Address resource.

Each virtual machine instance has an ephemeral internal IP address and, optionally, an external IP address. To communicate between instances on the same network, you can use an instance’s internal IP address. To communicate with the Internet and instances outside of the same network, you must specify the instance’s external IP address.

Internal IP addresses are ephemeral and only belong to an instance for the lifetime of the instance; if the instance is deleted and recreated, the instance is assigned a new internal IP address, either by Compute Engine or by you. External IP addresses can be either ephemeral or static.

To get more information about Address, see:

Example Usage - Address Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const ipAddress = new gcp.compute.Address("ip_address", {});

Example Usage - Address With Subnetwork

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultNetwork = new gcp.compute.Network("default", {});
const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
    ipCidrRange: "10.0.0.0/16",
    network: defaultNetwork.selfLink,
    region: "us-central1",
});
const internalWithSubnetAndAddress = new gcp.compute.Address("internal_with_subnet_and_address", {
    address: "10.0.42.42",
    addressType: "INTERNAL",
    region: "us-central1",
    subnetwork: defaultSubnetwork.selfLink,
});

Example Usage - Instance With Ip

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const debianImage = pulumi.output(gcp.compute.getImage({
    family: "debian-9",
    project: "debian-cloud",
}));
const static = new gcp.compute.Address("static", {});
const instanceWithIp = new gcp.compute.Instance("instance_with_ip", {
    bootDisk: {
        initializeParams: {
            image: debianImage.apply(debianImage => debianImage.selfLink),
        },
    },
    machineType: "f1-micro",
    networkInterfaces: [{
        accessConfigs: [{
            natIp: static.address,
        }],
        network: "default",
    }],
    zone: "us-central1-a",
});

constructor

new Address(name: string, args?: AddressArgs, opts?: pulumi.CustomResourceOptions)

Create a Address resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AddressState, opts?: pulumi.CustomResourceOptions): Address

Get an existing Address resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property address

public address: pulumi.Output<string>;

The IP of the created resource.

property addressType

public addressType: pulumi.Output<string | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property name

public name: pulumi.Output<string>;

property networkTier

public networkTier: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property subnetwork

public subnetwork: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property users

public users: pulumi.Output<string[]>;

class AttachedDisk

extends CustomResource

Persistent disks can be attached to a compute instance using the attached_disk section within the compute instance configuration. However there may be situations where managing the attached disks via the compute instance config isn’t preferable or possible, such as attaching dynamic numbers of disks using the count variable.

To get more information about attaching disks, see:

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultAttachedDisk = new gcp.compute.AttachedDisk("default", {
    disk: google_compute_disk_default.selfLink,
    instance: google_compute_instance_default.selfLink,
});

constructor

new AttachedDisk(name: string, args: AttachedDiskArgs, opts?: pulumi.CustomResourceOptions)

Create a AttachedDisk resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AttachedDiskState, opts?: pulumi.CustomResourceOptions): AttachedDisk

Get an existing AttachedDisk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property deviceName

public deviceName: pulumi.Output<string>;

property disk

public disk: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instance

public instance: pulumi.Output<string>;

property mode

public mode: pulumi.Output<string | undefined>;

property project

public project: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zone

public zone: pulumi.Output<string>;

class Autoscalar

extends CustomResource

Represents an Autoscaler resource.

Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define.

To get more information about Autoscaler, see:

Example Usage - Autoscaler Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const debian9 = pulumi.output(gcp.compute.getImage({
    family: "debian-9",
    project: "debian-cloud",
}));
const foobarTargetPool = new gcp.compute.TargetPool("foobar", {});
const foobarInstanceTemplate = new gcp.compute.InstanceTemplate("foobar", {
    canIpForward: false,
    disks: [{
        sourceImage: debian9.apply(debian9 => debian9.selfLink),
    }],
    machineType: "n1-standard-1",
    metadata: {
        foo: "bar",
    },
    networkInterfaces: [{
        network: "default",
    }],
    serviceAccount: {
        scopes: [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    },
    tags: [
        "foo",
        "bar",
    ],
});
const foobarInstanceGroupManager = new gcp.compute.InstanceGroupManager("foobar", {
    baseInstanceName: "foobar",
    instanceTemplate: foobarInstanceTemplate.selfLink,
    targetPools: [foobarTargetPool.selfLink],
    zone: "us-central1-f",
});
const foobarAutoscalar = new gcp.compute.Autoscalar("foobar", {
    autoscalingPolicy: {
        cooldownPeriod: 60,
        cpuUtilization: {
            target: 0.5,
        },
        maxReplicas: 5,
        minReplicas: 1,
    },
    target: foobarInstanceGroupManager.selfLink,
    zone: "us-central1-f",
});

constructor

new Autoscalar(name: string, args: AutoscalarArgs, opts?: pulumi.CustomResourceOptions)

Create a Autoscalar resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AutoscalarState, opts?: pulumi.CustomResourceOptions): Autoscalar

Get an existing Autoscalar resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property autoscalingPolicy

public autoscalingPolicy: pulumi.Output<{
    cooldownPeriod: number;
    cpuUtilization: {
        target: number;
    };
    loadBalancingUtilization: {
        target: number;
    };
    maxReplicas: number;
    metrics: {
        name: string;
        target: number;
        type: string;
    }[];
    minReplicas: number;
}>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property target

public target: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zone

public zone: pulumi.Output<string>;

class BackendBucket

extends CustomResource

Backend buckets allow you to use Google Cloud Storage buckets with HTTP(S) load balancing.

An HTTP(S) load balancer can direct traffic to specified URLs to a backend bucket rather than a backend service. It can send requests for static content to a Cloud Storage bucket and requests for dynamic content a virtual machine instance.

To get more information about BackendBucket, see:

Example Usage - Backend Bucket Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const imageBucket = new gcp.storage.Bucket("image_bucket", {
    location: "EU",
});
const imageBackend = new gcp.compute.BackendBucket("image_backend", {
    bucketName: imageBucket.name,
    description: "Contains beautiful images",
    enableCdn: true,
});

constructor

new BackendBucket(name: string, args: BackendBucketArgs, opts?: pulumi.CustomResourceOptions)

Create a BackendBucket resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BackendBucketState, opts?: pulumi.CustomResourceOptions): BackendBucket

Get an existing BackendBucket resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property bucketName

public bucketName: pulumi.Output<string>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property enableCdn

public enableCdn: pulumi.Output<boolean | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class BackendService

extends CustomResource

A Backend Service defines a group of virtual machines that will serve traffic for load balancing. For more information see the official documentation and the API.

For internal load balancing, use a google_compute_region_backend_service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const webserver = new gcp.compute.InstanceTemplate("webserver", {
    disks: [{
        autoDelete: true,
        boot: true,
        sourceImage: "debian-cloud/debian-9",
    }],
    machineType: "n1-standard-1",
    networkInterfaces: [{
        network: "default",
    }],
});
const webservers = new gcp.compute.InstanceGroupManager("webservers", {
    baseInstanceName: "webserver",
    instanceTemplate: webserver.selfLink,
    targetSize: 1,
    zone: "us-central1-f",
});
const website = new gcp.compute.BackendService("website", {
    backends: [{
        group: webservers.instanceGroup,
    }],
    description: "Our company website",
    enableCdn: false,
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});

constructor

new BackendService(name: string, args: BackendServiceArgs, opts?: pulumi.CustomResourceOptions)

Create a BackendService resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BackendServiceState, opts?: pulumi.CustomResourceOptions): BackendService

Get an existing BackendService resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backends

public backends: pulumi.Output<{
    balancingMode: string;
    capacityScaler: number;
    description: string;
    group: string;
    maxConnections: number;
    maxConnectionsPerInstance: number;
    maxRate: number;
    maxRatePerInstance: number;
    maxUtilization: number;
}[] | undefined>;

The list of backends that serve this BackendService. Structure is documented below.

property cdnPolicy

public cdnPolicy: pulumi.Output<{
    cacheKeyPolicy: {
        includeHost: boolean;
        includeProtocol: boolean;
        includeQueryString: boolean;
        queryStringBlacklists: string[];
        queryStringWhitelists: string[];
    };
}>;

Cloud CDN configuration for this BackendService. Structure is documented below.

property connectionDrainingTimeoutSec

public connectionDrainingTimeoutSec: pulumi.Output<number | undefined>;

Time for which instance will be drained (not accept new connections, but still work to finish started ones). Defaults to 300.

property customRequestHeaders

public customRequestHeaders: pulumi.Output<string[] | undefined>;

Headers that the HTTP/S load balancer should add to proxied requests. See guide for details. This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property description

public description: pulumi.Output<string | undefined>;

The textual description for the backend service.

property enableCdn

public enableCdn: pulumi.Output<boolean | undefined>;

Whether or not to enable the Cloud CDN on the backend service.

property fingerprint

public fingerprint: pulumi.Output<string>;

The fingerprint of the backend service.

property healthChecks

public healthChecks: pulumi.Output<string>;

Specifies a list of HTTP/HTTPS health checks for checking the health of the backend service. Currently at most one health check can be specified, and a health check is required.

property iap

public iap: pulumi.Output<{
    oauth2ClientId: string;
    oauth2ClientSecret: string;
} | undefined>;

Specification for the Identity-Aware proxy. Disabled if not specified. Structure is documented below.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the backend service.

property portName

public portName: pulumi.Output<string>;

The name of a service that has been added to an instance group in this backend. See related docs for details. Defaults to http.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property protocol

public protocol: pulumi.Output<string>;

The protocol for incoming requests. Defaults to HTTP.

property securityPolicy

public securityPolicy: pulumi.Output<string | undefined>;

Name or URI of a security policy to add to the backend service.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sessionAffinity

public sessionAffinity: pulumi.Output<string>;

How to distribute load. Options are NONE (no affinity), CLIENT_IP (hash of the source/dest addresses / ports), and GENERATED_COOKIE (distribute load using a generated session cookie).

property timeoutSec

public timeoutSec: pulumi.Output<number>;

The number of secs to wait for a backend to respond to a request before considering the request failed. Defaults to 30.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Disk

extends CustomResource

Persistent disks are durable storage devices that function similarly to the physical disks in a desktop or a server. Compute Engine manages the hardware behind these devices to ensure data redundancy and optimize performance for you. Persistent disks are available as either standard hard disk drives (HDD) or solid-state drives (SSD).

Persistent disks are located independently from your virtual machine instances, so you can detach or move persistent disks to keep your data even after you delete your instances. Persistent disk performance scales automatically with size, so you can resize your existing persistent disks or add more persistent disks to an instance to meet your performance and storage space requirements.

Add a persistent disk to your instance when you need reliable and affordable storage with consistent performance characteristics.

To get more information about Disk, see:

Warning: All arguments including the disk encryption key will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage - Disk Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultDisk = new gcp.compute.Disk("default", {
    image: "debian-8-jessie-v20170523",
    labels: {
        environment: "dev",
    },
    type: "pd-ssd",
    zone: "us-central1-a",
});

constructor

new Disk(name: string, args?: DiskArgs, opts?: pulumi.CustomResourceOptions)

Create a Disk resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DiskState, opts?: pulumi.CustomResourceOptions): Disk

Get an existing Disk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property diskEncryptionKey

public diskEncryptionKey: pulumi.Output<{
    rawKey: string;
    sha256: string;
}>;

property diskEncryptionKeyRaw

public diskEncryptionKeyRaw: pulumi.Output<string | undefined>;

property diskEncryptionKeySha256

public diskEncryptionKeySha256: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property image

public image: pulumi.Output<string | undefined>;

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property lastAttachTimestamp

public lastAttachTimestamp: pulumi.Output<string>;

property lastDetachTimestamp

public lastDetachTimestamp: pulumi.Output<string>;

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property size

public size: pulumi.Output<number>;

property snapshot

public snapshot: pulumi.Output<string | undefined>;

property sourceImageEncryptionKey

public sourceImageEncryptionKey: pulumi.Output<{
    rawKey: string;
    sha256: string;
} | undefined>;

property sourceImageId

public sourceImageId: pulumi.Output<string>;

property sourceSnapshotEncryptionKey

public sourceSnapshotEncryptionKey: pulumi.Output<{
    rawKey: string;
    sha256: string;
} | undefined>;

property sourceSnapshotId

public sourceSnapshotId: pulumi.Output<string>;

property type

public type: pulumi.Output<string | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property users

public users: pulumi.Output<string[]>;

property zone

public zone: pulumi.Output<string>;

class Firewall

extends CustomResource

Each network has its own firewall controlling access to and from the instances.

All traffic to instances, even from other instances, is blocked by the firewall unless firewall rules are created to allow it.

The default network has automatically created firewall rules that are shown in default firewall rules. No manually created network has automatically created firewall rules except for a default “allow” rule for outgoing traffic and a default “deny” for incoming traffic. For all networks except the default network, you must create any firewall rules you need.

To get more information about Firewall, see:

Example Usage - Firewall Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultNetwork = new gcp.compute.Network("default", {});
const defaultFirewall = new gcp.compute.Firewall("default", {
    allows: [
        {
            protocol: "icmp",
        },
        {
            ports: [
                "80",
                "8080",
                "1000-2000",
            ],
            protocol: "tcp",
        },
    ],
    network: defaultNetwork.name,
    sourceTags: ["web"],
});

constructor

new Firewall(name: string, args: FirewallArgs, opts?: pulumi.CustomResourceOptions)

Create a Firewall resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FirewallState, opts?: pulumi.CustomResourceOptions): Firewall

Get an existing Firewall resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property allows

public allows: pulumi.Output<{
    ports: string[];
    protocol: string;
}[] | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property denies

public denies: pulumi.Output<{
    ports: string[];
    protocol: string;
}[] | undefined>;

property description

public description: pulumi.Output<string | undefined>;

property destinationRanges

public destinationRanges: pulumi.Output<string[]>;

property direction

public direction: pulumi.Output<string>;

property disabled

public disabled: pulumi.Output<boolean | undefined>;

property enableLogging

public enableLogging: pulumi.Output<boolean | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string>;

property priority

public priority: pulumi.Output<number | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sourceRanges

public sourceRanges: pulumi.Output<string[]>;

property sourceServiceAccounts

public sourceServiceAccounts: pulumi.Output<string | undefined>;

property sourceTags

public sourceTags: pulumi.Output<string[] | undefined>;

property targetServiceAccounts

public targetServiceAccounts: pulumi.Output<string | undefined>;

property targetTags

public targetTags: pulumi.Output<string[] | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ForwardingRule

extends CustomResource

A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple.

To get more information about ForwardingRule, see:

Example Usage - Forwarding Rule Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultTargetPool = new gcp.compute.TargetPool("default", {});
const defaultForwardingRule = new gcp.compute.ForwardingRule("default", {
    portRange: "80",
    target: defaultTargetPool.selfLink,
});

constructor

new ForwardingRule(name: string, args?: ForwardingRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a ForwardingRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ForwardingRuleState, opts?: pulumi.CustomResourceOptions): ForwardingRule

Get an existing ForwardingRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backendService

public backendService: pulumi.Output<string | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipAddress

public ipAddress: pulumi.Output<string>;

property ipProtocol

public ipProtocol: pulumi.Output<string>;

property ipVersion

public ipVersion: pulumi.Output<string | undefined>;

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property loadBalancingScheme

public loadBalancingScheme: pulumi.Output<string | undefined>;

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string>;

property networkTier

public networkTier: pulumi.Output<string>;

property portRange

public portRange: pulumi.Output<string | undefined>;

property ports

public ports: pulumi.Output<string[] | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property serviceLabel

public serviceLabel: pulumi.Output<string | undefined>;

property serviceName

public serviceName: pulumi.Output<string>;

property subnetwork

public subnetwork: pulumi.Output<string>;

property target

public target: pulumi.Output<string | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class GlobalAddress

extends CustomResource

Represents a Global Address resource. Global addresses are used for HTTP(S) load balancing.

To get more information about GlobalAddress, see:

Example Usage - Global Address Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultGlobalAddress = new gcp.compute.GlobalAddress("default", {});

constructor

new GlobalAddress(name: string, args?: GlobalAddressArgs, opts?: pulumi.CustomResourceOptions)

Create a GlobalAddress resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GlobalAddressState, opts?: pulumi.CustomResourceOptions): GlobalAddress

Get an existing GlobalAddress resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property address

public address: pulumi.Output<string>;

property addressType

public addressType: pulumi.Output<string | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipVersion

public ipVersion: pulumi.Output<string | undefined>;

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string | undefined>;

property prefixLength

public prefixLength: pulumi.Output<number | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property purpose

public purpose: pulumi.Output<string | undefined>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class GlobalForwardingRule

extends CustomResource

Manages a Global Forwarding Rule within GCE. This binds an ip and port to a target HTTP(s) proxy. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const defaultBackendService = new gcp.compute.BackendService("default", {
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});
const defaultURLMap = new gcp.compute.URLMap("default", {
    defaultService: defaultBackendService.selfLink,
    description: "a description",
    hostRules: [{
        hosts: ["mysite.com"],
        pathMatcher: "allpaths",
    }],
    pathMatchers: [{
        defaultService: defaultBackendService.selfLink,
        name: "allpaths",
        pathRules: [{
            paths: ["/*"],
            service: defaultBackendService.selfLink,
        }],
    }],
});
const defaultTargetHttpProxy = new gcp.compute.TargetHttpProxy("default", {
    description: "a description",
    urlMap: defaultURLMap.selfLink,
});
const defaultGlobalForwardingRule = new gcp.compute.GlobalForwardingRule("default", {
    portRange: "80",
    target: defaultTargetHttpProxy.selfLink,
});

constructor

new GlobalForwardingRule(name: string, args: GlobalForwardingRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a GlobalForwardingRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GlobalForwardingRuleState, opts?: pulumi.CustomResourceOptions): GlobalForwardingRule

Get an existing GlobalForwardingRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property description

public description: pulumi.Output<string | undefined>;

Textual description field.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipAddress

public ipAddress: pulumi.Output<string>;

The static IP. (if not set, an ephemeral IP is used). This should be the literal IP address to be used, not the self_link to a google_compute_global_address resource. (If using a google_compute_global_address resource, use the address property instead of the self_link property.)

property ipProtocol

public ipProtocol: pulumi.Output<string>;

The IP protocol to route, one of “TCP” “UDP” “AH” “ESP” or “SCTP”. (default “TCP”).

property ipVersion

public ipVersion: pulumi.Output<string | undefined>;

The IP Version that will be used by this resource’s address. One of "IPV4" or "IPV6". You cannot provide this and ip_address.

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

The current label fingerprint. This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

A set of key/value label pairs to assign to the resource. This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property portRange

public portRange: pulumi.Output<string | undefined>;

A range e.g. “1024-2048” or a single port “1024” (defaults to all ports!). Some types of forwarding targets have constraints on the acceptable ports:

  • Target HTTP proxy: 80, 8080
  • Target HTTPS proxy: 443
  • Target TCP proxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222
  • Target SSL proxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222
  • Target VPN gateway: 500, 4500

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property target

public target: pulumi.Output<string>;

URL of target HTTP or HTTPS proxy.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class HealthCheck

extends CustomResource

Health Checks determine whether instances are responsive and able to do work. They are an important part of a comprehensive load balancing configuration, as they enable monitoring instances behind load balancers.

Health Checks poll instances at a specified interval. Instances that do not respond successfully to some number of probes in a row are marked as unhealthy. No new connections are sent to unhealthy instances, though existing connections will continue. The health check will continue to poll unhealthy instances. If an instance later responds successfully to some number of consecutive probes, it is marked healthy again and can receive new connections.

To get more information about HealthCheck, see:

Example Usage - Health Check Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const internal_health_check = new gcp.compute.HealthCheck("internal-health-check", {
    checkIntervalSec: 1,
    tcpHealthCheck: {
        port: 80,
    },
    timeoutSec: 1,
});

constructor

new HealthCheck(name: string, args?: HealthCheckArgs, opts?: pulumi.CustomResourceOptions)

Create a HealthCheck resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HealthCheckState, opts?: pulumi.CustomResourceOptions): HealthCheck

Get an existing HealthCheck resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property checkIntervalSec

public checkIntervalSec: pulumi.Output<number | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property healthyThreshold

public healthyThreshold: pulumi.Output<number | undefined>;

property httpHealthCheck

public httpHealthCheck: pulumi.Output<{
    host: string;
    port: number;
    proxyHeader: string;
    requestPath: string;
    response: string;
} | undefined>;

property httpsHealthCheck

public httpsHealthCheck: pulumi.Output<{
    host: string;
    port: number;
    proxyHeader: string;
    requestPath: string;
    response: string;
} | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sslHealthCheck

public sslHealthCheck: pulumi.Output<{
    port: number;
    proxyHeader: string;
    request: string;
    response: string;
} | undefined>;

property tcpHealthCheck

public tcpHealthCheck: pulumi.Output<{
    port: number;
    proxyHeader: string;
    request: string;
    response: string;
} | undefined>;

property timeoutSec

public timeoutSec: pulumi.Output<number | undefined>;

property type

public type: pulumi.Output<string>;

property unhealthyThreshold

public unhealthyThreshold: pulumi.Output<number | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class HttpHealthCheck

extends CustomResource

An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP.

Note: google_compute_http_health_check is a legacy health check. The newer google_compute_health_check should be preferred for all uses except Network Load Balancers which still require the legacy version.

To get more information about HttpHealthCheck, see:

Example Usage - Http Health Check Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/health_check",
    timeoutSec: 1,
});

constructor

new HttpHealthCheck(name: string, args?: HttpHealthCheckArgs, opts?: pulumi.CustomResourceOptions)

Create a HttpHealthCheck resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HttpHealthCheckState, opts?: pulumi.CustomResourceOptions): HttpHealthCheck

Get an existing HttpHealthCheck resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property checkIntervalSec

public checkIntervalSec: pulumi.Output<number | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property healthyThreshold

public healthyThreshold: pulumi.Output<number | undefined>;

property host

public host: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property port

public port: pulumi.Output<number | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property requestPath

public requestPath: pulumi.Output<string | undefined>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property timeoutSec

public timeoutSec: pulumi.Output<number | undefined>;

property unhealthyThreshold

public unhealthyThreshold: pulumi.Output<number | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class HttpsHealthCheck

extends CustomResource

An HttpsHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTPS.

Note: google_compute_https_health_check is a legacy health check. The newer google_compute_health_check should be preferred for all uses except Network Load Balancers which still require the legacy version.

To get more information about HttpsHealthCheck, see:

Example Usage - Https Health Check Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpsHealthCheck = new gcp.compute.HttpsHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/health_check",
    timeoutSec: 1,
});

constructor

new HttpsHealthCheck(name: string, args?: HttpsHealthCheckArgs, opts?: pulumi.CustomResourceOptions)

Create a HttpsHealthCheck resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HttpsHealthCheckState, opts?: pulumi.CustomResourceOptions): HttpsHealthCheck

Get an existing HttpsHealthCheck resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property checkIntervalSec

public checkIntervalSec: pulumi.Output<number | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property healthyThreshold

public healthyThreshold: pulumi.Output<number | undefined>;

property host

public host: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property port

public port: pulumi.Output<number | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property requestPath

public requestPath: pulumi.Output<string | undefined>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property timeoutSec

public timeoutSec: pulumi.Output<number | undefined>;

property unhealthyThreshold

public unhealthyThreshold: pulumi.Output<number | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Image

extends CustomResource

Creates a bootable VM image resource for Google Compute Engine from an existing tarball. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const bootable_image = new gcp.compute.Image("bootable-image", {
    licenses: ["https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"],
    rawDisk: {
        source: "https://storage.googleapis.com/my-bucket/my-disk-image-tarball.tar.gz",
    },
});
const vm = new gcp.compute.Instance("vm", {
    bootDisk: {
        initializeParams: {
            image: bootable_image.selfLink,
        },
    },
    machineType: "n1-standard-1",
    networkInterfaces: [{
        network: "default",
    }],
    zone: "us-east1-c",
});

constructor

new Image(name: string, args?: ImageArgs, opts?: pulumi.CustomResourceOptions)

Create a Image resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ImageState, opts?: pulumi.CustomResourceOptions): Image

Get an existing Image resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property createTimeout

public createTimeout: pulumi.Output<number | undefined>;

Configurable timeout in minutes for creating images. Default is 4 minutes.

property description

public description: pulumi.Output<string | undefined>;

The description of the image to be created

property family

public family: pulumi.Output<string | undefined>;

The name of the image family to which this image belongs.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

The fingerprint of the assigned labels.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

A set of key/value label pairs to assign to the image.

property licenses

public licenses: pulumi.Output<string[]>;

A list of license URIs to apply to this image. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property rawDisk

public rawDisk: pulumi.Output<{
    containerType: string;
    sha1: string;
    source: string;
} | undefined>;

The raw disk that will be used as the source of the image. Changing this forces a new resource to be created. Structure is documented below.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sourceDisk

public sourceDisk: pulumi.Output<string | undefined>;

The URL of a disk that will be used as the source of the image. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Instance

extends CustomResource

Manages a VM instance resource within GCE. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultInstance = new gcp.compute.Instance("default", {
    bootDisk: {
        initializeParams: {
            image: "debian-cloud/debian-9",
        },
    },
    machineType: "n1-standard-1",
    metadata: {
        foo: "bar",
    },
    metadataStartupScript: "echo hi > /test.txt",
    networkInterfaces: [{
        accessConfigs: [{}],
        network: "default",
    }],
    // Local SSD disk
    scratchDisks: [{}],
    serviceAccount: {
        scopes: [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    },
    tags: [
        "foo",
        "bar",
    ],
    zone: "us-central1-a",
});

constructor

new Instance(name: string, args: InstanceArgs, opts?: pulumi.CustomResourceOptions)

Create a Instance resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance

Get an existing Instance resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property allowStoppingForUpdate

public allowStoppingForUpdate: pulumi.Output<boolean | undefined>;

If true, allows Terraform to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.

property attachedDisks

public attachedDisks: pulumi.Output<{
    deviceName: string;
    diskEncryptionKeyRaw: string;
    diskEncryptionKeySha256: string;
    mode: string;
    source: string;
}[] | undefined>;

List of disks to attach to the instance. Structure is documented below.

property bootDisk

public bootDisk: pulumi.Output<{
    autoDelete: boolean;
    deviceName: string;
    diskEncryptionKeyRaw: string;
    diskEncryptionKeySha256: string;
    initializeParams: {
        image: string;
        size: number;
        type: string;
    };
    source: string;
}>;

The boot disk for the instance. Structure is documented below.

property canIpForward

public canIpForward: pulumi.Output<boolean | undefined>;

Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.

property cpuPlatform

public cpuPlatform: pulumi.Output<string>;

The CPU platform used by this instance.

property createTimeout

public createTimeout: pulumi.Output<number | undefined>;

Configurable timeout in minutes for creating instances. Default is 4 minutes. Changing this forces a new resource to be created.

property deletionProtection

public deletionProtection: pulumi.Output<boolean | undefined>;

Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via terraform destroy), or the instance cannot be deleted and the Terraform run will not complete successfully.

property description

public description: pulumi.Output<string | undefined>;

A brief description of this resource.

property guestAccelerators

public guestAccelerators: pulumi.Output<{
    count: number;
    type: string;
}[]>;

List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instanceId

public instanceId: pulumi.Output<string>;

The server-assigned unique identifier of this instance.

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

The unique fingerprint of the labels.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

A set of key/value label pairs to assign to the instance.

property machineType

public machineType: pulumi.Output<string>;

The machine type to create.

property metadata

public metadata: pulumi.Output<{[key: string]: string} | undefined>;

Metadata key/value pairs to make available from within the instance.

property metadataFingerprint

public metadataFingerprint: pulumi.Output<string>;

The unique fingerprint of the metadata.

property metadataStartupScript

public metadataStartupScript: pulumi.Output<string | undefined>;

An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously.

property minCpuPlatform

public minCpuPlatform: pulumi.Output<string | undefined>;

Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true in order to update this field.

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property networkInterfaces

public networkInterfaces: pulumi.Output<{
    accessConfigs: {
        assignedNatIp: string;
        natIp: string;
        networkTier: string;
        publicPtrDomainName: string;
    }[];
    address: string;
    aliasIpRanges: {
        ipCidrRange: string;
        subnetworkRangeName: string;
    }[];
    name: string;
    network: string;
    networkIp: string;
    subnetwork: string;
    subnetworkProject: string;
}[]>;

Networks to attach to the instance. This can be specified multiple times. Structure is documented below.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property scheduling

public scheduling: pulumi.Output<{
    automaticRestart: boolean;
    onHostMaintenance: string;
    preemptible: boolean;
}>;

The scheduling strategy to use. More details about this configuration option are detailed below.

property scratchDisks

public scratchDisks: pulumi.Output<{
    interface: string;
}[] | undefined>;

Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property serviceAccount

public serviceAccount: pulumi.Output<{
    email: string;
    scopes: string[];
} | undefined>;

Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true in order to update this field.

property tags

public tags: pulumi.Output<string[] | undefined>;

A list of tags to attach to the instance.

property tagsFingerprint

public tagsFingerprint: pulumi.Output<string>;

The unique fingerprint of the tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zone

public zone: pulumi.Output<string>;

The zone that the machine should be created in.

class InstanceFromTemplate

extends CustomResource

Manages a VM instance resource within GCE. For more information see the official documentation and API.

This resource is specifically to create a compute instance from a given source_instance_template. To create an instance without a template, use the google_compute_instance resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const tplInstanceTemplate = new gcp.compute.InstanceTemplate("tpl", {
    canIpForward: true,
    disks: [{
        autoDelete: true,
        boot: true,
        diskSizeGb: 100,
        sourceImage: "debian-cloud/debian-9",
    }],
    machineType: "n1-standard-1",
    metadata: {
        foo: "bar",
    },
    networkInterfaces: [{
        network: "default",
    }],
});
const tplInstanceFromTemplate = new gcp.compute.InstanceFromTemplate("tpl", {
    // Override fields from instance template
    canIpForward: false,
    labels: {
        my_key: "my_value",
    },
    sourceInstanceTemplate: tplInstanceTemplate.selfLink,
    zone: "us-central1-a",
});

constructor

new InstanceFromTemplate(name: string, args: InstanceFromTemplateArgs, opts?: pulumi.CustomResourceOptions)

Create a InstanceFromTemplate resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceFromTemplateState, opts?: pulumi.CustomResourceOptions): InstanceFromTemplate

Get an existing InstanceFromTemplate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property allowStoppingForUpdate

public allowStoppingForUpdate: pulumi.Output<boolean>;

property attachedDisks

public attachedDisks: pulumi.Output<{
    deviceName: string;
    diskEncryptionKeyRaw: string;
    diskEncryptionKeySha256: string;
    mode: string;
    source: string;
}[]>;

property bootDisk

public bootDisk: pulumi.Output<{
    autoDelete: boolean;
    deviceName: string;
    diskEncryptionKeyRaw: string;
    diskEncryptionKeySha256: string;
    initializeParams: {
        image: string;
        size: number;
        type: string;
    };
    source: string;
}>;

property canIpForward

public canIpForward: pulumi.Output<boolean>;

property cpuPlatform

public cpuPlatform: pulumi.Output<string>;

property deletionProtection

public deletionProtection: pulumi.Output<boolean>;

property description

public description: pulumi.Output<string>;

property guestAccelerators

public guestAccelerators: pulumi.Output<{
    count: number;
    type: string;
}[]>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instanceId

public instanceId: pulumi.Output<string>;

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string}>;

property machineType

public machineType: pulumi.Output<string>;

property metadata

public metadata: pulumi.Output<{[key: string]: string}>;

property metadataFingerprint

public metadataFingerprint: pulumi.Output<string>;

property metadataStartupScript

public metadataStartupScript: pulumi.Output<string>;

property minCpuPlatform

public minCpuPlatform: pulumi.Output<string>;

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property networkInterfaces

public networkInterfaces: pulumi.Output<{
    accessConfigs: {
        assignedNatIp: string;
        natIp: string;
        networkTier: string;
        publicPtrDomainName: string;
    }[];
    address: string;
    aliasIpRanges: {
        ipCidrRange: string;
        subnetworkRangeName: string;
    }[];
    name: string;
    network: string;
    networkIp: string;
    subnetwork: string;
    subnetworkProject: string;
}[]>;

property project

public project: pulumi.Output<string>;

property scheduling

public scheduling: pulumi.Output<{
    automaticRestart: boolean;
    onHostMaintenance: string;
    preemptible: boolean;
}>;

property scratchDisks

public scratchDisks: pulumi.Output<{
    interface: string;
}[]>;
public selfLink: pulumi.Output<string>;

property serviceAccount

public serviceAccount: pulumi.Output<{
    email: string;
    scopes: string[];
}>;

property sourceInstanceTemplate

public sourceInstanceTemplate: pulumi.Output<string>;

Name or self link of an instance template to create the instance based on.

property tags

public tags: pulumi.Output<string[]>;

property tagsFingerprint

public tagsFingerprint: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zone

public zone: pulumi.Output<string>;

The zone that the machine should be created in. If not set, the provider zone is used.

class InstanceGroup

extends CustomResource

Creates a group of dissimilar Compute Engine virtual machine instances. For more information, see the official documentation and API

Example Usage

Empty instance group

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const test = new gcp.compute.InstanceGroup("test", {
    description: "Terraform test instance group",
    network: google_compute_network_default.selfLink,
    zone: "us-central1-a",
});

With instances and named ports

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const webservers = new gcp.compute.InstanceGroup("webservers", {
    description: "Terraform test instance group",
    instances: [
        google_compute_instance_test.selfLink,
        google_compute_instance_test2.selfLink,
    ],
    namedPorts: [
        {
            name: "http",
            port: 8080,
        },
        {
            name: "https",
            port: 8443,
        },
    ],
    zone: "us-central1-a",
});

constructor

new InstanceGroup(name: string, args?: InstanceGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a InstanceGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceGroupState, opts?: pulumi.CustomResourceOptions): InstanceGroup

Get an existing InstanceGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property description

public description: pulumi.Output<string | undefined>;

An optional textual description of the instance group.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instances

public instances: pulumi.Output<string[]>;

List of instances in the group. They should be given as self_link URLs. When adding instances they must all be in the same network and zone as the instance group.

property name

public name: pulumi.Output<string>;

The name of the instance group. Must be 1-63 characters long and comply with RFC1035. Supported characters include lowercase letters, numbers, and hyphens.

property namedPorts

public namedPorts: pulumi.Output<{
    name: string;
    port: number;
}[] | undefined>;

The named port configuration. See the section below for details on configuration.

property network

public network: pulumi.Output<string>;

The URL of the network the instance group is in. If this is different from the network where the instances are in, the creation fails. Defaults to the network where the instances are in (if neither network nor instances is specified, this field will be blank).

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property size

public size: pulumi.Output<number>;

The number of instances in the group.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zone

public zone: pulumi.Output<string>;

The zone that this instance group should be created in.

class InstanceGroupManager

extends CustomResource

The Google Compute Engine Instance Group Manager API creates and manages pools of homogeneous Compute Engine virtual machine instances from a common instance template. For more information, see the official documentation and API

Note: Use google_compute_region_instance_group_manager to create a regional (multi-zone) instance group manager.

Example Usage with top level instance template

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const autohealing = new gcp.compute.HealthCheck("autohealing", {
    checkIntervalSec: 5,
    healthyThreshold: 2,
    httpHealthCheck: {
        port: 8080,
        requestPath: "/healthz",
    },
    timeoutSec: 5,
    unhealthyThreshold: 10, // 50 seconds
});
const appserver = new gcp.compute.InstanceGroupManager("appserver", {
    autoHealingPolicies: {
        healthCheck: autohealing.selfLink,
        initialDelaySec: 300,
    },
    baseInstanceName: "app",
    instanceTemplate: google_compute_instance_template_appserver.selfLink,
    namedPorts: [{
        name: "customHTTP",
        port: 8888,
    }],
    targetPools: [google_compute_target_pool_appserver.selfLink],
    targetSize: 2,
    updateStrategy: "NONE",
    zone: "us-central1-a",
});

Example Usage with multiple Versions

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const appserver = new gcp.compute.InstanceGroupManager("appserver", {
    baseInstanceName: "app",
    targetSize: 5,
    updateStrategy: "NONE",
    versions: [
        {
            instanceTemplate: google_compute_instance_template_appserver.selfLink,
        },
        {
            instanceTemplate: google_compute_instance_template_appserver_canary.selfLink,
            targetSize: {
                fixed: 1,
            },
        },
    ],
    zone: "us-central1-a",
});

constructor

new InstanceGroupManager(name: string, args: InstanceGroupManagerArgs, opts?: pulumi.CustomResourceOptions)

Create a InstanceGroupManager resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceGroupManagerState, opts?: pulumi.CustomResourceOptions): InstanceGroupManager

Get an existing InstanceGroupManager resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property autoHealingPolicies

public autoHealingPolicies: pulumi.Output<{
    healthCheck: string;
    initialDelaySec: number;
} | undefined>;

The autohealing policies for this managed instance group. You can specify only one value. Structure is documented below. For more information, see the official documentation. This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property baseInstanceName

public baseInstanceName: pulumi.Output<string>;

The base instance name to use for instances in this group. The value must be a valid RFC1035 name. Supported characters are lowercase letters, numbers, and hyphens (-). Instances are named by appending a hyphen and a random four-character string to the base instance name.

property description

public description: pulumi.Output<string | undefined>;

An optional textual description of the instance group manager.

property fingerprint

public fingerprint: pulumi.Output<string>;

The fingerprint of the instance group manager.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instanceGroup

public instanceGroup: pulumi.Output<string>;

The full URL of the instance group created by the manager.

property instanceTemplate

public instanceTemplate: pulumi.Output<string | undefined>;
  • The full URL to an instance template from which all new instances of this version will be created.

property name

public name: pulumi.Output<string>;
  • Version name.

property namedPorts

public namedPorts: pulumi.Output<{
    name: string;
    port: number;
}[] | undefined>;

The named port configuration. See the section below for details on configuration.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property rollingUpdatePolicy

public rollingUpdatePolicy: pulumi.Output<{
    maxSurgeFixed: number;
    maxSurgePercent: number;
    maxUnavailableFixed: number;
    maxUnavailablePercent: number;
    minReadySec: number;
    minimalAction: string;
    type: string;
} | undefined>;

The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.


public selfLink: pulumi.Output<string>;

The URL of the created resource.

property targetPools

public targetPools: pulumi.Output<string[] | undefined>;

The full URL of all target pools to which new instances in the group are added. Updating the target pools attribute does not affect existing instances.

property targetSize

public targetSize: pulumi.Output<number>;
  • The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below.

property updateStrategy

public updateStrategy: pulumi.Output<string | undefined>;

If the instance_template resource is modified, a value of "NONE" will prevent any of the managed instances from being restarted by Terraform. A value of "REPLACE" will restart all of the instances at once. "ROLLING_UPDATE" is supported as a beta feature. A value of "ROLLING_UPDATE" requires rolling_update_policy block to be set

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property versions

public versions: pulumi.Output<{
    instanceTemplate: string;
    name: string;
    targetSize: {
        fixed: number;
        percent: number;
    };
}[]>;

Application versions managed by this instance group. Each version deals with a specific instance template, allowing canary release scenarios. Conflicts with instance_template. Structure is documented below. Beware that exactly one version must not specify a target size. It means that versions with a target size will respect the setting, and the one without target size will be applied to all remaining Instances (top level target_size - each version target_size). This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property waitForInstances

public waitForInstances: pulumi.Output<boolean | undefined>;

Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out.

property zone

public zone: pulumi.Output<string>;

The zone that instances in this group should be created in.

class InstanceTemplate

extends CustomResource

Manages a VM instance template resource within GCE. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myImage = pulumi.output(gcp.compute.getImage({
    family: "debian-9",
    project: "debian-cloud",
}));
const foobar = new gcp.compute.Disk("foobar", {
    image: myImage.apply(myImage => myImage.selfLink),
    size: 10,
    type: "pd-ssd",
    zone: "us-central1-a",
});
const defaultInstanceTemplate = new gcp.compute.InstanceTemplate("default", {
    canIpForward: false,
    description: "This template is used to create app server instances.",
    disks: [
        // Create a new boot disk from an image
        {
            autoDelete: true,
            boot: true,
            sourceImage: "debian-cloud/debian-9",
        },
        // Use an existing disk resource
        {
            autoDelete: false,
            boot: false,
            // Instance Templates reference disks by name, not self link
            source: foobar.name,
        },
    ],
    instanceDescription: "description assigned to instances",
    labels: {
        environment: "dev",
    },
    machineType: "n1-standard-1",
    metadata: {
        foo: "bar",
    },
    networkInterfaces: [{
        network: "default",
    }],
    schedulings: [{
        automaticRestart: true,
        onHostMaintenance: "MIGRATE",
    }],
    serviceAccount: {
        scopes: [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    },
    tags: [
        "foo",
        "bar",
    ],
});

Using with Instance Group Manager

Instance Templates cannot be updated after creation with the Google Cloud Platform API. In order to update an Instance Template, Terraform will destroy the existing resource and create a replacement. In order to effectively use an Instance Template resource with an [Instance Group Manager resource][1], it’s recommended to specify create_before_destroy in a [lifecycle][2] block. Either omit the Instance Template name attribute, or specify a partial name with name_prefix. Example:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const instanceTemplate = new gcp.compute.InstanceTemplate("instance_template", {
    // boot disk
    disks: [{}],
    machineType: "n1-standard-1",
    namePrefix: "instance-template-",
    // networking
    networkInterfaces: [{}],
    region: "us-central1",
});
const instanceGroupManager = new gcp.compute.InstanceGroupManager("instance_group_manager", {
    baseInstanceName: "instance-group-manager",
    instanceTemplate: instanceTemplate.selfLink,
    targetSize: 1,
    zone: "us-central1-f",
});

With this setup Terraform generates a unique name for your Instance Template and can then update the Instance Group manager without conflict before destroying the previous Instance Template.

Deploying the Latest Image

A common way to use instance templates and managed instance groups is to deploy the latest image in a family, usually the latest build of your application. There are two ways to do this in Terraform, and they have their pros and cons. The difference ends up being in how “latest” is interpreted. You can either deploy the latest image available when Terraform runs, or you can have each instance check what the latest image is when it’s being created, either as part of a scaling event or being rebuilt by the instance group manager.

If you’re not sure, we recommend deploying the latest image available when Terraform runs, because this means all the instances in your group will be based on the same image, always, and means that no upgrades or changes to your instances happen outside of a terraform apply. You can achieve this by using the google_compute_image data source, which will retrieve the latest image on every terraform apply, and will update the template to use that specific image:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myImage = pulumi.output(gcp.compute.getImage({
    family: "debian-9",
    project: "debian-cloud",
}));
const instanceTemplate = new gcp.compute.InstanceTemplate("instance_template", {
    // boot disk
    disks: [{
        initializeParams: [{
            image: myImage.apply(myImage => myImage.selfLink),
        }],
    }],
    machineType: "n1-standard-1",
    namePrefix: "instance-template-",
    region: "us-central1",
});

To have instances update to the latest on every scaling event or instance re-creation, use the family as the image for the disk, and it will use GCP’s default behavior, setting the image for the template to the family:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const instanceTemplate = new gcp.compute.InstanceTemplate("instance_template", {
    // boot disk
    disks: [{
        initializeParams: [{
            image: "debian-cloud/debian-9",
        }],
    }],
    machineType: "n1-standard-1",
    namePrefix: "instance-template-",
    region: "us-central1",
});

constructor

new InstanceTemplate(name: string, args: InstanceTemplateArgs, opts?: pulumi.CustomResourceOptions)

Create a InstanceTemplate resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceTemplateState, opts?: pulumi.CustomResourceOptions): InstanceTemplate

Get an existing InstanceTemplate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property canIpForward

public canIpForward: pulumi.Output<boolean | undefined>;

Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.

property description

public description: pulumi.Output<string | undefined>;

A brief description of this resource.

property disks

public disks: pulumi.Output<{
    autoDelete: boolean;
    boot: boolean;
    deviceName: string;
    diskEncryptionKey: {
        kmsKeySelfLink: string;
    };
    diskName: string;
    diskSizeGb: number;
    diskType: string;
    interface: string;
    mode: string;
    source: string;
    sourceImage: string;
    type: string;
}[]>;

Disks to attach to instances created from this template. This can be specified multiple times for multiple disks. Structure is documented below.

property guestAccelerators

public guestAccelerators: pulumi.Output<{
    count: number;
    type: string;
}[] | undefined>;

List of the type and count of accelerator cards attached to the instance. Structure documented below.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instanceDescription

public instanceDescription: pulumi.Output<string | undefined>;

A brief description to use for instances created from this template.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

A set of key/value label pairs to assign to instances created from this template,

property machineType

public machineType: pulumi.Output<string>;

The machine type to create.

property metadata

public metadata: pulumi.Output<{[key: string]: any} | undefined>;

Metadata key/value pairs to make available from within instances created from this template.

property metadataFingerprint

public metadataFingerprint: pulumi.Output<string>;

The unique fingerprint of the metadata.

property metadataStartupScript

public metadataStartupScript: pulumi.Output<string | undefined>;

An alternative to using the startup-script metadata key, mostly to match the compute_instance resource. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously.

property minCpuPlatform

public minCpuPlatform: pulumi.Output<string | undefined>;

Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here.

property name

public name: pulumi.Output<string>;

The name of the instance template. If you leave this blank, Terraform will auto-generate a unique name.

property namePrefix

public namePrefix: pulumi.Output<string>;

Creates a unique name beginning with the specified prefix. Conflicts with name.

property networkInterfaces

public networkInterfaces: pulumi.Output<{
    accessConfigs: {
        assignedNatIp: string;
        natIp: string;
        networkTier: string;
    }[];
    address: string;
    aliasIpRanges: {
        ipCidrRange: string;
        subnetworkRangeName: string;
    }[];
    network: string;
    networkIp: string;
    subnetwork: string;
    subnetworkProject: string;
}[] | undefined>;

Networks to attach to instances created from this template. This can be specified multiple times for multiple networks. Structure is documented below.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

An instance template is a global resource that is not bound to a zone or a region. However, you can still specify some regional resources in an instance template, which restricts the template to the region where that resource resides. For example, a custom subnetwork resource is tied to a specific region. Defaults to the region of the Provider if no value is given.

property schedulings

public schedulings: pulumi.Output<{
    automaticRestart: boolean;
    onHostMaintenance: string;
    preemptible: boolean;
}[]>;

The scheduling strategy to use. More details about this configuration option are detailed below.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property serviceAccount

public serviceAccount: pulumi.Output<{
    email: string;
    scopes: string[];
} | undefined>;

Service account to attach to the instance. Structure is documented below.

property tags

public tags: pulumi.Output<string[] | undefined>;

Tags to attach to the instance.

property tagsFingerprint

public tagsFingerprint: pulumi.Output<string>;

The unique fingerprint of the tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class InterconnectAttachment

extends CustomResource

Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const foobar = new gcp.compute.Router("foobar", {
    network: google_compute_network_foobar.name,
});
const defaultInterconnectAttachment = new gcp.compute.InterconnectAttachment("default", {
    interconnect: "my-interconnect-id",
    router: foobar.selfLink,
});

constructor

new InterconnectAttachment(name: string, args: InterconnectAttachmentArgs, opts?: pulumi.CustomResourceOptions)

Create a InterconnectAttachment resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InterconnectAttachmentState, opts?: pulumi.CustomResourceOptions): InterconnectAttachment

Get an existing InterconnectAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property cloudRouterIpAddress

public cloudRouterIpAddress: pulumi.Output<string>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property customerRouterIpAddress

public customerRouterIpAddress: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property googleReferenceId

public googleReferenceId: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property interconnect

public interconnect: pulumi.Output<string>;

property name

public name: pulumi.Output<string>;

property privateInterconnectInfo

public privateInterconnectInfo: pulumi.Output<{
    tag8021q: number;
}>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

property router

public router: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Network

extends CustomResource

Manages a network within GCE. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultNetwork = new gcp.compute.Network("default", {
    autoCreateSubnetworks: true,
});

constructor

new Network(name: string, args?: NetworkArgs, opts?: pulumi.CustomResourceOptions)

Create a Network resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NetworkState, opts?: pulumi.CustomResourceOptions): Network

Get an existing Network resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property autoCreateSubnetworks

public autoCreateSubnetworks: pulumi.Output<boolean | undefined>;

If set to true, this network will be created in auto subnet mode, and Google will create a subnet for each region automatically. If set to false, a custom subnetted network will be created that can support google_compute_subnetwork resources. Defaults to true.

property description

public description: pulumi.Output<string | undefined>;

A brief description of this resource.

property gatewayIpv4

public gatewayIpv4: pulumi.Output<string>;

The IPv4 address of the gateway.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipv4Range

public ipv4Range: pulumi.Output<string | undefined>;

If set to a CIDR block, uses the legacy VPC API with the specified range. This API is deprecated. If set, auto_create_subnetworks must be explicitly set to false.

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property routingMode

public routingMode: pulumi.Output<string>;

Sets the network-wide routing mode for Cloud Routers to use. Accepted values are "GLOBAL" or "REGIONAL". Defaults to "REGIONAL". Refer to the Cloud Router documentation for more details.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class NetworkPeering

extends CustomResource

Manages a network peering within GCE. For more information see the official documentation and API.

Note: Both network must create a peering with each other for the peering to be functional.

Note: Subnets IP ranges across peered VPC networks cannot overlap.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultNetwork = new gcp.compute.Network("default", {
    autoCreateSubnetworks: false,
});
const other = new gcp.compute.Network("other", {
    autoCreateSubnetworks: false,
});
const peering1 = new gcp.compute.NetworkPeering("peering1", {
    network: defaultNetwork.selfLink,
    peerNetwork: other.selfLink,
});
const peering2 = new gcp.compute.NetworkPeering("peering2", {
    network: other.selfLink,
    peerNetwork: defaultNetwork.selfLink,
});

constructor

new NetworkPeering(name: string, args: NetworkPeeringArgs, opts?: pulumi.CustomResourceOptions)

Create a NetworkPeering resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NetworkPeeringState, opts?: pulumi.CustomResourceOptions): NetworkPeering

Get an existing NetworkPeering resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property autoCreateRoutes

public autoCreateRoutes: pulumi.Output<boolean | undefined>;

If set to true, the routes between the two networks will be created and managed automatically. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Name of the peering.

property network

public network: pulumi.Output<string>;

Resource link of the network to add a peering to.

property peerNetwork

public peerNetwork: pulumi.Output<string>;

Resource link of the peer network.

property state

public state: pulumi.Output<string>;

State for the peering.

property stateDetails

public stateDetails: pulumi.Output<string>;

Details about the current state of the peering.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ProjectMetadata

extends CustomResource

Manages metadata common to all instances for a project in GCE. For more information see the official documentation and API.

Note: If you want to manage only single key/value pairs within the project metadata rather than the entire set, then use google_compute_project_metadata_item.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultProjectMetadata = new gcp.compute.ProjectMetadata("default", {
    metadata: {
        "13": "42",
        fizz: "buzz",
        foo: "bar",
    },
});

constructor

new ProjectMetadata(name: string, args: ProjectMetadataArgs, opts?: pulumi.CustomResourceOptions)

Create a ProjectMetadata resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ProjectMetadataState, opts?: pulumi.CustomResourceOptions): ProjectMetadata

Get an existing ProjectMetadata resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property metadata

public metadata: pulumi.Output<{[key: string]: string}>;

A series of key value pairs. Changing this resource updates the GCE state.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ProjectMetadataItem

extends CustomResource

Manages a single key/value pair on metadata common to all instances for a project in GCE. Using google_compute_project_metadata_item lets you manage a single key/value setting in Terraform rather than the entire project metadata map.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultProjectMetadataItem = new gcp.compute.ProjectMetadataItem("default", {
    key: "my_metadata",
    value: "my_value",
});

constructor

new ProjectMetadataItem(name: string, args: ProjectMetadataItemArgs, opts?: pulumi.CustomResourceOptions)

Create a ProjectMetadataItem resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ProjectMetadataItemState, opts?: pulumi.CustomResourceOptions): ProjectMetadataItem

Get an existing ProjectMetadataItem resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property key

public key: pulumi.Output<string>;

The metadata key to set.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property value

public value: pulumi.Output<string>;

The value to set for the given metadata key.

class RegionAutoscaler

extends CustomResource

Represents an Autoscaler resource.

Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define.

To get more information about RegionAutoscaler, see:

Example Usage - Region Autoscaler Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const debian9 = pulumi.output(gcp.compute.getImage({
    family: "debian-9",
    project: "debian-cloud",
}));
const foobarTargetPool = new gcp.compute.TargetPool("foobar", {});
const foobarInstanceTemplate = new gcp.compute.InstanceTemplate("foobar", {
    canIpForward: false,
    disks: [{
        sourceImage: debian9.apply(debian9 => debian9.selfLink),
    }],
    machineType: "n1-standard-1",
    metadata: {
        foo: "bar",
    },
    networkInterfaces: [{
        network: "default",
    }],
    serviceAccount: {
        scopes: [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    },
    tags: [
        "foo",
        "bar",
    ],
});
const foobarRegionInstanceGroupManager = new gcp.compute.RegionInstanceGroupManager("foobar", {
    baseInstanceName: "foobar",
    instanceTemplate: foobarInstanceTemplate.selfLink,
    region: "us-central1",
    targetPools: [foobarTargetPool.selfLink],
});
const foobarRegionAutoscaler = new gcp.compute.RegionAutoscaler("foobar", {
    autoscalingPolicy: {
        cooldownPeriod: 60,
        cpuUtilization: {
            target: 0.5,
        },
        maxReplicas: 5,
        minReplicas: 1,
    },
    region: "us-central1",
    target: foobarRegionInstanceGroupManager.selfLink,
});

constructor

new RegionAutoscaler(name: string, args: RegionAutoscalerArgs, opts?: pulumi.CustomResourceOptions)

Create a RegionAutoscaler resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionAutoscalerState, opts?: pulumi.CustomResourceOptions): RegionAutoscaler

Get an existing RegionAutoscaler resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property autoscalingPolicy

public autoscalingPolicy: pulumi.Output<{
    cooldownPeriod: number;
    cpuUtilization: {
        target: number;
    };
    loadBalancingUtilization: {
        target: number;
    };
    maxReplicas: number;
    metrics: {
        name: string;
        target: number;
        type: string;
    }[];
    minReplicas: number;
}>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

property region

public region: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property target

public target: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class RegionBackendService

extends CustomResource

A Region Backend Service defines a regionally-scoped group of virtual machines that will serve traffic for load balancing. For more information see the official documentation and API.

Note: Region backend services can only be used when using internal load balancing. For external load balancing, use google_compute_backend_service instead.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
    checkIntervalSec: 1,
    tcpHealthCheck: {
        port: 80,
    },
    timeoutSec: 1,
});
const foobarInstanceTemplate = new gcp.compute.InstanceTemplate("foobar", {
    disks: [{
        autoDelete: true,
        boot: true,
        sourceImage: "debian-cloud/debian-9",
    }],
    machineType: "n1-standard-1",
    networkInterfaces: [{
        network: "default",
    }],
});
const foo = new gcp.compute.RegionInstanceGroupManager("foo", {
    baseInstanceName: "foobar",
    instanceTemplate: foobarInstanceTemplate.selfLink,
    region: "us-central1",
    targetSize: 1,
});
const foobarRegionBackendService = new gcp.compute.RegionBackendService("foobar", {
    backends: [{
        group: foo.instanceGroup,
    }],
    description: "Hello World 1234",
    healthChecks: defaultHealthCheck.selfLink,
    protocol: "TCP",
    sessionAffinity: "CLIENT_IP",
    timeoutSec: 10,
});

constructor

new RegionBackendService(name: string, args: RegionBackendServiceArgs, opts?: pulumi.CustomResourceOptions)

Create a RegionBackendService resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionBackendServiceState, opts?: pulumi.CustomResourceOptions): RegionBackendService

Get an existing RegionBackendService resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backends

public backends: pulumi.Output<{
    description: string;
    group: string;
}[] | undefined>;

The list of backends that serve this BackendService. Structure is documented below.

property connectionDrainingTimeoutSec

public connectionDrainingTimeoutSec: pulumi.Output<number | undefined>;

Time for which instance will be drained (not accept new connections, but still work to finish started ones). Defaults to 0.

property description

public description: pulumi.Output<string | undefined>;

The textual description for the backend service.

property fingerprint

public fingerprint: pulumi.Output<string>;

The fingerprint of the backend service.

property healthChecks

public healthChecks: pulumi.Output<string>;

Specifies a list of health checks for checking the health of the backend service. Currently at most one health check can be specified, and a health check is required.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the backend service.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property protocol

public protocol: pulumi.Output<string>;

The protocol for incoming requests. Defaults to TCP.

property region

public region: pulumi.Output<string>;

The Region in which the created address should reside. If it is not provided, the provider region is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sessionAffinity

public sessionAffinity: pulumi.Output<string>;

How to distribute load. Options are NONE (no affinity), CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. Defaults to NONE.

property timeoutSec

public timeoutSec: pulumi.Output<number>;

The number of secs to wait for a backend to respond to a request before considering the request failed. Defaults to 30.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class RegionDisk

extends CustomResource

Persistent disks are durable storage devices that function similarly to the physical disks in a desktop or a server. Compute Engine manages the hardware behind these devices to ensure data redundancy and optimize performance for you. Persistent disks are available as either standard hard disk drives (HDD) or solid-state drives (SSD).

Persistent disks are located independently from your virtual machine instances, so you can detach or move persistent disks to keep your data even after you delete your instances. Persistent disk performance scales automatically with size, so you can resize your existing persistent disks or add more persistent disks to an instance to meet your performance and storage space requirements.

Add a persistent disk to your instance when you need reliable and affordable storage with consistent performance characteristics.

To get more information about RegionDisk, see:

Warning: All arguments including the disk encryption key will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage - Region Disk Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const disk = new gcp.compute.Disk("disk", {
    image: "debian-cloud/debian-9",
    size: 50,
    type: "pd-ssd",
    zone: "us-central1-a",
});
const snapdisk = new gcp.compute.Snapshot("snapdisk", {
    sourceDisk: disk.name,
    zone: "us-central1-a",
});
const regiondisk = new gcp.compute.RegionDisk("regiondisk", {
    region: "us-central1",
    replicaZones: [
        "us-central1-a",
        "us-central1-f",
    ],
    snapshot: snapdisk.selfLink,
    type: "pd-ssd",
});

constructor

new RegionDisk(name: string, args: RegionDiskArgs, opts?: pulumi.CustomResourceOptions)

Create a RegionDisk resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionDiskState, opts?: pulumi.CustomResourceOptions): RegionDisk

Get an existing RegionDisk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property diskEncryptionKey

public diskEncryptionKey: pulumi.Output<{
    rawKey: string;
    sha256: string;
} | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property lastAttachTimestamp

public lastAttachTimestamp: pulumi.Output<string>;

property lastDetachTimestamp

public lastDetachTimestamp: pulumi.Output<string>;

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

property replicaZones

public replicaZones: pulumi.Output<string[]>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property size

public size: pulumi.Output<number>;

property snapshot

public snapshot: pulumi.Output<string | undefined>;

property sourceSnapshotEncryptionKey

public sourceSnapshotEncryptionKey: pulumi.Output<{
    rawKey: string;
    sha256: string;
} | undefined>;

property sourceSnapshotId

public sourceSnapshotId: pulumi.Output<string>;

property type

public type: pulumi.Output<string | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property users

public users: pulumi.Output<string[]>;

class RegionInstanceGroupManager

extends CustomResource

The Google Compute Engine Regional Instance Group Manager API creates and manages pools of homogeneous Compute Engine virtual machine instances from a common instance template. For more information, see the official documentation and API

Note: Use google_compute_instance_group_manager to create a single-zone instance group manager.

Example Usage with top level instance template

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const autohealing = new gcp.compute.HealthCheck("autohealing", {
    checkIntervalSec: 5,
    healthyThreshold: 2,
    httpHealthCheck: {
        port: 8080,
        requestPath: "/healthz",
    },
    timeoutSec: 5,
    unhealthyThreshold: 10, // 50 seconds
});
const appserver = new gcp.compute.RegionInstanceGroupManager("appserver", {
    autoHealingPolicies: {
        healthCheck: autohealing.selfLink,
        initialDelaySec: 300,
    },
    baseInstanceName: "app",
    distributionPolicyZones: [
        "us-central1-a",
        "us-central1-f",
    ],
    instanceTemplate: google_compute_instance_template_appserver.selfLink,
    namedPorts: [{
        name: "custom",
        port: 8888,
    }],
    region: "us-central1",
    targetPools: [google_compute_target_pool_appserver.selfLink],
    targetSize: 2,
});

Example Usage with multiple Versions

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const appserver = new gcp.compute.RegionInstanceGroupManager("appserver", {
    baseInstanceName: "app",
    region: "us-central1",
    targetSize: 5,
    updateStrategy: "NONE",
    versions: [
        {
            instanceTemplate: google_compute_instance_template_appserver.selfLink,
        },
        {
            instanceTemplate: google_compute_instance_template_appserver_canary.selfLink,
            targetSize: {
                fixed: 1,
            },
        },
    ],
});

constructor

new RegionInstanceGroupManager(name: string, args: RegionInstanceGroupManagerArgs, opts?: pulumi.CustomResourceOptions)

Create a RegionInstanceGroupManager resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionInstanceGroupManagerState, opts?: pulumi.CustomResourceOptions): RegionInstanceGroupManager

Get an existing RegionInstanceGroupManager resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property autoHealingPolicies

public autoHealingPolicies: pulumi.Output<{
    healthCheck: string;
    initialDelaySec: number;
} | undefined>;

The autohealing policies for this managed instance group. You can specify only one value. Structure is documented below. For more information, see the official documentation. This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property baseInstanceName

public baseInstanceName: pulumi.Output<string>;

The base instance name to use for instances in this group. The value must be a valid RFC1035 name. Supported characters are lowercase letters, numbers, and hyphens (-). Instances are named by appending a hyphen and a random four-character string to the base instance name.

property description

public description: pulumi.Output<string | undefined>;

An optional textual description of the instance group manager.

property distributionPolicyZones

public distributionPolicyZones: pulumi.Output<string[]>;

The distribution policy for this managed instance group. You can specify one or more values. For more information, see the official documentation.


property fingerprint

public fingerprint: pulumi.Output<string>;

The fingerprint of the instance group manager.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instanceGroup

public instanceGroup: pulumi.Output<string>;

The full URL of the instance group created by the manager.

property instanceTemplate

public instanceTemplate: pulumi.Output<string | undefined>;
  • The full URL to an instance template from which all new instances of this version will be created.

property name

public name: pulumi.Output<string>;
  • Version name.

property namedPorts

public namedPorts: pulumi.Output<{
    name: string;
    port: number;
}[] | undefined>;

The named port configuration. See the section below for details on configuration.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

The region where the managed instance group resides.

property rollingUpdatePolicy

public rollingUpdatePolicy: pulumi.Output<{
    maxSurgeFixed: number;
    maxSurgePercent: number;
    maxUnavailableFixed: number;
    maxUnavailablePercent: number;
    minReadySec: number;
    minimalAction: string;
    type: string;
} | undefined>;

The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

public selfLink: pulumi.Output<string>;

The URL of the created resource.

property targetPools

public targetPools: pulumi.Output<string[] | undefined>;

The full URL of all target pools to which new instances in the group are added. Updating the target pools attribute does not affect existing instances.

property targetSize

public targetSize: pulumi.Output<number>;
  • The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below.

property updateStrategy

public updateStrategy: pulumi.Output<string | undefined>;

If the instance_template resource is modified, a value of "NONE" will prevent any of the managed instances from being restarted by Terraform. A value of "ROLLING_UPDATE" is supported as a beta feature. A value of "ROLLING_UPDATE" requires rolling_update_policy block to be set. This field is deprecated as in 2.0.0 it has no functionality anymore. It will be removed then. This field is only present in the google provider.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property versions

public versions: pulumi.Output<{
    instanceTemplate: string;
    name: string;
    targetSize: {
        fixed: number;
        percent: number;
    };
}[]>;

Application versions managed by this instance group. Each version deals with a specific instance template, allowing canary release scenarios. Conflicts with instance_template. Structure is documented below. Beware that exactly one version must not specify a target size. It means that versions with a target size will respect the setting, and the one without target size will be applied to all remaining Instances (top level target_size - each version target_size). This property is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta fields.

property waitForInstances

public waitForInstances: pulumi.Output<boolean | undefined>;

Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out.

class Route

extends CustomResource

Represents a Route resource.

A route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with virtual machines by tag, and the set of routes for a particular virtual machine is called its routing table. For each packet leaving a virtual machine, the system searches that virtual machine’s routing table for a single best matching route.

Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the next_hop field of the winning route – either to another virtual machine destination, a virtual machine gateway or a Compute Engine-operated gateway. Packets that do not match any route in the sending virtual machine’s routing table will be dropped.

A Route resource must have exactly one specification of either nextHopGateway, nextHopInstance, nextHopIp, or nextHopVpnTunnel.

To get more information about Route, see:

Example Usage - Route Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultNetwork = new gcp.compute.Network("default", {});
const defaultRoute = new gcp.compute.Route("default", {
    destRange: "15.0.0.0/24",
    network: defaultNetwork.name,
    nextHopIp: "10.132.1.5",
    priority: 100,
});

constructor

new Route(name: string, args: RouteArgs, opts?: pulumi.CustomResourceOptions)

Create a Route resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RouteState, opts?: pulumi.CustomResourceOptions): Route

Get an existing Route resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property description

public description: pulumi.Output<string | undefined>;

property destRange

public destRange: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string>;

property nextHopGateway

public nextHopGateway: pulumi.Output<string | undefined>;

property nextHopInstance

public nextHopInstance: pulumi.Output<string | undefined>;

property nextHopInstanceZone

public nextHopInstanceZone: pulumi.Output<string | undefined>;

(Optional when next_hop_instance is specified) The zone of the instance specified in next_hop_instance. Omit if next_hop_instance is specified as a URL.

property nextHopIp

public nextHopIp: pulumi.Output<string | undefined>;

property nextHopNetwork

public nextHopNetwork: pulumi.Output<string>;

property nextHopVpnTunnel

public nextHopVpnTunnel: pulumi.Output<string | undefined>;

property priority

public priority: pulumi.Output<number | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property tags

public tags: pulumi.Output<string[] | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Router

extends CustomResource

Represents a Router resource.

To get more information about Router, see:

Example Usage - Router Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const foobarNetwork = new gcp.compute.Network("foobar", {
    autoCreateSubnetworks: false,
});
const foobarRouter = new gcp.compute.Router("foobar", {
    bgp: {
        advertiseMode: "CUSTOM",
        advertisedGroups: ["ALL_SUBNETS"],
        advertisedIpRanges: [
            {
                range: "1.2.3.4",
            },
            {
                range: "6.7.0.0/16",
            },
        ],
        asn: 64514,
    },
    network: foobarNetwork.name,
});

constructor

new Router(name: string, args: RouterArgs, opts?: pulumi.CustomResourceOptions)

Create a Router resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RouterState, opts?: pulumi.CustomResourceOptions): Router

Get an existing Router resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property bgp

public bgp: pulumi.Output<{
    advertiseMode: string;
    advertisedGroups: string[];
    advertisedIpRanges: {
        description: string;
        range: string;
    }[];
    asn: number;
} | undefined>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class RouterInterface

extends CustomResource

Manages a Cloud Router interface. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const foobar = new gcp.compute.RouterInterface("foobar", {
    ipRange: "169.254.1.1/30",
    region: "us-central1",
    router: "router-1",
    vpnTunnel: "tunnel-1",
});

constructor

new RouterInterface(name: string, args: RouterInterfaceArgs, opts?: pulumi.CustomResourceOptions)

Create a RouterInterface resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RouterInterfaceState, opts?: pulumi.CustomResourceOptions): RouterInterface

Get an existing RouterInterface resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipRange

public ipRange: pulumi.Output<string | undefined>;

IP address and range of the interface. The IP range must be in the RFC3927 link-local IP space. Changing this forces a new interface to be created.

property name

public name: pulumi.Output<string>;

A unique name for the interface, required by GCE. Changing this forces a new interface to be created.

property project

public project: pulumi.Output<string>;

The ID of the project in which this interface’s router belongs. If it is not provided, the provider project is used. Changing this forces a new interface to be created.

property region

public region: pulumi.Output<string>;

The region this interface’s router sits in. If not specified, the project region will be used. Changing this forces a new interface to be created.

property router

public router: pulumi.Output<string>;

The name of the router this interface will be attached to. Changing this forces a new interface to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vpnTunnel

public vpnTunnel: pulumi.Output<string>;

The name or resource link to the VPN tunnel this interface will be linked to. Changing this forces a new interface to be created.

class RouterNat

extends CustomResource

constructor

new RouterNat(name: string, args: RouterNatArgs, opts?: pulumi.CustomResourceOptions)

Create a RouterNat resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RouterNatState, opts?: pulumi.CustomResourceOptions): RouterNat

Get an existing RouterNat resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property icmpIdleTimeoutSec

public icmpIdleTimeoutSec: pulumi.Output<number | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property minPortsPerVm

public minPortsPerVm: pulumi.Output<number | undefined>;

property name

public name: pulumi.Output<string>;

property natIpAllocateOption

public natIpAllocateOption: pulumi.Output<string>;

property natIps

public natIps: pulumi.Output<string[] | undefined>;

property project

public project: pulumi.Output<string>;

property region

public region: pulumi.Output<string>;

property router

public router: pulumi.Output<string>;

property sourceSubnetworkIpRangesToNat

public sourceSubnetworkIpRangesToNat: pulumi.Output<string | undefined>;

property subnetworks

public subnetworks: pulumi.Output<{
    name: string;
    secondaryIpRangeNames: string[];
    sourceIpRangesToNats: string[];
}[] | undefined>;

property tcpEstablishedIdleTimeoutSec

public tcpEstablishedIdleTimeoutSec: pulumi.Output<number | undefined>;

property tcpTransitoryIdleTimeoutSec

public tcpTransitoryIdleTimeoutSec: pulumi.Output<number | undefined>;

property udpIdleTimeoutSec

public udpIdleTimeoutSec: pulumi.Output<number | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class RouterPeer

extends CustomResource

Manages a Cloud Router BGP peer. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const foobar = new gcp.compute.RouterPeer("foobar", {
    advertisedRoutePriority: 100,
    interface: "interface-1",
    peerAsn: 65513,
    peerIpAddress: "169.254.1.2",
    region: "us-central1",
    router: "router-1",
});

constructor

new RouterPeer(name: string, args: RouterPeerArgs, opts?: pulumi.CustomResourceOptions)

Create a RouterPeer resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RouterPeerState, opts?: pulumi.CustomResourceOptions): RouterPeer

Get an existing RouterPeer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property advertisedRoutePriority

public advertisedRoutePriority: pulumi.Output<number | undefined>;

The priority of routes advertised to this BGP peer. Changing this forces a new peer to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property interface

public interface: pulumi.Output<string>;

The name of the interface the BGP peer is associated with. Changing this forces a new peer to be created.

property ipAddress

public ipAddress: pulumi.Output<string>;

IP address of the interface inside Google Cloud Platform.

property name

public name: pulumi.Output<string>;

A unique name for BGP peer, required by GCE. Changing this forces a new peer to be created.

property peerAsn

public peerAsn: pulumi.Output<number>;

Peer BGP Autonomous System Number (ASN). Changing this forces a new peer to be created.

property peerIpAddress

public peerIpAddress: pulumi.Output<string | undefined>;

IP address of the BGP interface outside Google Cloud. Changing this forces a new peer to be created.

property project

public project: pulumi.Output<string>;

The ID of the project in which this peer’s router belongs. If it is not provided, the provider project is used. Changing this forces a new peer to be created.

property region

public region: pulumi.Output<string>;

The region this peer’s router sits in. If not specified, the project region will be used. Changing this forces a new peer to be created.

property router

public router: pulumi.Output<string>;

The name of the router in which this BGP peer will be configured. Changing this forces a new peer to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SSLCertificate

extends CustomResource

An SslCertificate resource, used for HTTPS load balancing. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user.

To get more information about SslCertificate, see:

Example Usage - Ssl Certificate Basic

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";

const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
    certificate: fs.readFileSync("path/to/certificate.crt", "utf-8"),
    description: "a description",
    namePrefix: "my-certificate-",
    privateKey: fs.readFileSync("path/to/private.key", "utf-8"),
});

Example Usage - Ssl Certificate Random Provider

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";
import * as random from "@pulumi/random";

const certificate = new random.RandomId("certificate", {
    byteLength: 4,
    // For security, do not expose raw certificate values in the output
    keepers: {
        certificate: (() => {
            throw "tf2pulumi error: NYI: call to base64sha256";
            return (() => { throw "NYI: call to base64sha256"; })();
        })(),
        private_key: (() => {
            throw "tf2pulumi error: NYI: call to base64sha256";
            return (() => { throw "NYI: call to base64sha256"; })();
        })(),
    },
    prefix: "my-certificate-",
});
// You may also want to control name generation explicitly:
const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
    certificate: fs.readFileSync("path/to/certificate.crt", "utf-8"),
    privateKey: fs.readFileSync("path/to/private.key", "utf-8"),
});

Example Usage - Ssl Certificate Target Https Proxies

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
    certificate: fs.readFileSync("path/to/certificate.crt", "utf-8"),
    namePrefix: "my-certificate-",
    privateKey: fs.readFileSync("path/to/private.key", "utf-8"),
});
const defaultBackendService = new gcp.compute.BackendService("default", {
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});
const defaultURLMap = new gcp.compute.URLMap("default", {
    defaultService: defaultBackendService.selfLink,
    description: "a description",
    hostRules: [{
        hosts: ["mysite.com"],
        pathMatcher: "allpaths",
    }],
    pathMatchers: [{
        defaultService: defaultBackendService.selfLink,
        name: "allpaths",
        pathRules: [{
            paths: ["/*"],
            service: defaultBackendService.selfLink,
        }],
    }],
});
const defaultTargetHttpsProxy = new gcp.compute.TargetHttpsProxy("default", {
    sslCertificates: [defaultSSLCertificate.selfLink],
    urlMap: defaultURLMap.selfLink,
});

constructor

new SSLCertificate(name: string, args: SSLCertificateArgs, opts?: pulumi.CustomResourceOptions)

Create a SSLCertificate resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SSLCertificateState, opts?: pulumi.CustomResourceOptions): SSLCertificate

Get an existing SSLCertificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property certificate

public certificate: pulumi.Output<string>;

property certificateId

public certificateId: pulumi.Output<number>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property namePrefix

public namePrefix: pulumi.Output<string>;

Creates a unique name beginning with the specified prefix. Conflicts with name.

property privateKey

public privateKey: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SSLPolicy

extends CustomResource

Represents a SSL policy. SSL policies give you the ability to control the features of SSL that your SSL proxy or HTTPS load balancer negotiates.

To get more information about SslPolicy, see:

Example Usage - Ssl Policy Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const custom_ssl_policy = new gcp.compute.SSLPolicy("custom-ssl-policy", {
    customFeatures: [
        "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
        "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
    ],
    minTlsVersion: "TLS_1_2",
    profile: "CUSTOM",
});
const nonprod_ssl_policy = new gcp.compute.SSLPolicy("nonprod-ssl-policy", {
    minTlsVersion: "TLS_1_2",
    profile: "MODERN",
});
const prod_ssl_policy = new gcp.compute.SSLPolicy("prod-ssl-policy", {
    profile: "MODERN",
});

constructor

new SSLPolicy(name: string, args?: SSLPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a SSLPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SSLPolicyState, opts?: pulumi.CustomResourceOptions): SSLPolicy

Get an existing SSLPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property customFeatures

public customFeatures: pulumi.Output<string[] | undefined>;

property description

public description: pulumi.Output<string | undefined>;

property enabledFeatures

public enabledFeatures: pulumi.Output<string[]>;

property fingerprint

public fingerprint: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property minTlsVersion

public minTlsVersion: pulumi.Output<string | undefined>;

property name

public name: pulumi.Output<string>;

property profile

public profile: pulumi.Output<string | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SecurityPolicy

extends CustomResource

A Security Policy defines an IP blacklist or whitelist that protects load balanced Google Cloud services by denying or permitting traffic from specified IP ranges. For more information see the official documentation and the API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const policy = new gcp.compute.SecurityPolicy("policy", {
    rules: [
        {
            action: "deny(403)",
            description: "Deny access to IPs in 9.9.9.0/24",
            match: {
                config: {
                    srcIpRanges: ["9.9.9.9/32"],
                },
                versionedExpr: "SRC_IPS_V1",
            },
            priority: 1000,
        },
        {
            action: "allow",
            description: "default rule",
            match: {
                config: {
                    srcIpRanges: ["*"],
                },
                versionedExpr: "SRC_IPS_V1",
            },
            priority: 2147483647,
        },
    ],
});

constructor

new SecurityPolicy(name: string, args?: SecurityPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a SecurityPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SecurityPolicyState, opts?: pulumi.CustomResourceOptions): SecurityPolicy

Get an existing SecurityPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property description

public description: pulumi.Output<string | undefined>;

An optional description of this security policy. Max size is 2048.

property fingerprint

public fingerprint: pulumi.Output<string>;

Fingerprint of this resource.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the security policy.

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property rules

public rules: pulumi.Output<{
    action: string;
    description: string;
    match: {
        config: {
            srcIpRanges: string[];
        };
        versionedExpr: string;
    };
    preview: boolean;
    priority: number;
}[]>;

The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match “*”). If no rules are provided when creating a security policy, a default rule with action “allow” will be added. Structure is documented below.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SharedVPCHostProject

extends CustomResource

Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a Shared VPC host project.

For more information, see, the Project API documentation, where the Shared VPC feature is referred to by its former name “XPN”.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

// A host project provides network resources to associated service projects.
const host = new gcp.compute.SharedVPCHostProject("host", {
    project: "host-project-id",
});
// A service project gains access to network resources provided by its
// associated host project.
const service1 = new gcp.compute.SharedVPCServiceProject("service1", {
    hostProject: host.project,
    serviceProject: "service-project-id-1",
});
const service2 = new gcp.compute.SharedVPCServiceProject("service2", {
    hostProject: host.project,
    serviceProject: "service-project-id-2",
});

constructor

new SharedVPCHostProject(name: string, args: SharedVPCHostProjectArgs, opts?: pulumi.CustomResourceOptions)

Create a SharedVPCHostProject resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SharedVPCHostProjectState, opts?: pulumi.CustomResourceOptions): SharedVPCHostProject

Get an existing SharedVPCHostProject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property project

public project: pulumi.Output<string>;

The ID of the project that will serve as a Shared VPC host project

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SharedVPCServiceProject

extends CustomResource

Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a Shared VPC service project associated with a given host project.

For more information, see, the Project API documentation, where the Shared VPC feature is referred to by its former name “XPN”.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const service1 = new gcp.compute.SharedVPCServiceProject("service1", {
    hostProject: "host-project-id",
    serviceProject: "service-project-id-1",
});

For a complete Shared VPC example with both host and service projects, see google_compute_shared_vpc_host_project.

constructor

new SharedVPCServiceProject(name: string, args: SharedVPCServiceProjectArgs, opts?: pulumi.CustomResourceOptions)

Create a SharedVPCServiceProject resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SharedVPCServiceProjectState, opts?: pulumi.CustomResourceOptions): SharedVPCServiceProject

Get an existing SharedVPCServiceProject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property hostProject

public hostProject: pulumi.Output<string>;

The ID of a host project to associate.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property serviceProject

public serviceProject: pulumi.Output<string>;

The ID of the project that will serve as a Shared VPC service project.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Snapshot

extends CustomResource

Represents a Persistent Disk Snapshot resource.

Use snapshots to back up data from your persistent disks. Snapshots are different from public images and custom images, which are used primarily to create instances or configure instance templates. Snapshots are useful for periodic backup of the data on your persistent disks. You can create snapshots from persistent disks even while they are attached to running instances.

Snapshots are incremental, so you can create regular snapshots on a persistent disk faster and at a much lower cost than if you regularly created a full image of the disk.

To get more information about Snapshot, see:

Example Usage - Snapshot Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const debian = pulumi.output(gcp.compute.getImage({
    family: "debian-9",
    project: "debian-cloud",
}));
const persistent = new gcp.compute.Disk("persistent", {
    image: debian.apply(debian => debian.selfLink),
    size: 10,
    type: "pd-ssd",
    zone: "us-central1-a",
});
const snapshot = new gcp.compute.Snapshot("snapshot", {
    labels: {
        my_label: "%s",
    },
    sourceDisk: persistent.name,
    zone: "us-central1-a",
});

constructor

new Snapshot(name: string, args: SnapshotArgs, opts?: pulumi.CustomResourceOptions)

Create a Snapshot resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SnapshotState, opts?: pulumi.CustomResourceOptions): Snapshot

Get an existing Snapshot resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property diskSizeGb

public diskSizeGb: pulumi.Output<number>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property licenses

public licenses: pulumi.Output<string[]>;

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property snapshotEncryptionKey

public snapshotEncryptionKey: pulumi.Output<{
    rawKey: string;
    sha256: string;
}>;

property snapshotEncryptionKeyRaw

public snapshotEncryptionKeyRaw: pulumi.Output<string | undefined>;

property snapshotEncryptionKeySha256

public snapshotEncryptionKeySha256: pulumi.Output<string>;

property snapshotId

public snapshotId: pulumi.Output<number>;

property sourceDisk

public sourceDisk: pulumi.Output<string>;

property sourceDiskEncryptionKey

public sourceDiskEncryptionKey: pulumi.Output<{
    rawKey: string;
} | undefined>;

property sourceDiskEncryptionKeyRaw

public sourceDiskEncryptionKeyRaw: pulumi.Output<string | undefined>;

property sourceDiskEncryptionKeySha256

public sourceDiskEncryptionKeySha256: pulumi.Output<string>;
public sourceDiskLink: pulumi.Output<string>;

property storageBytes

public storageBytes: pulumi.Output<number>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zone

public zone: pulumi.Output<string>;

class Subnetwork

extends CustomResource

A VPC network is a virtual version of the traditional physical networks that exist within and between physical data centers. A VPC network provides connectivity for your Compute Engine virtual machine (VM) instances, Container Engine containers, App Engine Flex services, and other network-related resources.

Each GCP project contains one or more VPC networks. Each VPC network is a global entity spanning all GCP regions. This global VPC network allows VM instances and other resources to communicate with each other via internal, private IP addresses.

Each VPC network is subdivided into subnets, and each subnet is contained within a single region. You can have more than one subnet in a region for a given VPC network. Each subnet has a contiguous private RFC1918 IP space. You create instances, containers, and the like in these subnets. When you create an instance, you must create it in a subnet, and the instance draws its internal IP address from that subnet.

Virtual machine (VM) instances in a VPC network can communicate with instances in all other subnets of the same VPC network, regardless of region, using their RFC1918 private IP addresses. You can isolate portions of the network, even entire subnets, using firewall rules.

To get more information about Subnetwork, see:

Example Usage - Subnetwork Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const custom_test = new gcp.compute.Network("custom-test", {
    autoCreateSubnetworks: false,
});
const network_with_private_secondary_ip_ranges = new gcp.compute.Subnetwork("network-with-private-secondary-ip-ranges", {
    ipCidrRange: "10.2.0.0/16",
    network: custom_test.selfLink,
    region: "us-central1",
    secondaryIpRanges: [{
        ipCidrRange: "192.168.10.0/24",
        rangeName: "tf-test-secondary-range-update1",
    }],
});

constructor

new Subnetwork(name: string, args: SubnetworkArgs, opts?: pulumi.CustomResourceOptions)

Create a Subnetwork resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubnetworkState, opts?: pulumi.CustomResourceOptions): Subnetwork

Get an existing Subnetwork resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property enableFlowLogs

public enableFlowLogs: pulumi.Output<boolean | undefined>;

property fingerprint

public fingerprint: pulumi.Output<string>;

property gatewayAddress

public gatewayAddress: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipCidrRange

public ipCidrRange: pulumi.Output<string>;

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string>;

property privateIpGoogleAccess

public privateIpGoogleAccess: pulumi.Output<boolean | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

property secondaryIpRanges

public secondaryIpRanges: pulumi.Output<{
    ipCidrRange: string;
    rangeName: string;
}[]>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SubnetworkIAMBinding

extends CustomResource

Warning: These resources are in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

Three different resources help you manage your IAM policy for GCE subnetwork. Each of these resources serves a different use case:

  • google_compute_subnetwork_iam_policy: Authoritative. Sets the IAM policy for the subnetwork and replaces any existing policy already attached.
  • google_compute_subnetwork_iam_binding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the subnetwork are preserved.
  • google_compute_subnetwork_iam_member: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subnetwork are preserved.

Note: google_compute_subnetwork_iam_policy cannot be used in conjunction with google_compute_subnetwork_iam_binding and google_compute_subnetwork_iam_member or they will fight over what your policy should be.

Note: google_compute_subnetwork_iam_binding resources can be used in conjunction with google_compute_subnetwork_iam_member resources only if they do not grant privilege to the same role.

google_compute_subnetwork_iam_policy

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const subnet = new gcp.compute.SubnetworkIAMPolicy("subnet", {
    policyData: admin.apply(admin => admin.policyData),
    subnetwork: "your-subnetwork-id",
});

google_compute_subnetwork_iam_binding

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const subnet = new gcp.compute.SubnetworkIAMBinding("subnet", {
    members: ["user:jane@example.com"],
    role: "roles/compute.networkUser",
    subnetwork: "your-subnetwork-id",
});

google\compute_subnetwork_iam_member

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const subnet = new gcp.compute.SubnetworkIAMMember("subnet", {
    member: "user:jane@example.com",
    role: "roles/compute.networkUser",
    subnetwork: "your-subnetwork-id",
});

constructor

new SubnetworkIAMBinding(name: string, args: SubnetworkIAMBindingArgs, opts?: pulumi.CustomResourceOptions)

Create a SubnetworkIAMBinding resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubnetworkIAMBindingState, opts?: pulumi.CustomResourceOptions): SubnetworkIAMBinding

Get an existing SubnetworkIAMBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the subnetwork’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property members

public members: pulumi.Output<string[]>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

The region of the subnetwork. If unspecified, this defaults to the region configured in the provider.

property role

public role: pulumi.Output<string>;

The role that should be applied. Only one google_compute_subnetwork_iam_binding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subnetwork

public subnetwork: pulumi.Output<string>;

The name of the subnetwork.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SubnetworkIAMMember

extends CustomResource

Warning: These resources are in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

Three different resources help you manage your IAM policy for GCE subnetwork. Each of these resources serves a different use case:

  • google_compute_subnetwork_iam_policy: Authoritative. Sets the IAM policy for the subnetwork and replaces any existing policy already attached.
  • google_compute_subnetwork_iam_binding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the subnetwork are preserved.
  • google_compute_subnetwork_iam_member: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subnetwork are preserved.

Note: google_compute_subnetwork_iam_policy cannot be used in conjunction with google_compute_subnetwork_iam_binding and google_compute_subnetwork_iam_member or they will fight over what your policy should be.

Note: google_compute_subnetwork_iam_binding resources can be used in conjunction with google_compute_subnetwork_iam_member resources only if they do not grant privilege to the same role.

google_compute_subnetwork_iam_policy

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const subnet = new gcp.compute.SubnetworkIAMPolicy("subnet", {
    policyData: admin.apply(admin => admin.policyData),
    subnetwork: "your-subnetwork-id",
});

google_compute_subnetwork_iam_binding

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const subnet = new gcp.compute.SubnetworkIAMBinding("subnet", {
    members: ["user:jane@example.com"],
    role: "roles/compute.networkUser",
    subnetwork: "your-subnetwork-id",
});

google\compute_subnetwork_iam_member

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const subnet = new gcp.compute.SubnetworkIAMMember("subnet", {
    member: "user:jane@example.com",
    role: "roles/compute.networkUser",
    subnetwork: "your-subnetwork-id",
});

constructor

new SubnetworkIAMMember(name: string, args: SubnetworkIAMMemberArgs, opts?: pulumi.CustomResourceOptions)

Create a SubnetworkIAMMember resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubnetworkIAMMemberState, opts?: pulumi.CustomResourceOptions): SubnetworkIAMMember

Get an existing SubnetworkIAMMember resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the subnetwork’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property member

public member: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

The region of the subnetwork. If unspecified, this defaults to the region configured in the provider.

property role

public role: pulumi.Output<string>;

The role that should be applied. Only one google_compute_subnetwork_iam_binding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subnetwork

public subnetwork: pulumi.Output<string>;

The name of the subnetwork.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SubnetworkIAMPolicy

extends CustomResource

Warning: These resources are in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

Three different resources help you manage your IAM policy for GCE subnetwork. Each of these resources serves a different use case:

  • google_compute_subnetwork_iam_policy: Authoritative. Sets the IAM policy for the subnetwork and replaces any existing policy already attached.
  • google_compute_subnetwork_iam_binding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the subnetwork are preserved.
  • google_compute_subnetwork_iam_member: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subnetwork are preserved.

Note: google_compute_subnetwork_iam_policy cannot be used in conjunction with google_compute_subnetwork_iam_binding and google_compute_subnetwork_iam_member or they will fight over what your policy should be.

Note: google_compute_subnetwork_iam_binding resources can be used in conjunction with google_compute_subnetwork_iam_member resources only if they do not grant privilege to the same role.

google_compute_subnetwork_iam_policy

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const subnet = new gcp.compute.SubnetworkIAMPolicy("subnet", {
    policyData: admin.apply(admin => admin.policyData),
    subnetwork: "your-subnetwork-id",
});

google_compute_subnetwork_iam_binding

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const subnet = new gcp.compute.SubnetworkIAMBinding("subnet", {
    members: ["user:jane@example.com"],
    role: "roles/compute.networkUser",
    subnetwork: "your-subnetwork-id",
});

google\compute_subnetwork_iam_member

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const subnet = new gcp.compute.SubnetworkIAMMember("subnet", {
    member: "user:jane@example.com",
    role: "roles/compute.networkUser",
    subnetwork: "your-subnetwork-id",
});

constructor

new SubnetworkIAMPolicy(name: string, args: SubnetworkIAMPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a SubnetworkIAMPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubnetworkIAMPolicyState, opts?: pulumi.CustomResourceOptions): SubnetworkIAMPolicy

Get an existing SubnetworkIAMPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the subnetwork’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property policyData

public policyData: pulumi.Output<string>;

The policy data generated by a google_iam_policy data source.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

The region of the subnetwork. If unspecified, this defaults to the region configured in the provider.

property subnetwork

public subnetwork: pulumi.Output<string>;

The name of the subnetwork.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TargetHttpProxy

extends CustomResource

Represents a TargetHttpProxy resource, which is used by one or more global forwarding rule to route incoming HTTP requests to a URL map.

To get more information about TargetHttpProxy, see:

Example Usage - Target Http Proxy Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const defaultBackendService = new gcp.compute.BackendService("default", {
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});
const defaultURLMap = new gcp.compute.URLMap("default", {
    defaultService: defaultBackendService.selfLink,
    hostRules: [{
        hosts: ["mysite.com"],
        pathMatcher: "allpaths",
    }],
    pathMatchers: [{
        defaultService: defaultBackendService.selfLink,
        name: "allpaths",
        pathRules: [{
            paths: ["/*"],
            service: defaultBackendService.selfLink,
        }],
    }],
});
const defaultTargetHttpProxy = new gcp.compute.TargetHttpProxy("default", {
    urlMap: defaultURLMap.selfLink,
});

constructor

new TargetHttpProxy(name: string, args: TargetHttpProxyArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetHttpProxy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetHttpProxyState, opts?: pulumi.CustomResourceOptions): TargetHttpProxy

Get an existing TargetHttpProxy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property proxyId

public proxyId: pulumi.Output<number>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urlMap

public urlMap: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TargetHttpsProxy

extends CustomResource

Represents a TargetHttpsProxy resource, which is used by one or more global forwarding rule to route incoming HTTPS requests to a URL map.

To get more information about TargetHttpsProxy, see:

Example Usage - Target Https Proxy Basic

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
    certificate: fs.readFileSync("path/to/certificate.crt", "utf-8"),
    privateKey: fs.readFileSync("path/to/private.key", "utf-8"),
});
const defaultBackendService = new gcp.compute.BackendService("default", {
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});
const defaultURLMap = new gcp.compute.URLMap("default", {
    defaultService: defaultBackendService.selfLink,
    description: "a description",
    hostRules: [{
        hosts: ["mysite.com"],
        pathMatcher: "allpaths",
    }],
    pathMatchers: [{
        defaultService: defaultBackendService.selfLink,
        name: "allpaths",
        pathRules: [{
            paths: ["/*"],
            service: defaultBackendService.selfLink,
        }],
    }],
});
const defaultTargetHttpsProxy = new gcp.compute.TargetHttpsProxy("default", {
    sslCertificates: [defaultSSLCertificate.selfLink],
    urlMap: defaultURLMap.selfLink,
});

constructor

new TargetHttpsProxy(name: string, args: TargetHttpsProxyArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetHttpsProxy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetHttpsProxyState, opts?: pulumi.CustomResourceOptions): TargetHttpsProxy

Get an existing TargetHttpsProxy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property proxyId

public proxyId: pulumi.Output<number>;

property quicOverride

public quicOverride: pulumi.Output<string | undefined>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sslCertificates

public sslCertificates: pulumi.Output<string[]>;

property sslPolicy

public sslPolicy: pulumi.Output<string | undefined>;

property urlMap

public urlMap: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TargetPool

extends CustomResource

Manages a Target Pool within GCE. This is a collection of instances used as target of a network load balancer (Forwarding Rule). For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const defaultTargetPool = new gcp.compute.TargetPool("default", {
    healthChecks: defaultHttpHealthCheck.name,
    instances: [
        "us-central1-a/myinstance1",
        "us-central1-b/myinstance2",
    ],
});

constructor

new TargetPool(name: string, args?: TargetPoolArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetPool resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetPoolState, opts?: pulumi.CustomResourceOptions): TargetPool

Get an existing TargetPool resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backupPool

public backupPool: pulumi.Output<string | undefined>;

URL to the backup target pool. Must also set failover_ratio.

property description

public description: pulumi.Output<string | undefined>;

Textual description field.

property failoverRatio

public failoverRatio: pulumi.Output<number | undefined>;

Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).

property healthChecks

public healthChecks: pulumi.Output<string | undefined>;

List of zero or one health check name or self_link. Only legacy google_compute_http_health_check is supported.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instances

public instances: pulumi.Output<string[]>;

List of instances in the pool. They can be given as URLs, or in the form of “zone/name”. Note that the instances need not exist at the time of target pool creation, so there is no need to use the Terraform interpolators to create a dependency on the instances from the target pool.

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

Where the target pool resides. Defaults to project region.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sessionAffinity

public sessionAffinity: pulumi.Output<string | undefined>;

How to distribute load. Options are “NONE” (no affinity). “CLIENT_IP” (hash of the source/dest addresses / ports), and “CLIENT_IP_PROTO” also includes the protocol (default “NONE”).

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TargetSSLProxy

extends CustomResource

Represents a TargetSslProxy resource, which is used by one or more global forwarding rule to route incoming SSL requests to a backend service.

To get more information about TargetSslProxy, see:

Example Usage - Target Ssl Proxy Basic

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";

const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
    checkIntervalSec: 1,
    tcpHealthCheck: {
        port: 443,
    },
    timeoutSec: 1,
});
const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
    certificate: fs.readFileSync("path/to/certificate.crt", "utf-8"),
    privateKey: fs.readFileSync("path/to/private.key", "utf-8"),
});
const defaultBackendService = new gcp.compute.BackendService("default", {
    healthChecks: defaultHealthCheck.selfLink,
    protocol: "SSL",
});
const defaultTargetSSLProxy = new gcp.compute.TargetSSLProxy("default", {
    backendService: defaultBackendService.selfLink,
    sslCertificates: defaultSSLCertificate.selfLink,
});

constructor

new TargetSSLProxy(name: string, args: TargetSSLProxyArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetSSLProxy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetSSLProxyState, opts?: pulumi.CustomResourceOptions): TargetSSLProxy

Get an existing TargetSSLProxy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backendService

public backendService: pulumi.Output<string>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property proxyHeader

public proxyHeader: pulumi.Output<string | undefined>;

property proxyId

public proxyId: pulumi.Output<number>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sslCertificates

public sslCertificates: pulumi.Output<string>;

property sslPolicy

public sslPolicy: pulumi.Output<string | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TargetTCPProxy

extends CustomResource

Represents a TargetTcpProxy resource, which is used by one or more global forwarding rule to route incoming TCP requests to a Backend service.

To get more information about TargetTcpProxy, see:

Example Usage - Target Tcp Proxy Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
    checkIntervalSec: 1,
    tcpHealthCheck: {
        port: 443,
    },
    timeoutSec: 1,
});
const defaultBackendService = new gcp.compute.BackendService("default", {
    healthChecks: defaultHealthCheck.selfLink,
    protocol: "TCP",
    timeoutSec: 10,
});
const defaultTargetTCPProxy = new gcp.compute.TargetTCPProxy("default", {
    backendService: defaultBackendService.selfLink,
});

constructor

new TargetTCPProxy(name: string, args: TargetTCPProxyArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetTCPProxy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetTCPProxyState, opts?: pulumi.CustomResourceOptions): TargetTCPProxy

Get an existing TargetTCPProxy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backendService

public backendService: pulumi.Output<string>;

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property proxyHeader

public proxyHeader: pulumi.Output<string | undefined>;

property proxyId

public proxyId: pulumi.Output<number>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class URLMap

extends CustomResource

Manages a URL Map resource within GCE. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    checkIntervalSec: 1,
    requestPath: "/",
    timeoutSec: 1,
});
const staticBucket = new gcp.storage.Bucket("static", {
    location: "US",
});
const staticBackendBucket = new gcp.compute.BackendBucket("static", {
    bucketName: staticBucket.name,
    enableCdn: true,
});
const home = new gcp.compute.BackendService("home", {
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});
const login = new gcp.compute.BackendService("login", {
    healthChecks: defaultHttpHealthCheck.selfLink,
    portName: "http",
    protocol: "HTTP",
    timeoutSec: 10,
});
const foobar = new gcp.compute.URLMap("foobar", {
    defaultService: home.selfLink,
    description: "a description",
    hostRules: [{
        hosts: ["mysite.com"],
        pathMatcher: "allpaths",
    }],
    pathMatchers: [{
        defaultService: home.selfLink,
        name: "allpaths",
        pathRules: [
            {
                paths: ["/home"],
                service: home.selfLink,
            },
            {
                paths: ["/login"],
                service: login.selfLink,
            },
            {
                paths: ["/static"],
                service: staticBackendBucket.selfLink,
            },
        ],
    }],
    tests: [{
        host: "hi.com",
        path: "/home",
        service: home.selfLink,
    }],
});

constructor

new URLMap(name: string, args: URLMapArgs, opts?: pulumi.CustomResourceOptions)

Create a URLMap resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: URLMapState, opts?: pulumi.CustomResourceOptions): URLMap

Get an existing URLMap resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property defaultService

public defaultService: pulumi.Output<string>;

The backend service or backend bucket to use when none of the given rules match.

property description

public description: pulumi.Output<string | undefined>;

A brief description of this resource.

property fingerprint

public fingerprint: pulumi.Output<string>;

The unique fingerprint for this resource.

property hostRules

public hostRules: pulumi.Output<{
    description: string;
    hosts: string[];
    pathMatcher: string;
}[] | undefined>;

A list of host rules. Multiple blocks of this type are permitted. Structure is documented below.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property mapId

public mapId: pulumi.Output<string>;

The GCE assigned ID of the resource.

property name

public name: pulumi.Output<string>;

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

property pathMatchers

public pathMatchers: pulumi.Output<{
    defaultService: string;
    description: string;
    name: string;
    pathRules: {
        paths: string[];
        service: string;
    }[];
}[] | undefined>;

A list of paths to match. Structure is documented below.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property tests

public tests: pulumi.Output<{
    description: string;
    host: string;
    path: string;
    service: string;
}[] | undefined>;

The test to perform. Multiple blocks of this type are permitted. Structure is documented below.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class VPNGateway

extends CustomResource

Represents a VPN gateway running in GCP. This virtual device is managed by Google, but used only by you.

To get more information about VpnGateway, see:

Example Usage - Target Vpn Gateway Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const vpnStaticIp = new gcp.compute.Address("vpn_static_ip", {});
const network1 = new gcp.compute.Network("network1", {});
const targetGateway = new gcp.compute.VPNGateway("target_gateway", {
    network: network1.selfLink,
});
const frEsp = new gcp.compute.ForwardingRule("fr_esp", {
    ipAddress: vpnStaticIp.address,
    ipProtocol: "ESP",
    target: targetGateway.selfLink,
});
const frUdp4500 = new gcp.compute.ForwardingRule("fr_udp4500", {
    ipAddress: vpnStaticIp.address,
    ipProtocol: "UDP",
    portRange: "4500",
    target: targetGateway.selfLink,
});
const frUdp500 = new gcp.compute.ForwardingRule("fr_udp500", {
    ipAddress: vpnStaticIp.address,
    ipProtocol: "UDP",
    portRange: "500",
    target: targetGateway.selfLink,
});
const tunnel1 = new gcp.compute.VPNTunnel("tunnel1", {
    peerIp: "15.0.0.120",
    sharedSecret: "a secret message",
    targetVpnGateway: targetGateway.selfLink,
}, {dependsOn: [frEsp, frUdp4500, frUdp500]});
const route1 = new gcp.compute.Route("route1", {
    destRange: "15.0.0.0/24",
    network: network1.name,
    nextHopVpnTunnel: tunnel1.selfLink,
    priority: 1000,
});

constructor

new VPNGateway(name: string, args: VPNGatewayArgs, opts?: pulumi.CustomResourceOptions)

Create a VPNGateway resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VPNGatewayState, opts?: pulumi.CustomResourceOptions): VPNGateway

Get an existing VPNGateway resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

property network

public network: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class VPNTunnel

extends CustomResource

VPN tunnel resource.

To get more information about VpnTunnel, see:

Warning: All arguments including the shared secret will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage - Vpn Tunnel Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const vpnStaticIp = new gcp.compute.Address("vpn_static_ip", {});
const network1 = new gcp.compute.Network("network1", {});
const targetGateway = new gcp.compute.VPNGateway("target_gateway", {
    network: network1.selfLink,
});
const frEsp = new gcp.compute.ForwardingRule("fr_esp", {
    ipAddress: vpnStaticIp.address,
    ipProtocol: "ESP",
    target: targetGateway.selfLink,
});
const frUdp4500 = new gcp.compute.ForwardingRule("fr_udp4500", {
    ipAddress: vpnStaticIp.address,
    ipProtocol: "UDP",
    portRange: "4500",
    target: targetGateway.selfLink,
});
const frUdp500 = new gcp.compute.ForwardingRule("fr_udp500", {
    ipAddress: vpnStaticIp.address,
    ipProtocol: "UDP",
    portRange: "500",
    target: targetGateway.selfLink,
});
const tunnel1 = new gcp.compute.VPNTunnel("tunnel1", {
    peerIp: "15.0.0.120",
    sharedSecret: "a secret message",
    targetVpnGateway: targetGateway.selfLink,
}, {dependsOn: [frEsp, frUdp4500, frUdp500]});
const route1 = new gcp.compute.Route("route1", {
    destRange: "15.0.0.0/24",
    network: network1.name,
    nextHopVpnTunnel: tunnel1.selfLink,
    priority: 1000,
});

constructor

new VPNTunnel(name: string, args: VPNTunnelArgs, opts?: pulumi.CustomResourceOptions)

Create a VPNTunnel resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VPNTunnelState, opts?: pulumi.CustomResourceOptions): VPNTunnel

Get an existing VPNTunnel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationTimestamp

public creationTimestamp: pulumi.Output<string>;

property description

public description: pulumi.Output<string | undefined>;

property detailedStatus

public detailedStatus: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ikeVersion

public ikeVersion: pulumi.Output<number | undefined>;

property labelFingerprint

public labelFingerprint: pulumi.Output<string>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property localTrafficSelectors

public localTrafficSelectors: pulumi.Output<string[]>;

property name

public name: pulumi.Output<string>;

property peerIp

public peerIp: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string>;

property remoteTrafficSelectors

public remoteTrafficSelectors: pulumi.Output<string[]>;

property router

public router: pulumi.Output<string | undefined>;
public selfLink: pulumi.Output<string>;

The URI of the created resource.

property sharedSecret

public sharedSecret: pulumi.Output<string>;

property sharedSecretHash

public sharedSecretHash: pulumi.Output<string>;

property targetVpnGateway

public targetVpnGateway: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getAddress

getAddress(args: GetAddressArgs, opts?: pulumi.InvokeOptions): Promise<GetAddressResult>

Get the IP address from a static address. For more information see the official API documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myAddress = pulumi.output(gcp.compute.getAddress({
    name: "foobar",
}));
const prod = new gcp.dns.ManagedZone("prod", {
    dnsName: "prod.mydomain.com.",
});
const frontend = new gcp.dns.RecordSet("frontend", {
    managedZone: prod.name,
    rrdatas: [myAddress.apply(myAddress => myAddress.address)],
    ttl: 300,
    type: "A",
});

function getBackendService

getBackendService(args: GetBackendServiceArgs, opts?: pulumi.InvokeOptions): Promise<GetBackendServiceResult>

Provide acces to a Backend Service’s attribute. For more information see the official documentation and the API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const baz = pulumi.output(gcp.compute.getBackendService({
    name: "foobar",
}));

function getDefaultServiceAccount