This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.

compute

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.

class pulumi_gcp.compute.Address(resource_name, opts=None, address=None, address_type=None, description=None, labels=None, name=None, network_tier=None, project=None, purpose=None, region=None, subnetwork=None, __props__=None, __name__=None, __opts__=None)

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:

import pulumi
import pulumi_gcp as gcp

ip_address = gcp.compute.Address("ipAddress")
import pulumi
import pulumi_gcp as gcp

default_network = gcp.compute.Network("defaultNetwork")
default_subnetwork = gcp.compute.Subnetwork("defaultSubnetwork",
    ip_cidr_range="10.0.0.0/16",
    region="us-central1",
    network=default_network.id)
internal_with_subnet_and_address = gcp.compute.Address("internalWithSubnetAndAddress",
    subnetwork=default_subnetwork.id,
    address_type="INTERNAL",
    address="10.0.42.42",
    region="us-central1")
import pulumi
import pulumi_gcp as gcp

internal_with_gce_endpoint = gcp.compute.Address("internalWithGceEndpoint",
    address_type="INTERNAL",
    purpose="GCE_ENDPOINT")
import pulumi
import pulumi_gcp as gcp

static = gcp.compute.Address("static")
debian_image = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
instance_with_ip = gcp.compute.Instance("instanceWithIp",
    machine_type="f1-micro",
    zone="us-central1-a",
    boot_disk={
        "initialize_params": {
            "image": debian_image.self_link,
        },
    },
    network_interface=[{
        "network": "default",
        "access_config": [{
            "natIp": static.address,
        }],
    }])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • address (pulumi.Input[str]) – The static external IP address represented by this resource. Only IPv4 is supported. An address may only be specified for INTERNAL address types. The IP address must be inside the specified subnetwork, if any.

  • address_type (pulumi.Input[str]) – The type of address to reserve.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • labels (pulumi.Input[dict]) – Labels to apply to this address. A list of key->value pairs.

  • name (pulumi.Input[str]) – Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network_tier (pulumi.Input[str]) – The networking tier used for configuring this address. If this field is not specified, it is assumed to be PREMIUM.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • purpose (pulumi.Input[str]) – The purpose of this resource, which can be one of the following values:

- GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources.
This should only be set when using an Internal address.
Parameters
  • region (pulumi.Input[str]) – The Region in which the created address should reside. If it is not provided, the provider region is used.

  • subnetwork (pulumi.Input[str]) – The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork’s IP range. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes.

address: pulumi.Output[str] = None

The static external IP address represented by this resource. Only IPv4 is supported. An address may only be specified for INTERNAL address types. The IP address must be inside the specified subnetwork, if any.

address_type: pulumi.Output[str] = None

The type of address to reserve.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource.

label_fingerprint: pulumi.Output[str] = None

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels: pulumi.Output[dict] = None

Labels to apply to this address. A list of key->value pairs.

name: pulumi.Output[str] = None

Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

network_tier: pulumi.Output[str] = None

The networking tier used for configuring this address. If this field is not specified, it is assumed to be PREMIUM.

project: pulumi.Output[str] = None

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

purpose: pulumi.Output[str] = None

The purpose of this resource, which can be one of the following values:

  • GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources. This should only be set when using an Internal address.

region: pulumi.Output[str] = None

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

The URI of the created resource.

subnetwork: pulumi.Output[str] = None

The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork’s IP range. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes.

users: pulumi.Output[list] = None

The URLs of the resources that are using this address.

static get(resource_name, id, opts=None, address=None, address_type=None, creation_timestamp=None, description=None, label_fingerprint=None, labels=None, name=None, network_tier=None, project=None, purpose=None, region=None, self_link=None, subnetwork=None, users=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • address (pulumi.Input[str]) – The static external IP address represented by this resource. Only IPv4 is supported. An address may only be specified for INTERNAL address types. The IP address must be inside the specified subnetwork, if any.

  • address_type (pulumi.Input[str]) – The type of address to reserve.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • label_fingerprint (pulumi.Input[str]) – The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • labels (pulumi.Input[dict]) – Labels to apply to this address. A list of key->value pairs.

  • name (pulumi.Input[str]) – Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network_tier (pulumi.Input[str]) – The networking tier used for configuring this address. If this field is not specified, it is assumed to be PREMIUM.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • purpose (pulumi.Input[str]) – The purpose of this resource, which can be one of the following values:

- GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources.
This should only be set when using an Internal address.
Parameters
  • region (pulumi.Input[str]) – The Region in which the created address should reside. If it is not provided, the provider region is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • subnetwork (pulumi.Input[str]) – The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork’s IP range. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes.

  • users (pulumi.Input[list]) – The URLs of the resources that are using this address.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.AttachedDisk(resource_name, opts=None, device_name=None, disk=None, instance=None, mode=None, project=None, zone=None, __props__=None, __name__=None, __opts__=None)

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:

Note: When using compute.AttachedDisk you must use lifecycle.ignore_changes = ["attached_disk"] on the compute.Instance resource that has the disks attached. Otherwise the two resources will fight for control of the attached disk block.

import pulumi
import pulumi_gcp as gcp

default_instance = gcp.compute.Instance("defaultInstance",
    machine_type="n1-standard-1",
    zone="us-west1-a",
    boot_disk={
        "initialize_params": {
            "image": "debian-cloud/debian-9",
        },
    },
    network_interface=[{
        "network": "default",
    }])
default_attached_disk = gcp.compute.AttachedDisk("defaultAttachedDisk",
    disk=google_compute_disk["default"]["id"],
    instance=default_instance.id)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • device_name (pulumi.Input[str]) – Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.

  • disk (pulumi.Input[str]) – name or self_link of the disk that will be attached.

  • instance (pulumi.Input[str]) – name or self_link of the compute instance that the disk will be attached to. If the self_link is provided then zone and project are extracted from the self link. If only the name is used then zone and project must be defined as properties on the resource or provider.

  • mode (pulumi.Input[str]) – The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

  • project (pulumi.Input[str]) – The project that the referenced compute instance is a part of. If instance is referenced by its self_link the project defined in the link will take precedence.

  • zone (pulumi.Input[str]) – The zone that the referenced compute instance is located within. If instance is referenced by its self_link the zone defined in the link will take precedence.

device_name: pulumi.Output[str] = None

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.

disk: pulumi.Output[str] = None

name or self_link of the disk that will be attached.

instance: pulumi.Output[str] = None

name or self_link of the compute instance that the disk will be attached to. If the self_link is provided then zone and project are extracted from the self link. If only the name is used then zone and project must be defined as properties on the resource or provider.

mode: pulumi.Output[str] = None

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

project: pulumi.Output[str] = None

The project that the referenced compute instance is a part of. If instance is referenced by its self_link the project defined in the link will take precedence.

zone: pulumi.Output[str] = None

The zone that the referenced compute instance is located within. If instance is referenced by its self_link the zone defined in the link will take precedence.

static get(resource_name, id, opts=None, device_name=None, disk=None, instance=None, mode=None, project=None, zone=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • device_name (pulumi.Input[str]) – Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.

  • disk (pulumi.Input[str]) – name or self_link of the disk that will be attached.

  • instance (pulumi.Input[str]) – name or self_link of the compute instance that the disk will be attached to. If the self_link is provided then zone and project are extracted from the self link. If only the name is used then zone and project must be defined as properties on the resource or provider.

  • mode (pulumi.Input[str]) – The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

  • project (pulumi.Input[str]) – The project that the referenced compute instance is a part of. If instance is referenced by its self_link the project defined in the link will take precedence.

  • zone (pulumi.Input[str]) – The zone that the referenced compute instance is located within. If instance is referenced by its self_link the zone defined in the link will take precedence.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.Autoscalar(resource_name, opts=None, autoscaling_policy=None, description=None, name=None, project=None, target=None, zone=None, __props__=None, __name__=None, __opts__=None)

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:

import pulumi
import pulumi_gcp as gcp

debian9 = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
default_instance_template = gcp.compute.InstanceTemplate("defaultInstanceTemplate",
    machine_type="n1-standard-1",
    can_ip_forward=False,
    tags=[
        "foo",
        "bar",
    ],
    disk=[{
        "sourceImage": debian9.self_link,
    }],
    network_interface=[{
        "network": "default",
    }],
    metadata={
        "foo": "bar",
    },
    service_account={
        "scopes": [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    })
default_target_pool = gcp.compute.TargetPool("defaultTargetPool")
default_instance_group_manager = gcp.compute.InstanceGroupManager("defaultInstanceGroupManager",
    zone="us-central1-f",
    version=[{
        "instanceTemplate": default_instance_template.id,
        "name": "primary",
    }],
    target_pools=[default_target_pool.id],
    base_instance_name="autoscaler-sample")
default_autoscaler = gcp.compute.Autoscaler("defaultAutoscaler",
    zone="us-central1-f",
    target=default_instance_group_manager.id,
    autoscaling_policy={
        "maxReplicas": 5,
        "minReplicas": 1,
        "cooldownPeriod": 60,
        "metric": [{
            "name": "pubsub.googleapis.com/subscription/num_undelivered_messages",
            "filter": "resource.type = pubsub_subscription AND resource.label.subscription_id = our-subscription",
            "singleInstanceAssignment": 65535,
        }],
    })
import pulumi
import pulumi_gcp as gcp

debian9 = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
foobar_instance_template = gcp.compute.InstanceTemplate("foobarInstanceTemplate",
    machine_type="n1-standard-1",
    can_ip_forward=False,
    tags=[
        "foo",
        "bar",
    ],
    disk=[{
        "sourceImage": debian9.self_link,
    }],
    network_interface=[{
        "network": "default",
    }],
    metadata={
        "foo": "bar",
    },
    service_account={
        "scopes": [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    })
foobar_target_pool = gcp.compute.TargetPool("foobarTargetPool")
foobar_instance_group_manager = gcp.compute.InstanceGroupManager("foobarInstanceGroupManager",
    zone="us-central1-f",
    version=[{
        "instanceTemplate": foobar_instance_template.id,
        "name": "primary",
    }],
    target_pools=[foobar_target_pool.id],
    base_instance_name="foobar")
foobar_autoscaler = gcp.compute.Autoscaler("foobarAutoscaler",
    zone="us-central1-f",
    target=foobar_instance_group_manager.id,
    autoscaling_policy={
        "maxReplicas": 5,
        "minReplicas": 1,
        "cooldownPeriod": 60,
        "cpu_utilization": {
            "target": 0.5,
        },
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • autoscaling_policy (pulumi.Input[dict]) – The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. Structure is documented below.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • name (pulumi.Input[str]) – The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • target (pulumi.Input[str]) – Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • zone (pulumi.Input[str]) – URL of the zone where the instance group resides.

The autoscaling_policy object supports the following:

  • cooldownPeriod (pulumi.Input[float]) - The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.

  • cpuUtilization (pulumi.Input[dict]) - Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • loadBalancingUtilization (pulumi.Input[dict]) - Configuration parameters of autoscaling based on a load balancer. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • maxReplicas (pulumi.Input[float]) - The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.

  • metrics (pulumi.Input[list]) - Configuration parameters of autoscaling based on a custom metric. Structure is documented below.

    • filter (pulumi.Input[str]) - A filter string to be used as the filter string for a Stackdriver Monitoring TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. You can only use the AND operator for joining selectors. You can only use direct equality comparison operator (=) without any functions for each selector. You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. If not specified, the type defaults to gce_instance. You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.

    • name (pulumi.Input[str]) - The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

    • singleInstanceAssignment (pulumi.Input[float]) - If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. The autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing. For example, a good metric to use with the target is pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can’t include a chunk assignable to a single instance, it could be better used with utilization_target instead.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

    • type (pulumi.Input[str]) - Defines how target utilization value is expressed for a Stackdriver Monitoring metric.

  • minReplicas (pulumi.Input[float]) - The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.

autoscaling_policy: pulumi.Output[dict] = None

The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. Structure is documented below.

  • cooldownPeriod (float) - The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.

  • cpuUtilization (dict) - Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. Structure is documented below.

    • target (float) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • loadBalancingUtilization (dict) - Configuration parameters of autoscaling based on a load balancer. Structure is documented below.

    • target (float) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • maxReplicas (float) - The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.

  • metrics (list) - Configuration parameters of autoscaling based on a custom metric. Structure is documented below.

    • filter (str) - A filter string to be used as the filter string for a Stackdriver Monitoring TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. You can only use the AND operator for joining selectors. You can only use direct equality comparison operator (=) without any functions for each selector. You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. If not specified, the type defaults to gce_instance. You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.

    • name (str) - The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

    • singleInstanceAssignment (float) - If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. The autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing. For example, a good metric to use with the target is pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can’t include a chunk assignable to a single instance, it could be better used with utilization_target instead.

    • target (float) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

    • type (str) - Defines how target utilization value is expressed for a Stackdriver Monitoring metric.

  • minReplicas (float) - The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource.

name: pulumi.Output[str] = None

The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

project: pulumi.Output[str] = None

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

The URI of the created resource.

target: pulumi.Output[str] = None

Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

zone: pulumi.Output[str] = None

URL of the zone where the instance group resides.

static get(resource_name, id, opts=None, autoscaling_policy=None, creation_timestamp=None, description=None, name=None, project=None, self_link=None, target=None, zone=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • autoscaling_policy (pulumi.Input[dict]) – The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. Structure is documented below.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • name (pulumi.Input[str]) – The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • target (pulumi.Input[str]) – Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • zone (pulumi.Input[str]) – URL of the zone where the instance group resides.

The autoscaling_policy object supports the following:

  • cooldownPeriod (pulumi.Input[float]) - The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.

  • cpuUtilization (pulumi.Input[dict]) - Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • loadBalancingUtilization (pulumi.Input[dict]) - Configuration parameters of autoscaling based on a load balancer. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • maxReplicas (pulumi.Input[float]) - The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.

  • metrics (pulumi.Input[list]) - Configuration parameters of autoscaling based on a custom metric. Structure is documented below.

    • filter (pulumi.Input[str]) - A filter string to be used as the filter string for a Stackdriver Monitoring TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. You can only use the AND operator for joining selectors. You can only use direct equality comparison operator (=) without any functions for each selector. You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. If not specified, the type defaults to gce_instance. You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.

    • name (pulumi.Input[str]) - The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

    • singleInstanceAssignment (pulumi.Input[float]) - If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. The autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing. For example, a good metric to use with the target is pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can’t include a chunk assignable to a single instance, it could be better used with utilization_target instead.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

    • type (pulumi.Input[str]) - Defines how target utilization value is expressed for a Stackdriver Monitoring metric.

  • minReplicas (pulumi.Input[float]) - The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.Autoscaler(resource_name, opts=None, autoscaling_policy=None, description=None, name=None, project=None, target=None, zone=None, __props__=None, __name__=None, __opts__=None)

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:

import pulumi
import pulumi_gcp as gcp

debian9 = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
default_instance_template = gcp.compute.InstanceTemplate("defaultInstanceTemplate",
    machine_type="n1-standard-1",
    can_ip_forward=False,
    tags=[
        "foo",
        "bar",
    ],
    disk=[{
        "sourceImage": debian9.self_link,
    }],
    network_interface=[{
        "network": "default",
    }],
    metadata={
        "foo": "bar",
    },
    service_account={
        "scopes": [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    })
default_target_pool = gcp.compute.TargetPool("defaultTargetPool")
default_instance_group_manager = gcp.compute.InstanceGroupManager("defaultInstanceGroupManager",
    zone="us-central1-f",
    version=[{
        "instanceTemplate": default_instance_template.id,
        "name": "primary",
    }],
    target_pools=[default_target_pool.id],
    base_instance_name="autoscaler-sample")
default_autoscaler = gcp.compute.Autoscaler("defaultAutoscaler",
    zone="us-central1-f",
    target=default_instance_group_manager.id,
    autoscaling_policy={
        "maxReplicas": 5,
        "minReplicas": 1,
        "cooldownPeriod": 60,
        "metric": [{
            "name": "pubsub.googleapis.com/subscription/num_undelivered_messages",
            "filter": "resource.type = pubsub_subscription AND resource.label.subscription_id = our-subscription",
            "singleInstanceAssignment": 65535,
        }],
    })
import pulumi
import pulumi_gcp as gcp

debian9 = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
foobar_instance_template = gcp.compute.InstanceTemplate("foobarInstanceTemplate",
    machine_type="n1-standard-1",
    can_ip_forward=False,
    tags=[
        "foo",
        "bar",
    ],
    disk=[{
        "sourceImage": debian9.self_link,
    }],
    network_interface=[{
        "network": "default",
    }],
    metadata={
        "foo": "bar",
    },
    service_account={
        "scopes": [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    })
foobar_target_pool = gcp.compute.TargetPool("foobarTargetPool")
foobar_instance_group_manager = gcp.compute.InstanceGroupManager("foobarInstanceGroupManager",
    zone="us-central1-f",
    version=[{
        "instanceTemplate": foobar_instance_template.id,
        "name": "primary",
    }],
    target_pools=[foobar_target_pool.id],
    base_instance_name="foobar")
foobar_autoscaler = gcp.compute.Autoscaler("foobarAutoscaler",
    zone="us-central1-f",
    target=foobar_instance_group_manager.id,
    autoscaling_policy={
        "maxReplicas": 5,
        "minReplicas": 1,
        "cooldownPeriod": 60,
        "cpu_utilization": {
            "target": 0.5,
        },
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • autoscaling_policy (pulumi.Input[dict]) – The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. Structure is documented below.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • name (pulumi.Input[str]) – The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • target (pulumi.Input[str]) – Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • zone (pulumi.Input[str]) – URL of the zone where the instance group resides.

The autoscaling_policy object supports the following:

  • cooldownPeriod (pulumi.Input[float]) - The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.

  • cpuUtilization (pulumi.Input[dict]) - Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • loadBalancingUtilization (pulumi.Input[dict]) - Configuration parameters of autoscaling based on a load balancer. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • maxReplicas (pulumi.Input[float]) - The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.

  • metrics (pulumi.Input[list]) - Configuration parameters of autoscaling based on a custom metric. Structure is documented below.

    • filter (pulumi.Input[str]) - A filter string to be used as the filter string for a Stackdriver Monitoring TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. You can only use the AND operator for joining selectors. You can only use direct equality comparison operator (=) without any functions for each selector. You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. If not specified, the type defaults to gce_instance. You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.

    • name (pulumi.Input[str]) - The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

    • singleInstanceAssignment (pulumi.Input[float]) - If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. The autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing. For example, a good metric to use with the target is pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can’t include a chunk assignable to a single instance, it could be better used with utilization_target instead.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

    • type (pulumi.Input[str]) - Defines how target utilization value is expressed for a Stackdriver Monitoring metric.

  • minReplicas (pulumi.Input[float]) - The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.

autoscaling_policy: pulumi.Output[dict] = None

The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. Structure is documented below.

  • cooldownPeriod (float) - The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.

  • cpuUtilization (dict) - Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. Structure is documented below.

    • target (float) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • loadBalancingUtilization (dict) - Configuration parameters of autoscaling based on a load balancer. Structure is documented below.

    • target (float) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • maxReplicas (float) - The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.

  • metrics (list) - Configuration parameters of autoscaling based on a custom metric. Structure is documented below.

    • filter (str) - A filter string to be used as the filter string for a Stackdriver Monitoring TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. You can only use the AND operator for joining selectors. You can only use direct equality comparison operator (=) without any functions for each selector. You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. If not specified, the type defaults to gce_instance. You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.

    • name (str) - The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

    • singleInstanceAssignment (float) - If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. The autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing. For example, a good metric to use with the target is pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can’t include a chunk assignable to a single instance, it could be better used with utilization_target instead.

    • target (float) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

    • type (str) - Defines how target utilization value is expressed for a Stackdriver Monitoring metric.

  • minReplicas (float) - The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource.

name: pulumi.Output[str] = None

The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

project: pulumi.Output[str] = None

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

The URI of the created resource.

target: pulumi.Output[str] = None

Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

zone: pulumi.Output[str] = None

URL of the zone where the instance group resides.

static get(resource_name, id, opts=None, autoscaling_policy=None, creation_timestamp=None, description=None, name=None, project=None, self_link=None, target=None, zone=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • autoscaling_policy (pulumi.Input[dict]) – The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. Structure is documented below.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • name (pulumi.Input[str]) – The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • target (pulumi.Input[str]) – Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • zone (pulumi.Input[str]) – URL of the zone where the instance group resides.

The autoscaling_policy object supports the following:

  • cooldownPeriod (pulumi.Input[float]) - The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.

  • cpuUtilization (pulumi.Input[dict]) - Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • loadBalancingUtilization (pulumi.Input[dict]) - Configuration parameters of autoscaling based on a load balancer. Structure is documented below.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

  • maxReplicas (pulumi.Input[float]) - The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.

  • metrics (pulumi.Input[list]) - Configuration parameters of autoscaling based on a custom metric. Structure is documented below.

    • filter (pulumi.Input[str]) - A filter string to be used as the filter string for a Stackdriver Monitoring TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. You can only use the AND operator for joining selectors. You can only use direct equality comparison operator (=) without any functions for each selector. You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. If not specified, the type defaults to gce_instance. You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.

    • name (pulumi.Input[str]) - The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.

    • singleInstanceAssignment (pulumi.Input[float]) - If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. The autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing. For example, a good metric to use with the target is pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can’t include a chunk assignable to a single instance, it could be better used with utilization_target instead.

    • target (pulumi.Input[float]) - Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.

    • type (pulumi.Input[str]) - Defines how target utilization value is expressed for a Stackdriver Monitoring metric.

  • minReplicas (pulumi.Input[float]) - The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.AwaitableGetAddressResult(address=None, id=None, name=None, project=None, region=None, self_link=None, status=None)
class pulumi_gcp.compute.AwaitableGetBackendBucketResult(bucket_name=None, cdn_policies=None, creation_timestamp=None, description=None, enable_cdn=None, id=None, name=None, project=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetBackendServiceResult(affinity_cookie_ttl_sec=None, backends=None, cdn_policies=None, circuit_breakers=None, connection_draining_timeout_sec=None, consistent_hash=None, creation_timestamp=None, custom_request_headers=None, description=None, enable_cdn=None, fingerprint=None, health_checks=None, iaps=None, id=None, load_balancing_scheme=None, locality_lb_policy=None, log_configs=None, name=None, outlier_detections=None, port_name=None, project=None, protocol=None, security_policy=None, self_link=None, session_affinity=None, timeout_sec=None)
class pulumi_gcp.compute.AwaitableGetCertificateResult(certificate=None, certificate_id=None, creation_timestamp=None, description=None, id=None, name=None, name_prefix=None, private_key=None, project=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetDefaultServiceAccountResult(display_name=None, email=None, id=None, name=None, project=None, unique_id=None)
class pulumi_gcp.compute.AwaitableGetForwardingRuleResult(backend_service=None, description=None, id=None, ip_address=None, ip_protocol=None, load_balancing_scheme=None, name=None, network=None, port_range=None, ports=None, project=None, region=None, self_link=None, subnetwork=None, target=None)
class pulumi_gcp.compute.AwaitableGetGlobalAddressResult(address=None, id=None, name=None, project=None, self_link=None, status=None)
class pulumi_gcp.compute.AwaitableGetImageResult(archive_size_bytes=None, creation_timestamp=None, description=None, disk_size_gb=None, family=None, id=None, image_encryption_key_sha256=None, image_id=None, label_fingerprint=None, labels=None, licenses=None, name=None, project=None, self_link=None, source_disk=None, source_disk_encryption_key_sha256=None, source_disk_id=None, source_image_id=None, status=None)
class pulumi_gcp.compute.AwaitableGetInstanceGroupResult(description=None, id=None, instances=None, name=None, named_ports=None, network=None, project=None, self_link=None, size=None, zone=None)
class pulumi_gcp.compute.AwaitableGetInstanceResult(allow_stopping_for_update=None, attached_disks=None, boot_disks=None, can_ip_forward=None, cpu_platform=None, current_status=None, deletion_protection=None, description=None, desired_status=None, enable_display=None, guest_accelerators=None, hostname=None, id=None, instance_id=None, label_fingerprint=None, labels=None, machine_type=None, metadata=None, metadata_fingerprint=None, metadata_startup_script=None, min_cpu_platform=None, name=None, network_interfaces=None, project=None, resource_policies=None, schedulings=None, scratch_disks=None, self_link=None, service_accounts=None, shielded_instance_configs=None, tags=None, tags_fingerprint=None, zone=None)
class pulumi_gcp.compute.AwaitableGetInstanceSerialPortResult(contents=None, id=None, instance=None, port=None, project=None, zone=None)
class pulumi_gcp.compute.AwaitableGetLBIPRangesResult(http_ssl_tcp_internals=None, id=None, networks=None)
class pulumi_gcp.compute.AwaitableGetNetblockIPRangesResult(cidr_blocks=None, cidr_blocks_ipv4s=None, cidr_blocks_ipv6s=None, id=None, range_type=None)
class pulumi_gcp.compute.AwaitableGetNetworkEndpointGroupResult(default_port=None, description=None, id=None, name=None, network=None, network_endpoint_type=None, project=None, self_link=None, size=None, subnetwork=None, zone=None)
class pulumi_gcp.compute.AwaitableGetNetworkResult(description=None, gateway_ipv4=None, id=None, name=None, project=None, self_link=None, subnetworks_self_links=None)
class pulumi_gcp.compute.AwaitableGetNodeTypesResult(id=None, names=None, project=None, zone=None)
class pulumi_gcp.compute.AwaitableGetRegionInstanceGroupResult(id=None, instances=None, name=None, project=None, region=None, self_link=None, size=None)
class pulumi_gcp.compute.AwaitableGetRegionsResult(id=None, names=None, project=None, status=None)
class pulumi_gcp.compute.AwaitableGetResourcePolicyResult(description=None, id=None, name=None, project=None, region=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetRouterResult(bgps=None, creation_timestamp=None, description=None, id=None, name=None, network=None, project=None, region=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetSSLPolicyResult(creation_timestamp=None, custom_features=None, description=None, enabled_features=None, fingerprint=None, id=None, min_tls_version=None, name=None, profile=None, project=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetSubnetworkResult(description=None, gateway_address=None, id=None, ip_cidr_range=None, name=None, network=None, private_ip_google_access=None, project=None, region=None, secondary_ip_ranges=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetVPNGatewayResult(description=None, id=None, name=None, network=None, project=None, region=None, self_link=None)
class pulumi_gcp.compute.AwaitableGetZonesResult(id=None, names=None, project=None, region=None, status=None)
class pulumi_gcp.compute.BackendBucket(resource_name, opts=None, bucket_name=None, cdn_policy=None, description=None, enable_cdn=None, name=None, project=None, __props__=None, __name__=None, __opts__=None)

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 to a virtual machine instance.

To get more information about BackendBucket, see:

import pulumi
import pulumi_gcp as gcp

image_bucket = gcp.storage.Bucket("imageBucket", location="EU")
image_backend = gcp.compute.BackendBucket("imageBackend",
    description="Contains beautiful images",
    bucket_name=image_bucket.name,
    enable_cdn=True)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • bucket_name (pulumi.Input[str]) – Cloud Storage bucket name.

  • cdn_policy (pulumi.Input[dict]) – Cloud CDN configuration for this Backend Bucket. Structure is documented below.

  • description (pulumi.Input[str]) – An optional textual description of the resource; provided by the client when the resource is created.

  • enable_cdn (pulumi.Input[bool]) – If true, enable Cloud CDN for this BackendBucket.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The cdn_policy object supports the following:

  • signedUrlCacheMaxAgeSec (pulumi.Input[float]) - Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a “Cache-Control: public, max-age=[TTL]” header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered.

bucket_name: pulumi.Output[str] = None

Cloud Storage bucket name.

cdn_policy: pulumi.Output[dict] = None

Cloud CDN configuration for this Backend Bucket. Structure is documented below.

  • signedUrlCacheMaxAgeSec (float) - Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a “Cache-Control: public, max-age=[TTL]” header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional textual description of the resource; provided by the client when the resource is created.

enable_cdn: pulumi.Output[bool] = None

If true, enable Cloud CDN for this BackendBucket.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project: pulumi.Output[str] = None

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

The URI of the created resource.

static get(resource_name, id, opts=None, bucket_name=None, cdn_policy=None, creation_timestamp=None, description=None, enable_cdn=None, name=None, project=None, self_link=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • bucket_name (pulumi.Input[str]) – Cloud Storage bucket name.

  • cdn_policy (pulumi.Input[dict]) – Cloud CDN configuration for this Backend Bucket. Structure is documented below.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional textual description of the resource; provided by the client when the resource is created.

  • enable_cdn (pulumi.Input[bool]) – If true, enable Cloud CDN for this BackendBucket.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

The cdn_policy object supports the following:

  • signedUrlCacheMaxAgeSec (pulumi.Input[float]) - Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a “Cache-Control: public, max-age=[TTL]” header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.BackendBucketSignedUrlKey(resource_name, opts=None, backend_bucket=None, key_value=None, name=None, project=None, __props__=None, __name__=None, __opts__=None)

A key for signing Cloud CDN signed URLs for BackendBuckets.

To get more information about BackendBucketSignedUrlKey, see:

Warning: All arguments including key_value will be stored in the raw state as plain-text.

import pulumi
import pulumi_gcp as gcp

bucket = gcp.storage.Bucket("bucket", location="EU")
test_backend = gcp.compute.BackendBucket("testBackend",
    description="Contains beautiful images",
    bucket_name=bucket.name,
    enable_cdn=True)
backend_key = gcp.compute.BackendBucketSignedUrlKey("backendKey",
    key_value="pPsVemX8GM46QVeezid6Rw==",
    backend_bucket=test_backend.name)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_bucket (pulumi.Input[str]) – The backend bucket this signed URL key belongs.

  • key_value (pulumi.Input[str]) – 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.

  • name (pulumi.Input[str]) – Name of the signed URL key.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

backend_bucket: pulumi.Output[str] = None

The backend bucket this signed URL key belongs.

key_value: pulumi.Output[str] = None

128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.

name: pulumi.Output[str] = None

Name of the signed URL key.

project: pulumi.Output[str] = None

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

static get(resource_name, id, opts=None, backend_bucket=None, key_value=None, name=None, project=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_bucket (pulumi.Input[str]) – The backend bucket this signed URL key belongs.

  • key_value (pulumi.Input[str]) – 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.

  • name (pulumi.Input[str]) – Name of the signed URL key.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.BackendService(resource_name, opts=None, affinity_cookie_ttl_sec=None, backends=None, cdn_policy=None, circuit_breakers=None, connection_draining_timeout_sec=None, consistent_hash=None, custom_request_headers=None, description=None, enable_cdn=None, health_checks=None, iap=None, load_balancing_scheme=None, locality_lb_policy=None, log_config=None, name=None, outlier_detection=None, port_name=None, project=None, protocol=None, security_policy=None, session_affinity=None, timeout_sec=None, __props__=None, __name__=None, __opts__=None)

A Backend Service defines a group of virtual machines that will serve traffic for load balancing. This resource is a global backend service, appropriate for external load balancing or self-managed internal load balancing. For managed internal load balancing, use a regional backend service instead.

Currently self-managed internal load balancing is only available in beta.

To get more information about BackendService, see:

import pulumi
import pulumi_gcp as gcp

default_http_health_check = gcp.compute.HttpHealthCheck("defaultHttpHealthCheck",
    request_path="/",
    check_interval_sec=1,
    timeout_sec=1)
default_backend_service = gcp.compute.BackendService("defaultBackendService", health_checks=[default_http_health_check.id])
import pulumi
import pulumi_gcp as gcp

health_check = gcp.compute.HealthCheck("healthCheck", http_health_check={
    "port": 80,
})
default = gcp.compute.BackendService("default",
    health_checks=[health_check.id],
    load_balancing_scheme="INTERNAL_SELF_MANAGED",
    locality_lb_policy="ROUND_ROBIN")
import pulumi
import pulumi_gcp as gcp

health_check = gcp.compute.HealthCheck("healthCheck", http_health_check={
    "port": 80,
})
default = gcp.compute.BackendService("default",
    health_checks=[health_check.id],
    load_balancing_scheme="INTERNAL_SELF_MANAGED",
    locality_lb_policy="RING_HASH",
    session_affinity="HTTP_COOKIE",
    circuit_breakers={
        "maxConnections": 10,
    },
    consistent_hash={
        "http_cookie": {
            "ttl": {
                "seconds": 11,
                "nanos": 1111,
            },
            "name": "mycookie",
        },
    },
    outlier_detection={
        "consecutiveErrors": 2,
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • affinity_cookie_ttl_sec (pulumi.Input[float]) – Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value for TTL is one day. When the load balancing scheme is INTERNAL, this field is not used.

  • backends (pulumi.Input[list]) – The set of backends that serve this BackendService. Structure is documented below.

  • cdn_policy (pulumi.Input[dict]) – Cloud CDN configuration for this BackendService. Structure is documented below.

  • circuit_breakers (pulumi.Input[dict]) – Settings controlling the volume of connections to a backend service. This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • connection_draining_timeout_sec (pulumi.Input[float]) – Time for which instance will be drained (not accept new connections, but still work to finish started).

  • consistent_hash (pulumi.Input[dict]) – Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field only applies if the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is set to MAGLEV or RING_HASH. Structure is documented below.

  • custom_request_headers (pulumi.Input[list]) – Headers that the HTTP/S load balancer should add to proxied requests.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • enable_cdn (pulumi.Input[bool]) – If true, enable Cloud CDN for this BackendService.

  • health_checks (pulumi.Input[str]) – The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. For internal load balancing, a URL to a HealthCheck resource must be specified instead.

  • iap (pulumi.Input[dict]) – Settings for enabling Cloud Identity Aware Proxy Structure is documented below.

  • load_balancing_scheme (pulumi.Input[str]) – Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other.

  • locality_lb_policy (pulumi.Input[str]) – The load balancing algorithm used within the scope of the locality. The possible values are - ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. RANDOM - The load balancer selects a random healthy host. ORIGINAL_DESTINATION - Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. MAGLEV - used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, refer to https://ai.google/research/pubs/pub44824 This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED.

  • log_config (pulumi.Input[dict]) – This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the cookie.

  • outlier_detection (pulumi.Input[dict]) – Settings controlling eviction of unhealthy hosts from the load balancing pool. This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • port_name (pulumi.Input[str]) – Name of backend port. The same name should appear in the instance groups referenced by this service. Required when the load balancing scheme is EXTERNAL.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • protocol (pulumi.Input[str]) – The protocol this BackendService uses to communicate with backends. The default is HTTP. NOTE: HTTP2 is only valid for beta HTTP/2 load balancer types and may result in errors if used with the GA API.

  • security_policy (pulumi.Input[str]) – The security policy associated with this backend service.

  • session_affinity (pulumi.Input[str]) – Type of session affinity to use. The default is NONE. Session affinity is not applicable if the protocol is UDP.

  • timeout_sec (pulumi.Input[float]) – How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. Valid range is [1, 86400].

The backends object supports the following:

  • balancingMode (pulumi.Input[str]) - Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).

  • capacityScaler (pulumi.Input[float]) - A multiplier applied to the group’s maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available Capacity. Valid range is [0.0,1.0].

  • description (pulumi.Input[str]) - An optional description of this resource. Provide this property when you create the resource.

  • group (pulumi.Input[str]) - The fully-qualified URL of an Instance Group or Network Endpoint Group resource. In case of instance group this defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource. For Network Endpoint Groups this defines list of endpoints. All endpoints of Network Endpoint Group must be hosted on instances located in the same zone as the Network Endpoint Group. Backend services cannot mix Instance Group and Network Endpoint Group backends. Note that you must specify an Instance Group or Network Endpoint Group resource using the fully-qualified URL, rather than a partial URL.

  • maxConnections (pulumi.Input[float]) - The maximum number of connections to the backend cluster. Defaults to 1024.

  • maxConnectionsPerEndpoint (pulumi.Input[float]) - The max number of simultaneous connections that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must be set.

  • maxConnectionsPerInstance (pulumi.Input[float]) - The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set.

  • maxRate (pulumi.Input[float]) - The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, either maxRate or one of maxRatePerInstance or maxRatePerEndpoint, as appropriate for group type, must be set.

  • maxRatePerEndpoint (pulumi.Input[float]) - The max requests per second (RPS) that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerEndpoint must be set.

  • maxRatePerInstance (pulumi.Input[float]) - The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.

  • maxUtilization (pulumi.Input[float]) - Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0].

The cdn_policy object supports the following:

  • cacheKeyPolicy (pulumi.Input[dict]) - The CacheKeyPolicy for this CdnPolicy. Structure is documented below.

    • includeHost (pulumi.Input[bool]) - If true requests to different hosts will be cached separately.

    • includeProtocol (pulumi.Input[bool]) - If true, http and https requests will be cached separately.

    • includeQueryString (pulumi.Input[bool]) - If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

    • queryStringBlacklists (pulumi.Input[list]) - Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. ‘&’ and ‘=’ will be percent encoded and not treated as delimiters.

    • queryStringWhitelists (pulumi.Input[list]) - Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. ‘&’ and ‘=’ will be percent encoded and not treated as delimiters.

  • signedUrlCacheMaxAgeSec (pulumi.Input[float]) - Maximum number of seconds the response to a signed URL request will be considered fresh, defaults to 1hr (3600s). After this time period, the response will be revalidated before being served. When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a “Cache-Control: public, max-age=[TTL]” header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered.

The circuit_breakers object supports the following:

  • connectTimeout (pulumi.Input[dict]) - The timeout for new network connections to hosts. Structure is documented below.

    • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • maxConnections (pulumi.Input[float]) - The maximum number of connections to the backend cluster. Defaults to 1024.

  • maxPendingRequests (pulumi.Input[float]) - The maximum number of pending requests to the backend cluster. Defaults to 1024.

  • maxRequests (pulumi.Input[float]) - The maximum number of parallel requests to the backend cluster. Defaults to 1024.

  • maxRequestsPerConnection (pulumi.Input[float]) - Maximum requests for a single backend connection. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.

  • maxRetries (pulumi.Input[float]) - The maximum number of parallel retries to the backend cluster. Defaults to 3.

The consistent_hash object supports the following:

  • httpCookie (pulumi.Input[dict]) - Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Structure is documented below.

    • name (pulumi.Input[str]) - Name of the cookie.

    • path (pulumi.Input[str]) - Path to set for the cookie.

    • ttl (pulumi.Input[dict]) - Lifetime of the cookie. Structure is documented below.

      • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

      • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • httpHeaderName (pulumi.Input[str]) - The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD.

  • minimumRingSize (pulumi.Input[float]) - The minimum number of virtual nodes to use for the hash ring. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. Defaults to 1024.

The iap object supports the following:

  • oauth2ClientId (pulumi.Input[str]) - OAuth2 Client ID for IAP

  • oauth2ClientSecret (pulumi.Input[str]) - OAuth2 Client Secret for IAP Note: This property is sensitive and will not be displayed in the plan.

  • oauth2ClientSecretSha256 (pulumi.Input[str]) - - OAuth2 Client Secret SHA-256 for IAP Note: This property is sensitive and will not be displayed in the plan.

The log_config object supports the following:

  • enable (pulumi.Input[bool]) - Whether to enable logging for the load balancer traffic served by this backend service.

  • sampleRate (pulumi.Input[float]) - This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.

The outlier_detection object supports the following:

  • baseEjectionTime (pulumi.Input[dict]) - The base time that a host is ejected for. The real time is equal to the base time multiplied by the number of times the host has been ejected. Defaults to 30000ms or 30s. Structure is documented below.

    • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • consecutiveErrors (pulumi.Input[float]) - Number of errors before a host is ejected from the connection pool. When the backend host is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5.

  • consecutiveGatewayFailure (pulumi.Input[float]) - The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 5.

  • enforcingConsecutiveErrors (pulumi.Input[float]) - The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.

  • enforcingConsecutiveGatewayFailure (pulumi.Input[float]) - The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0.

  • enforcingSuccessRate (pulumi.Input[float]) - The percentage chance that a host will be actually ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.

  • interval (pulumi.Input[dict]) - Time interval between ejection sweep analysis. This can result in both new ejections as well as hosts being returned to service. Defaults to 10 seconds. Structure is documented below.

    • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • maxEjectionPercent (pulumi.Input[float]) - Maximum percentage of hosts in the load balancing pool for the backend service that can be ejected. Defaults to 10%.

  • successRateMinimumHosts (pulumi.Input[float]) - The number of hosts in a cluster that must have enough request volume to detect success rate outliers. If the number of hosts is less than this setting, outlier detection via success rate statistics is not performed for any host in the cluster. Defaults to 5.

  • successRateRequestVolume (pulumi.Input[float]) - The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this host in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that host. Defaults to 100.

  • successRateStdevFactor (pulumi.Input[float]) - This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900.

Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value for TTL is one day. When the load balancing scheme is INTERNAL, this field is not used.

backends: pulumi.Output[list] = None

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

  • balancingMode (str) - Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).

  • capacityScaler (float) - A multiplier applied to the group’s maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available Capacity. Valid range is [0.0,1.0].

  • description (str) - An optional description of this resource. Provide this property when you create the resource.

  • group (str) - The fully-qualified URL of an Instance Group or Network Endpoint Group resource. In case of instance group this defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource. For Network Endpoint Groups this defines list of endpoints. All endpoints of Network Endpoint Group must be hosted on instances located in the same zone as the Network Endpoint Group. Backend services cannot mix Instance Group and Network Endpoint Group backends. Note that you must specify an Instance Group or Network Endpoint Group resource using the fully-qualified URL, rather than a partial URL.

  • maxConnections (float) - The maximum number of connections to the backend cluster. Defaults to 1024.

  • maxConnectionsPerEndpoint (float) - The max number of simultaneous connections that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must be set.

  • maxConnectionsPerInstance (float) - The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set.

  • maxRate (float) - The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, either maxRate or one of maxRatePerInstance or maxRatePerEndpoint, as appropriate for group type, must be set.

  • maxRatePerEndpoint (float) - The max requests per second (RPS) that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerEndpoint must be set.

  • maxRatePerInstance (float) - The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.

  • maxUtilization (float) - Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0].

cdn_policy: pulumi.Output[dict] = None

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

  • cacheKeyPolicy (dict) - The CacheKeyPolicy for this CdnPolicy. Structure is documented below.

    • includeHost (bool) - If true requests to different hosts will be cached separately.

    • includeProtocol (bool) - If true, http and https requests will be cached separately.

    • includeQueryString (bool) - If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

    • queryStringBlacklists (list) - Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. ‘&’ and ‘=’ will be percent encoded and not treated as delimiters.

    • queryStringWhitelists (list) - Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. ‘&’ and ‘=’ will be percent encoded and not treated as delimiters.

  • signedUrlCacheMaxAgeSec (float) - Maximum number of seconds the response to a signed URL request will be considered fresh, defaults to 1hr (3600s). After this time period, the response will be revalidated before being served. When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a “Cache-Control: public, max-age=[TTL]” header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered.

circuit_breakers: pulumi.Output[dict] = None

Settings controlling the volume of connections to a backend service. This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • connectTimeout (dict) - The timeout for new network connections to hosts. Structure is documented below.

    • nanos (float) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (float) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • maxConnections (float) - The maximum number of connections to the backend cluster. Defaults to 1024.

  • maxPendingRequests (float) - The maximum number of pending requests to the backend cluster. Defaults to 1024.

  • maxRequests (float) - The maximum number of parallel requests to the backend cluster. Defaults to 1024.

  • maxRequestsPerConnection (float) - Maximum requests for a single backend connection. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.

  • maxRetries (float) - The maximum number of parallel retries to the backend cluster. Defaults to 3.

connection_draining_timeout_sec: pulumi.Output[float] = None

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

consistent_hash: pulumi.Output[dict] = None

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field only applies if the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is set to MAGLEV or RING_HASH. Structure is documented below.

  • httpCookie (dict) - Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Structure is documented below.

    • name (str) - Name of the cookie.

    • path (str) - Path to set for the cookie.

    • ttl (dict) - Lifetime of the cookie. Structure is documented below.

      • nanos (float) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

      • seconds (float) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • httpHeaderName (str) - The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD.

  • minimumRingSize (float) - The minimum number of virtual nodes to use for the hash ring. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. Defaults to 1024.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

custom_request_headers: pulumi.Output[list] = None

Headers that the HTTP/S load balancer should add to proxied requests.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

enable_cdn: pulumi.Output[bool] = None

If true, enable Cloud CDN for this BackendService.

fingerprint: pulumi.Output[str] = None

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking.

health_checks: pulumi.Output[str] = None

The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. For internal load balancing, a URL to a HealthCheck resource must be specified instead.

iap: pulumi.Output[dict] = None

Settings for enabling Cloud Identity Aware Proxy Structure is documented below.

  • oauth2ClientId (str) - OAuth2 Client ID for IAP

  • oauth2ClientSecret (str) - OAuth2 Client Secret for IAP Note: This property is sensitive and will not be displayed in the plan.

  • oauth2ClientSecretSha256 (str) - - OAuth2 Client Secret SHA-256 for IAP Note: This property is sensitive and will not be displayed in the plan.

load_balancing_scheme: pulumi.Output[str] = None

Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other.

locality_lb_policy: pulumi.Output[str] = None

The load balancing algorithm used within the scope of the locality. The possible values are - ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. RANDOM - The load balancer selects a random healthy host. ORIGINAL_DESTINATION - Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. MAGLEV - used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, refer to https://ai.google/research/pubs/pub44824 This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED.

log_config: pulumi.Output[dict] = None

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. Structure is documented below.

  • enable (bool) - Whether to enable logging for the load balancer traffic served by this backend service.

  • sampleRate (float) - This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.

name: pulumi.Output[str] = None

Name of the cookie.

outlier_detection: pulumi.Output[dict] = None

Settings controlling eviction of unhealthy hosts from the load balancing pool. This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • baseEjectionTime (dict) - The base time that a host is ejected for. The real time is equal to the base time multiplied by the number of times the host has been ejected. Defaults to 30000ms or 30s. Structure is documented below.

    • nanos (float) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (float) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • consecutiveErrors (float) - Number of errors before a host is ejected from the connection pool. When the backend host is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5.

  • consecutiveGatewayFailure (float) - The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 5.

  • enforcingConsecutiveErrors (float) - The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.

  • enforcingConsecutiveGatewayFailure (float) - The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0.

  • enforcingSuccessRate (float) - The percentage chance that a host will be actually ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.

  • interval (dict) - Time interval between ejection sweep analysis. This can result in both new ejections as well as hosts being returned to service. Defaults to 10 seconds. Structure is documented below.

    • nanos (float) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (float) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • maxEjectionPercent (float) - Maximum percentage of hosts in the load balancing pool for the backend service that can be ejected. Defaults to 10%.

  • successRateMinimumHosts (float) - The number of hosts in a cluster that must have enough request volume to detect success rate outliers. If the number of hosts is less than this setting, outlier detection via success rate statistics is not performed for any host in the cluster. Defaults to 5.

  • successRateRequestVolume (float) - The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this host in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that host. Defaults to 100.

  • successRateStdevFactor (float) - This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900.

port_name: pulumi.Output[str] = None

Name of backend port. The same name should appear in the instance groups referenced by this service. Required when the load balancing scheme is EXTERNAL.

project: pulumi.Output[str] = None

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

protocol: pulumi.Output[str] = None

The protocol this BackendService uses to communicate with backends. The default is HTTP. NOTE: HTTP2 is only valid for beta HTTP/2 load balancer types and may result in errors if used with the GA API.

security_policy: pulumi.Output[str] = None

The security policy associated with this backend service.

The URI of the created resource.

session_affinity: pulumi.Output[str] = None

Type of session affinity to use. The default is NONE. Session affinity is not applicable if the protocol is UDP.

timeout_sec: pulumi.Output[float] = None

How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. Valid range is [1, 86400].

static get(resource_name, id, opts=None, affinity_cookie_ttl_sec=None, backends=None, cdn_policy=None, circuit_breakers=None, connection_draining_timeout_sec=None, consistent_hash=None, creation_timestamp=None, custom_request_headers=None, description=None, enable_cdn=None, fingerprint=None, health_checks=None, iap=None, load_balancing_scheme=None, locality_lb_policy=None, log_config=None, name=None, outlier_detection=None, port_name=None, project=None, protocol=None, security_policy=None, self_link=None, session_affinity=None, timeout_sec=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • affinity_cookie_ttl_sec (pulumi.Input[float]) – Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value for TTL is one day. When the load balancing scheme is INTERNAL, this field is not used.

  • backends (pulumi.Input[list]) – The set of backends that serve this BackendService. Structure is documented below.

  • cdn_policy (pulumi.Input[dict]) – Cloud CDN configuration for this BackendService. Structure is documented below.

  • circuit_breakers (pulumi.Input[dict]) – Settings controlling the volume of connections to a backend service. This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • connection_draining_timeout_sec (pulumi.Input[float]) – Time for which instance will be drained (not accept new connections, but still work to finish started).

  • consistent_hash (pulumi.Input[dict]) – Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field only applies if the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is set to MAGLEV or RING_HASH. Structure is documented below.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • custom_request_headers (pulumi.Input[list]) – Headers that the HTTP/S load balancer should add to proxied requests.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • enable_cdn (pulumi.Input[bool]) – If true, enable Cloud CDN for this BackendService.

  • fingerprint (pulumi.Input[str]) – Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking.

  • health_checks (pulumi.Input[str]) – The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. For internal load balancing, a URL to a HealthCheck resource must be specified instead.

  • iap (pulumi.Input[dict]) – Settings for enabling Cloud Identity Aware Proxy Structure is documented below.

  • load_balancing_scheme (pulumi.Input[str]) – Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other.

  • locality_lb_policy (pulumi.Input[str]) – The load balancing algorithm used within the scope of the locality. The possible values are - ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. RANDOM - The load balancer selects a random healthy host. ORIGINAL_DESTINATION - Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. MAGLEV - used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, refer to https://ai.google/research/pubs/pub44824 This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED.

  • log_config (pulumi.Input[dict]) – This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the cookie.

  • outlier_detection (pulumi.Input[dict]) – Settings controlling eviction of unhealthy hosts from the load balancing pool. This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • port_name (pulumi.Input[str]) – Name of backend port. The same name should appear in the instance groups referenced by this service. Required when the load balancing scheme is EXTERNAL.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • protocol (pulumi.Input[str]) – The protocol this BackendService uses to communicate with backends. The default is HTTP. NOTE: HTTP2 is only valid for beta HTTP/2 load balancer types and may result in errors if used with the GA API.

  • security_policy (pulumi.Input[str]) – The security policy associated with this backend service.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • session_affinity (pulumi.Input[str]) – Type of session affinity to use. The default is NONE. Session affinity is not applicable if the protocol is UDP.

  • timeout_sec (pulumi.Input[float]) – How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. Valid range is [1, 86400].

The backends object supports the following:

  • balancingMode (pulumi.Input[str]) - Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).

  • capacityScaler (pulumi.Input[float]) - A multiplier applied to the group’s maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available Capacity. Valid range is [0.0,1.0].

  • description (pulumi.Input[str]) - An optional description of this resource. Provide this property when you create the resource.

  • group (pulumi.Input[str]) - The fully-qualified URL of an Instance Group or Network Endpoint Group resource. In case of instance group this defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource. For Network Endpoint Groups this defines list of endpoints. All endpoints of Network Endpoint Group must be hosted on instances located in the same zone as the Network Endpoint Group. Backend services cannot mix Instance Group and Network Endpoint Group backends. Note that you must specify an Instance Group or Network Endpoint Group resource using the fully-qualified URL, rather than a partial URL.

  • maxConnections (pulumi.Input[float]) - The maximum number of connections to the backend cluster. Defaults to 1024.

  • maxConnectionsPerEndpoint (pulumi.Input[float]) - The max number of simultaneous connections that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must be set.

  • maxConnectionsPerInstance (pulumi.Input[float]) - The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set.

  • maxRate (pulumi.Input[float]) - The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, either maxRate or one of maxRatePerInstance or maxRatePerEndpoint, as appropriate for group type, must be set.

  • maxRatePerEndpoint (pulumi.Input[float]) - The max requests per second (RPS) that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerEndpoint must be set.

  • maxRatePerInstance (pulumi.Input[float]) - The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.

  • maxUtilization (pulumi.Input[float]) - Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0].

The cdn_policy object supports the following:

  • cacheKeyPolicy (pulumi.Input[dict]) - The CacheKeyPolicy for this CdnPolicy. Structure is documented below.

    • includeHost (pulumi.Input[bool]) - If true requests to different hosts will be cached separately.

    • includeProtocol (pulumi.Input[bool]) - If true, http and https requests will be cached separately.

    • includeQueryString (pulumi.Input[bool]) - If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

    • queryStringBlacklists (pulumi.Input[list]) - Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. ‘&’ and ‘=’ will be percent encoded and not treated as delimiters.

    • queryStringWhitelists (pulumi.Input[list]) - Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. ‘&’ and ‘=’ will be percent encoded and not treated as delimiters.

  • signedUrlCacheMaxAgeSec (pulumi.Input[float]) - Maximum number of seconds the response to a signed URL request will be considered fresh, defaults to 1hr (3600s). After this time period, the response will be revalidated before being served. When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a “Cache-Control: public, max-age=[TTL]” header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered.

The circuit_breakers object supports the following:

  • connectTimeout (pulumi.Input[dict]) - The timeout for new network connections to hosts. Structure is documented below.

    • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • maxConnections (pulumi.Input[float]) - The maximum number of connections to the backend cluster. Defaults to 1024.

  • maxPendingRequests (pulumi.Input[float]) - The maximum number of pending requests to the backend cluster. Defaults to 1024.

  • maxRequests (pulumi.Input[float]) - The maximum number of parallel requests to the backend cluster. Defaults to 1024.

  • maxRequestsPerConnection (pulumi.Input[float]) - Maximum requests for a single backend connection. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.

  • maxRetries (pulumi.Input[float]) - The maximum number of parallel retries to the backend cluster. Defaults to 3.

The consistent_hash object supports the following:

  • httpCookie (pulumi.Input[dict]) - Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Structure is documented below.

    • name (pulumi.Input[str]) - Name of the cookie.

    • path (pulumi.Input[str]) - Path to set for the cookie.

    • ttl (pulumi.Input[dict]) - Lifetime of the cookie. Structure is documented below.

      • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

      • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • httpHeaderName (pulumi.Input[str]) - The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD.

  • minimumRingSize (pulumi.Input[float]) - The minimum number of virtual nodes to use for the hash ring. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. Defaults to 1024.

The iap object supports the following:

  • oauth2ClientId (pulumi.Input[str]) - OAuth2 Client ID for IAP

  • oauth2ClientSecret (pulumi.Input[str]) - OAuth2 Client Secret for IAP Note: This property is sensitive and will not be displayed in the plan.

  • oauth2ClientSecretSha256 (pulumi.Input[str]) - - OAuth2 Client Secret SHA-256 for IAP Note: This property is sensitive and will not be displayed in the plan.

The log_config object supports the following:

  • enable (pulumi.Input[bool]) - Whether to enable logging for the load balancer traffic served by this backend service.

  • sampleRate (pulumi.Input[float]) - This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.

The outlier_detection object supports the following:

  • baseEjectionTime (pulumi.Input[dict]) - The base time that a host is ejected for. The real time is equal to the base time multiplied by the number of times the host has been ejected. Defaults to 30000ms or 30s. Structure is documented below.

    • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • consecutiveErrors (pulumi.Input[float]) - Number of errors before a host is ejected from the connection pool. When the backend host is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5.

  • consecutiveGatewayFailure (pulumi.Input[float]) - The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 5.

  • enforcingConsecutiveErrors (pulumi.Input[float]) - The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.

  • enforcingConsecutiveGatewayFailure (pulumi.Input[float]) - The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0.

  • enforcingSuccessRate (pulumi.Input[float]) - The percentage chance that a host will be actually ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.

  • interval (pulumi.Input[dict]) - Time interval between ejection sweep analysis. This can result in both new ejections as well as hosts being returned to service. Defaults to 10 seconds. Structure is documented below.

    • nanos (pulumi.Input[float]) - Span of time that’s a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

    • seconds (pulumi.Input[float]) - Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive.

  • maxEjectionPercent (pulumi.Input[float]) - Maximum percentage of hosts in the load balancing pool for the backend service that can be ejected. Defaults to 10%.

  • successRateMinimumHosts (pulumi.Input[float]) - The number of hosts in a cluster that must have enough request volume to detect success rate outliers. If the number of hosts is less than this setting, outlier detection via success rate statistics is not performed for any host in the cluster. Defaults to 5.

  • successRateRequestVolume (pulumi.Input[float]) - The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this host in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that host. Defaults to 100.

  • successRateStdevFactor (pulumi.Input[float]) - This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.BackendServiceSignedUrlKey(resource_name, opts=None, backend_service=None, key_value=None, name=None, project=None, __props__=None, __name__=None, __opts__=None)

A key for signing Cloud CDN signed URLs for Backend Services.

To get more information about BackendServiceSignedUrlKey, see:

Warning: All arguments including key_value will be stored in the raw state as plain-text.

import pulumi
import pulumi_gcp as gcp

webserver = gcp.compute.InstanceTemplate("webserver",
    machine_type="n1-standard-1",
    network_interface=[{
        "network": "default",
    }],
    disk=[{
        "sourceImage": "debian-cloud/debian-9",
        "autoDelete": True,
        "boot": True,
    }])
webservers = gcp.compute.InstanceGroupManager("webservers",
    version=[{
        "instanceTemplate": webserver.id,
        "name": "primary",
    }],
    base_instance_name="webserver",
    zone="us-central1-f",
    target_size=1)
default = gcp.compute.HttpHealthCheck("default",
    request_path="/",
    check_interval_sec=1,
    timeout_sec=1)
example_backend = gcp.compute.BackendService("exampleBackend",
    description="Our company website",
    port_name="http",
    protocol="HTTP",
    timeout_sec=10,
    enable_cdn=True,
    backend=[{
        "group": webservers.instance_group,
    }],
    health_checks=[default.id])
backend_key = gcp.compute.BackendServiceSignedUrlKey("backendKey",
    key_value="pPsVemX8GM46QVeezid6Rw==",
    backend_service=example_backend.name)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_service (pulumi.Input[str]) – The backend service this signed URL key belongs.

  • key_value (pulumi.Input[str]) – 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.

  • name (pulumi.Input[str]) – Name of the signed URL key.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

backend_service: pulumi.Output[str] = None

The backend service this signed URL key belongs.

key_value: pulumi.Output[str] = None

128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.

name: pulumi.Output[str] = None

Name of the signed URL key.

project: pulumi.Output[str] = None

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

static get(resource_name, id, opts=None, backend_service=None, key_value=None, name=None, project=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backend_service (pulumi.Input[str]) – The backend service this signed URL key belongs.

  • key_value (pulumi.Input[str]) – 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.

  • name (pulumi.Input[str]) – Name of the signed URL key.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.Disk(resource_name, opts=None, description=None, disk_encryption_key=None, image=None, labels=None, name=None, physical_block_size_bytes=None, project=None, resource_policies=None, size=None, snapshot=None, source_image_encryption_key=None, source_snapshot_encryption_key=None, type=None, zone=None, __props__=None, __name__=None, __opts__=None)

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 disk_encryption_key.raw_key will be stored in the raw state as plain-text. Read more about secrets in state.

import pulumi
import pulumi_gcp as gcp

default = gcp.compute.Disk("default",
    image="debian-8-jessie-v20170523",
    labels={
        "environment": "dev",
    },
    physical_block_size_bytes=4096,
    type="pd-ssd",
    zone="us-central1-a")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • disk_encryption_key (pulumi.Input[dict]) – Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.

  • image (pulumi.Input[str]) – The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

  • labels (pulumi.Input[dict]) – Labels to apply to this disk. A list of key->value pairs.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • physical_block_size_bytes (pulumi.Input[float]) – Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller’s project.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • resource_policies (pulumi.Input[list]) – Resource policies applied to this disk for automatic snapshot creations. ~>NOTE This value does not support updating the resource policy, as resource policies can not be updated more than one at a time. Use ‘google_compute_disk_resource_policy_attachment’ to allow for updating the resource policy attached to the disk.

  • size (pulumi.Input[float]) – Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the image or snapshot parameter, or specify it alone to create an empty persistent disk. If you specify this field along with image or snapshot, the value must not be less than the size of the image or the size of the snapshot.

  • snapshot (pulumi.Input[str]) – The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:

* `https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot`
* `projects/project/global/snapshots/snapshot`
* `global/snapshots/snapshot`
* `snapshot`
Parameters
  • source_image_encryption_key (pulumi.Input[dict]) – The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.

  • source_snapshot_encryption_key (pulumi.Input[dict]) – The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

  • type (pulumi.Input[str]) – URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

  • zone (pulumi.Input[str]) – A reference to the zone where the disk resides.

The disk_encryption_key object supports the following:

  • kmsKeySelfLink (pulumi.Input[str]) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (pulumi.Input[str]) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (pulumi.Input[str]) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

The source_image_encryption_key object supports the following:

  • kmsKeySelfLink (pulumi.Input[str]) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (pulumi.Input[str]) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (pulumi.Input[str]) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

The source_snapshot_encryption_key object supports the following:

  • kmsKeySelfLink (pulumi.Input[str]) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (pulumi.Input[str]) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (pulumi.Input[str]) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

disk_encryption_key: pulumi.Output[dict] = None

Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.

  • kmsKeySelfLink (str) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (str) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (str) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

image: pulumi.Output[str] = None

The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

label_fingerprint: pulumi.Output[str] = None

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels: pulumi.Output[dict] = None

Labels to apply to this disk. A list of key->value pairs.

last_attach_timestamp: pulumi.Output[str] = None

Last attach timestamp in RFC3339 text format.

last_detach_timestamp: pulumi.Output[str] = None

Last detach timestamp in RFC3339 text format.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

physical_block_size_bytes: pulumi.Output[float] = None

Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller’s project.

project: pulumi.Output[str] = None

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

resource_policies: pulumi.Output[list] = None

Resource policies applied to this disk for automatic snapshot creations. ~>NOTE This value does not support updating the resource policy, as resource policies can not be updated more than one at a time. Use ‘google_compute_disk_resource_policy_attachment’ to allow for updating the resource policy attached to the disk.

The URI of the created resource.

size: pulumi.Output[float] = None

Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the image or snapshot parameter, or specify it alone to create an empty persistent disk. If you specify this field along with image or snapshot, the value must not be less than the size of the image or the size of the snapshot.

snapshot: pulumi.Output[str] = None

The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot

  • projects/project/global/snapshots/snapshot

  • global/snapshots/snapshot

  • snapshot

source_image_encryption_key: pulumi.Output[dict] = None

The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.

  • kmsKeySelfLink (str) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (str) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (str) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

source_image_id: pulumi.Output[str] = None

The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.

source_snapshot_encryption_key: pulumi.Output[dict] = None

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

  • kmsKeySelfLink (str) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (str) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (str) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

source_snapshot_id: pulumi.Output[str] = None

The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.

type: pulumi.Output[str] = None

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

users: pulumi.Output[list] = None

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

zone: pulumi.Output[str] = None

A reference to the zone where the disk resides.

static get(resource_name, id, opts=None, creation_timestamp=None, description=None, disk_encryption_key=None, image=None, label_fingerprint=None, labels=None, last_attach_timestamp=None, last_detach_timestamp=None, name=None, physical_block_size_bytes=None, project=None, resource_policies=None, self_link=None, size=None, snapshot=None, source_image_encryption_key=None, source_image_id=None, source_snapshot_encryption_key=None, source_snapshot_id=None, type=None, users=None, zone=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • disk_encryption_key (pulumi.Input[dict]) – Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.

  • image (pulumi.Input[str]) –

    The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

  • label_fingerprint (pulumi.Input[str]) – The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • labels (pulumi.Input[dict]) – Labels to apply to this disk. A list of key->value pairs.

  • last_attach_timestamp (pulumi.Input[str]) – Last attach timestamp in RFC3339 text format.

  • last_detach_timestamp (pulumi.Input[str]) – Last detach timestamp in RFC3339 text format.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • physical_block_size_bytes (pulumi.Input[float]) – Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller’s project.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • resource_policies (pulumi.Input[list]) –

    Resource policies applied to this disk for automatic snapshot creations. ~>NOTE This value does not support updating the resource policy, as resource policies can not be updated more than one at a time. Use ‘google_compute_disk_resource_policy_attachment’ to allow for updating the resource policy attached to the disk.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • size (pulumi.Input[float]) – Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the image or snapshot parameter, or specify it alone to create an empty persistent disk. If you specify this field along with image or snapshot, the value must not be less than the size of the image or the size of the snapshot.

  • snapshot (pulumi.Input[str]) – The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:

* `https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot`
* `projects/project/global/snapshots/snapshot`
* `global/snapshots/snapshot`
* `snapshot`
Parameters
  • source_image_encryption_key (pulumi.Input[dict]) – The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.

  • source_image_id (pulumi.Input[str]) – The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.

  • source_snapshot_encryption_key (pulumi.Input[dict]) – The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

  • source_snapshot_id (pulumi.Input[str]) – The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.

  • type (pulumi.Input[str]) – URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

  • users (pulumi.Input[list]) – Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

  • zone (pulumi.Input[str]) – A reference to the zone where the disk resides.

The disk_encryption_key object supports the following:

  • kmsKeySelfLink (pulumi.Input[str]) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (pulumi.Input[str]) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (pulumi.Input[str]) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

The source_image_encryption_key object supports the following:

  • kmsKeySelfLink (pulumi.Input[str]) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (pulumi.Input[str]) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (pulumi.Input[str]) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

The source_snapshot_encryption_key object supports the following:

  • kmsKeySelfLink (pulumi.Input[str]) - The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project’s Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

  • rawKey (pulumi.Input[str]) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

  • sha256 (pulumi.Input[str]) - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.DiskResourcePolicyAttachment(resource_name, opts=None, disk=None, name=None, project=None, zone=None, __props__=None, __name__=None, __opts__=None)

Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Note: This resource does not support regional disks (compute.RegionDisk). For regional disks, please refer to the compute.RegionDiskResourcePolicyAttachment resource.

import pulumi
import pulumi_gcp as gcp

my_image = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
ssd = gcp.compute.Disk("ssd",
    image=my_image.self_link,
    size=50,
    type="pd-ssd",
    zone="us-central1-a")
attachment = gcp.compute.DiskResourcePolicyAttachment("attachment",
    disk=ssd.name,
    zone="us-central1-a")
policy = gcp.compute.ResourcePolicy("policy",
    region="us-central1",
    snapshot_schedule_policy={
        "schedule": {
            "daily_schedule": {
                "daysInCycle": 1,
                "startTime": "04:00",
            },
        },
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • disk (pulumi.Input[str]) – The name of the disk in which the resource policies are attached to.

  • name (pulumi.Input[str]) – The resource policy to be attached to the disk for scheduling snapshot creation. Do not specify the self link.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • zone (pulumi.Input[str]) – A reference to the zone where the disk resides.

disk: pulumi.Output[str] = None

The name of the disk in which the resource policies are attached to.

name: pulumi.Output[str] = None

The resource policy to be attached to the disk for scheduling snapshot creation. Do not specify the self link.

project: pulumi.Output[str] = None

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

zone: pulumi.Output[str] = None

A reference to the zone where the disk resides.

static get(resource_name, id, opts=None, disk=None, name=None, project=None, zone=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • disk (pulumi.Input[str]) – The name of the disk in which the resource policies are attached to.

  • name (pulumi.Input[str]) – The resource policy to be attached to the disk for scheduling snapshot creation. Do not specify the self link.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • zone (pulumi.Input[str]) – A reference to the zone where the disk resides.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.ExternalVpnGateway(resource_name, opts=None, description=None, interfaces=None, name=None, project=None, redundancy_type=None, __props__=None, __name__=None, __opts__=None)

Represents a VPN gateway managed outside of GCP.

To get more information about ExternalVpnGateway, see:

import pulumi
import pulumi_gcp as gcp

network = gcp.compute.Network("network",
    routing_mode="GLOBAL",
    auto_create_subnetworks=False)
ha_gateway = gcp.compute.HaVpnGateway("haGateway",
    region="us-central1",
    network=network.id)
external_gateway = gcp.compute.ExternalVpnGateway("externalGateway",
    redundancy_type="SINGLE_IP_INTERNALLY_REDUNDANT",
    description="An externally managed VPN gateway",
    interface=[{
        "id": 0,
        "ip_address": "8.8.8.8",
    }])
network_subnet1 = gcp.compute.Subnetwork("networkSubnet1",
    ip_cidr_range="10.0.1.0/24",
    region="us-central1",
    network=network.id)
network_subnet2 = gcp.compute.Subnetwork("networkSubnet2",
    ip_cidr_range="10.0.2.0/24",
    region="us-west1",
    network=network.id)
router1 = gcp.compute.Router("router1",
    network=network.name,
    bgp={
        "asn": 64514,
    })
tunnel1 = gcp.compute.VPNTunnel("tunnel1",
    region="us-central1",
    vpn_gateway=ha_gateway.id,
    peer_external_gateway=external_gateway.id,
    peer_external_gateway_interface=0,
    shared_secret="a secret message",
    router=router1.id,
    vpn_gateway_interface=0)
tunnel2 = gcp.compute.VPNTunnel("tunnel2",
    region="us-central1",
    vpn_gateway=ha_gateway.id,
    peer_external_gateway=external_gateway.id,
    peer_external_gateway_interface=0,
    shared_secret="a secret message",
    router=router1.id.apply(lambda id: f" {id}"),
    vpn_gateway_interface=1)
router1_interface1 = gcp.compute.RouterInterface("router1Interface1",
    router=router1.name,
    region="us-central1",
    ip_range="169.254.0.1/30",
    vpn_tunnel=tunnel1.name)
router1_peer1 = gcp.compute.RouterPeer("router1Peer1",
    router=router1.name,
    region="us-central1",
    peer_ip_address="169.254.0.2",
    peer_asn=64515,
    advertised_route_priority=100,
    interface=router1_interface1.name)
router1_interface2 = gcp.compute.RouterInterface("router1Interface2",
    router=router1.name,
    region="us-central1",
    ip_range="169.254.1.1/30",
    vpn_tunnel=tunnel2.name)
router1_peer2 = gcp.compute.RouterPeer("router1Peer2",
    router=router1.name,
    region="us-central1",
    peer_ip_address="169.254.1.2",
    peer_asn=64515,
    advertised_route_priority=100,
    interface=router1_interface2.name)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • interfaces (pulumi.Input[list]) – A list of interfaces on this external VPN gateway. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • redundancy_type (pulumi.Input[str]) – Indicates the redundancy type of this external VPN gateway

The interfaces object supports the following:

  • id (pulumi.Input[float]) - The numberic ID for this interface. Allowed values are based on the redundancy type of this external VPN gateway

    • 0 - SINGLE_IP_INTERNALLY_REDUNDANT

    • 0, 1 - TWO_IPS_REDUNDANCY

    • 0, 1, 2, 3 - FOUR_IPS_REDUNDANCY

  • ip_address (pulumi.Input[str]) - IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider’s VPN gateway, it cannot be an IP address from Google Compute Engine.

description: pulumi.Output[str] = None

An optional description of this resource.

interfaces: pulumi.Output[list] = None

A list of interfaces on this external VPN gateway. Structure is documented below.

  • id (float) - The numberic ID for this interface. Allowed values are based on the redundancy type of this external VPN gateway

    • 0 - SINGLE_IP_INTERNALLY_REDUNDANT

    • 0, 1 - TWO_IPS_REDUNDANCY

    • 0, 1, 2, 3 - FOUR_IPS_REDUNDANCY

  • ip_address (str) - IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider’s VPN gateway, it cannot be an IP address from Google Compute Engine.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project: pulumi.Output[str] = None

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

redundancy_type: pulumi.Output[str] = None

Indicates the redundancy type of this external VPN gateway

The URI of the created resource.

static get(resource_name, id, opts=None, description=None, interfaces=None, name=None, project=None, redundancy_type=None, self_link=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • interfaces (pulumi.Input[list]) – A list of interfaces on this external VPN gateway. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • redundancy_type (pulumi.Input[str]) – Indicates the redundancy type of this external VPN gateway

  • self_link (pulumi.Input[str]) – The URI of the created resource.

The interfaces object supports the following:

  • id (pulumi.Input[float]) - The numberic ID for this interface. Allowed values are based on the redundancy type of this external VPN gateway

    • 0 - SINGLE_IP_INTERNALLY_REDUNDANT

    • 0, 1 - TWO_IPS_REDUNDANCY

    • 0, 1, 2, 3 - FOUR_IPS_REDUNDANCY

  • ip_address (pulumi.Input[str]) - IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider’s VPN gateway, it cannot be an IP address from Google Compute Engine.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.Firewall(resource_name, opts=None, allows=None, denies=None, description=None, destination_ranges=None, direction=None, disabled=None, enable_logging=None, name=None, network=None, priority=None, project=None, source_ranges=None, source_service_accounts=None, source_tags=None, target_service_accounts=None, target_tags=None, __props__=None, __name__=None, __opts__=None)

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:

import pulumi
import pulumi_gcp as gcp

default_network = gcp.compute.Network("defaultNetwork")
default_firewall = gcp.compute.Firewall("defaultFirewall",
    network=default_network.name,
    allow=[
        {
            "protocol": "icmp",
        },
        {
            "protocol": "tcp",
            "ports": [
                "80",
                "8080",
                "1000-2000",
            ],
        },
    ],
    source_tags=["web"])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • allows (pulumi.Input[list]) – The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. Structure is documented below.

  • denies (pulumi.Input[list]) – The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. Structure is documented below.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • destination_ranges (pulumi.Input[list]) – If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported.

  • direction (pulumi.Input[str]) – Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags.

  • disabled (pulumi.Input[bool]) – Denotes whether the firewall rule is disabled, i.e not applied to the network it is associated with. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled.

  • enable_logging (pulumi.Input[bool]) – This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – The name or self_link of the network to attach this firewall to.

  • priority (pulumi.Input[float]) – Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • source_ranges (pulumi.Input[list]) – If source ranges are specified, the firewall will apply only to traffic that has source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported.

  • source_service_accounts (pulumi.Input[list]) – If source service accounts are specified, the firewall will apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance’s external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both properties for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags.

  • source_tags (pulumi.Input[list]) – If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance’s external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.

  • target_service_accounts (pulumi.Input[list]) – A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network.

  • target_tags (pulumi.Input[list]) – A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.

The allows object supports the following:

  • ports (pulumi.Input[list]) - An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: [“22”], [“80”,”443”], and [“12345-12349”].

  • protocol (pulumi.Input[str]) - The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the IP protocol number.

The denies object supports the following:

  • ports (pulumi.Input[list]) - An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: [“22”], [“80”,”443”], and [“12345-12349”].

  • protocol (pulumi.Input[str]) - The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the IP protocol number.

allows: pulumi.Output[list] = None

The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. Structure is documented below.

  • ports (list) - An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: [“22”], [“80”,”443”], and [“12345-12349”].

  • protocol (str) - The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the IP protocol number.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

denies: pulumi.Output[list] = None

The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. Structure is documented below.

  • ports (list) - An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: [“22”], [“80”,”443”], and [“12345-12349”].

  • protocol (str) - The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the IP protocol number.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

destination_ranges: pulumi.Output[list] = None

If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported.

direction: pulumi.Output[str] = None

Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags.

disabled: pulumi.Output[bool] = None

Denotes whether the firewall rule is disabled, i.e not applied to the network it is associated with. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled.

enable_logging: pulumi.Output[bool] = None

This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

network: pulumi.Output[str] = None

The name or self_link of the network to attach this firewall to.

priority: pulumi.Output[float] = None

Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority.

project: pulumi.Output[str] = None

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

The URI of the created resource.

source_ranges: pulumi.Output[list] = None

If source ranges are specified, the firewall will apply only to traffic that has source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported.

source_service_accounts: pulumi.Output[list] = None

If source service accounts are specified, the firewall will apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance’s external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both properties for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags.

source_tags: pulumi.Output[list] = None

If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance’s external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.

target_service_accounts: pulumi.Output[list] = None

A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network.

target_tags: pulumi.Output[list] = None

A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.

static get(resource_name, id, opts=None, allows=None, creation_timestamp=None, denies=None, description=None, destination_ranges=None, direction=None, disabled=None, enable_logging=None, name=None, network=None, priority=None, project=None, self_link=None, source_ranges=None, source_service_accounts=None, source_tags=None, target_service_accounts=None, target_tags=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • allows (pulumi.Input[list]) – The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. Structure is documented below.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • denies (pulumi.Input[list]) – The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. Structure is documented below.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • destination_ranges (pulumi.Input[list]) – If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported.

  • direction (pulumi.Input[str]) – Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags.

  • disabled (pulumi.Input[bool]) – Denotes whether the firewall rule is disabled, i.e not applied to the network it is associated with. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled.

  • enable_logging (pulumi.Input[bool]) – This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – The name or self_link of the network to attach this firewall to.

  • priority (pulumi.Input[float]) – Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • source_ranges (pulumi.Input[list]) – If source ranges are specified, the firewall will apply only to traffic that has source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported.

  • source_service_accounts (pulumi.Input[list]) – If source service accounts are specified, the firewall will apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance’s external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both properties for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags.

  • source_tags (pulumi.Input[list]) – If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance’s external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.

  • target_service_accounts (pulumi.Input[list]) – A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network.

  • target_tags (pulumi.Input[list]) – A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.

The allows object supports the following:

  • ports (pulumi.Input[list]) - An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: [“22”], [“80”,”443”], and [“12345-12349”].

  • protocol (pulumi.Input[str]) - The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the IP protocol number.

The denies object supports the following:

  • ports (pulumi.Input[list]) - An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: [“22”], [“80”,”443”], and [“12345-12349”].

  • protocol (pulumi.Input[str]) - The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the IP protocol number.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.ForwardingRule(resource_name, opts=None, all_ports=None, allow_global_access=None, backend_service=None, description=None, ip_address=None, ip_protocol=None, is_mirroring_collector=None, labels=None, load_balancing_scheme=None, name=None, network=None, network_tier=None, port_range=None, ports=None, project=None, region=None, service_label=None, subnetwork=None, target=None, __props__=None, __name__=None, __opts__=None)

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:

import pulumi
import pulumi_gcp as gcp

hc = gcp.compute.HealthCheck("hc",
    check_interval_sec=1,
    timeout_sec=1,
    tcp_health_check={
        "port": "80",
    })
backend = gcp.compute.RegionBackendService("backend",
    region="us-central1",
    health_checks=[hc.id])
default_network = gcp.compute.Network("defaultNetwork", auto_create_subnetworks=False)
default_subnetwork = gcp.compute.Subnetwork("defaultSubnetwork",
    ip_cidr_range="10.0.0.0/16",
    region="us-central1",
    network=default_network.id)
# Forwarding rule for Internal Load Balancing
default_forwarding_rule = gcp.compute.ForwardingRule("defaultForwardingRule",
    region="us-central1",
    load_balancing_scheme="INTERNAL",
    backend_service=backend.id,
    all_ports=True,
    allow_global_access=True,
    network=default_network.name,
    subnetwork=default_subnetwork.name)
import pulumi
import pulumi_gcp as gcp

default_target_pool = gcp.compute.TargetPool("defaultTargetPool")
default_forwarding_rule = gcp.compute.ForwardingRule("defaultForwardingRule",
    target=default_target_pool.id,
    port_range="80")
import pulumi
import pulumi_gcp as gcp

hc = gcp.compute.HealthCheck("hc",
    check_interval_sec=1,
    timeout_sec=1,
    tcp_health_check={
        "port": "80",
    })
backend = gcp.compute.RegionBackendService("backend",
    region="us-central1",
    health_checks=[hc.id])
default_network = gcp.compute.Network("defaultNetwork", auto_create_subnetworks=False)
default_subnetwork = gcp.compute.Subnetwork("defaultSubnetwork",
    ip_cidr_range="10.0.0.0/16",
    region="us-central1",
    network=default_network.id)
# Forwarding rule for Internal Load Balancing
default_forwarding_rule = gcp.compute.ForwardingRule("defaultForwardingRule",
    region="us-central1",
    load_balancing_scheme="INTERNAL",
    backend_service=backend.id,
    all_ports=True,
    network=default_network.name,
    subnetwork=default_subnetwork.name)
import pulumi
import pulumi_gcp as gcp

debian_image = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
default_network = gcp.compute.Network("defaultNetwork",
    auto_create_subnetworks=False,
    routing_mode="REGIONAL")
default_subnetwork = gcp.compute.Subnetwork("defaultSubnetwork",
    ip_cidr_range="10.1.2.0/24",
    region="us-central1",
    network=default_network.id)
instance_template = gcp.compute.InstanceTemplate("instanceTemplate",
    machine_type="n1-standard-1",
    network_interface=[{
        "network": default_network.id,
        "subnetwork": default_subnetwork.id,
    }],
    disk=[{
        "sourceImage": debian_image.self_link,
        "autoDelete": True,
        "boot": True,
    }],
    tags=[
        "allow-ssh",
        "load-balanced-backend",
    ])
rigm = gcp.compute.RegionInstanceGroupManager("rigm",
    region="us-central1",
    version=[{
        "instanceTemplate": instance_template.id,
        "name": "primary",
    }],
    base_instance_name="internal-glb",
    target_size=1)
fw1 = gcp.compute.Firewall("fw1",
    network=default_network.id,
    source_ranges=["10.1.2.0/24"],
    allow=[
        {
            "protocol": "tcp",
        },
        {
            "protocol": "udp",
        },
        {
            "protocol": "icmp",
        },
    ],
    direction="INGRESS")
fw2 = gcp.compute.Firewall("fw2",
    network=default_network.id,
    source_ranges=["0.0.0.0/0"],
    allow=[{
        "protocol": "tcp",
        "ports": ["22"],
    }],
    target_tags=["allow-ssh"],
    direction="INGRESS")
fw3 = gcp.compute.Firewall("fw3",
    network=default_network.id,
    source_ranges=[
        "130.211.0.0/22",
        "35.191.0.0/16",
    ],
    allow=[{
        "protocol": "tcp",
    }],
    target_tags=["load-balanced-backend"],
    direction="INGRESS")
fw4 = gcp.compute.Firewall("fw4",
    network=default_network.id,
    source_ranges=["10.129.0.0/26"],
    target_tags=["load-balanced-backend"],
    allow=[
        {
            "protocol": "tcp",
            "ports": ["80"],
        },
        {
            "protocol": "tcp",
            "ports": ["443"],
        },
        {
            "protocol": "tcp",
            "ports": ["8000"],
        },
    ],
    direction="INGRESS")
default_region_health_check = gcp.compute.RegionHealthCheck("defaultRegionHealthCheck",
    region="us-central1",
    http_health_check={
        "portSpecification": "USE_SERVING_PORT",
    })
default_region_backend_service = gcp.compute.RegionBackendService("defaultRegionBackendService",
    load_balancing_scheme="INTERNAL_MANAGED",
    backend=[{
        "group": rigm.instance_group,
        "balancingMode": "UTILIZATION",
        "capacityScaler": 1,
    }],
    region="us-central1",
    protocol="HTTP",
    timeout_sec=10,
    health_checks=[default_region_health_check.id])
default_region_url_map = gcp.compute.RegionUrlMap("defaultRegionUrlMap",
    region="us-central1",
    default_service=default_region_backend_service.id)
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("defaultRegionTargetHttpProxy",
    region="us-central1",
    url_map=default_region_url_map.id)
proxy = gcp.compute.Subnetwork("proxy",
    ip_cidr_range="10.129.0.0/26",
    region="us-central1",
    network=default_network.id,
    purpose="INTERNAL_HTTPS_LOAD_BALANCER",
    role="ACTIVE")
# Forwarding rule for Internal Load Balancing
default_forwarding_rule = gcp.compute.ForwardingRule("defaultForwardingRule",
    region="us-central1",
    ip_protocol="TCP",
    load_balancing_scheme="INTERNAL_MANAGED",
    port_range="80",
    target=default_region_target_http_proxy.id,
    network=default_network.id,
    subnetwork=default_subnetwork.id,
    network_tier="PREMIUM")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • all_ports (pulumi.Input[bool]) – For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL and protocol is TCP/UDP), set this to true to allow packets addressed to any ports to be forwarded to the backends configured with this forwarding rule. Used with backend service. Cannot be set if port or portRange are set.

  • allow_global_access (pulumi.Input[bool]) – If true, clients can access ILB from all regions. Otherwise only allows from the local region the ILB is located at.

  • backend_service (pulumi.Input[str]) – A BackendService to receive the matched traffic. This is used only for INTERNAL load balancing.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • ip_address (pulumi.Input[str]) – The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule’s load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address must be specified by a literal IP address. > NOTE: While the API allows you to specify various resource paths for an address resource instead, this provider requires this to specifically be an IP address to avoid needing to fetching the IP address from resource paths on refresh or unnecessary diffs.

  • ip_protocol (pulumi.Input[str]) – The IP protocol to which this rule applies. When the load balancing scheme is INTERNAL, only TCP and UDP are valid.

  • is_mirroring_collector (pulumi.Input[bool]) – Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL.

  • labels (pulumi.Input[dict]) – Labels to apply to this forwarding rule. A list of key->value pairs.

  • load_balancing_scheme (pulumi.Input[str]) – This signifies what the ForwardingRule will be used for and can be EXTERNAL, INTERNAL, or INTERNAL_MANAGED. EXTERNAL is used for Classic Cloud VPN gateways, protocol forwarding to VMs from an external IP address, and HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP load balancers. INTERNAL is used for protocol forwarding to VMs from an internal IP address, and internal TCP/UDP load balancers. INTERNAL_MANAGED is used for internal HTTP(S) load balancers.

  • name (pulumi.Input[str]) – Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – For internal load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used. This field is only used for INTERNAL load balancing.

  • network_tier (pulumi.Input[str]) – The networking tier used for configuring this address. If this field is not specified, it is assumed to be PREMIUM.

  • port_range (pulumi.Input[str]) – This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:

* TargetHttpProxy: 80, 8080
* TargetHttpsProxy: 443
* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetVpnGateway: 500, 4500
Parameters
  • ports (pulumi.Input[list]) – This field is used along with the backend_service field for internal load balancing. When the load balancing scheme is INTERNAL, a single port or a comma separated list of ports can be configured. Only packets addressed to these ports will be forwarded to the backends configured with this forwarding rule. You may specify a maximum of up to 5 ports.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • region (pulumi.Input[str]) – A reference to the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules.

  • service_label (pulumi.Input[str]) – An optional prefix to the service name for this Forwarding Rule. If specified, will be the first label of the fully qualified service name. The label must be 1-63 characters long, and comply with RFC1035. Specifically, the label must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. This field is only used for INTERNAL load balancing.

  • subnetwork (pulumi.Input[str]) – The subnetwork that the load balanced IP should belong to for this Forwarding Rule. This field is only used for INTERNAL load balancing. If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified.

  • target (pulumi.Input[str]) – The URL of the target resource to receive the matched traffic. The target must live in the same region as the forwarding rule. The forwarded traffic must be of a type appropriate to the target object.

all_ports: pulumi.Output[bool] = None

For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL and protocol is TCP/UDP), set this to true to allow packets addressed to any ports to be forwarded to the backends configured with this forwarding rule. Used with backend service. Cannot be set if port or portRange are set.

allow_global_access: pulumi.Output[bool] = None

If true, clients can access ILB from all regions. Otherwise only allows from the local region the ILB is located at.

backend_service: pulumi.Output[str] = None

A BackendService to receive the matched traffic. This is used only for INTERNAL load balancing.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

ip_address: pulumi.Output[str] = None

The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule’s load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address must be specified by a literal IP address. > NOTE: While the API allows you to specify various resource paths for an address resource instead, this provider requires this to specifically be an IP address to avoid needing to fetching the IP address from resource paths on refresh or unnecessary diffs.

ip_protocol: pulumi.Output[str] = None

The IP protocol to which this rule applies. When the load balancing scheme is INTERNAL, only TCP and UDP are valid.

is_mirroring_collector: pulumi.Output[bool] = None

Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL.

label_fingerprint: pulumi.Output[str] = None

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels: pulumi.Output[dict] = None

Labels to apply to this forwarding rule. A list of key->value pairs.

load_balancing_scheme: pulumi.Output[str] = None

This signifies what the ForwardingRule will be used for and can be EXTERNAL, INTERNAL, or INTERNAL_MANAGED. EXTERNAL is used for Classic Cloud VPN gateways, protocol forwarding to VMs from an external IP address, and HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP load balancers. INTERNAL is used for protocol forwarding to VMs from an internal IP address, and internal TCP/UDP load balancers. INTERNAL_MANAGED is used for internal HTTP(S) load balancers.

name: pulumi.Output[str] = None

Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

network: pulumi.Output[str] = None

For internal load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used. This field is only used for INTERNAL load balancing.

network_tier: pulumi.Output[str] = None

The networking tier used for configuring this address. If this field is not specified, it is assumed to be PREMIUM.

port_range: pulumi.Output[str] = None

This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:

  • TargetHttpProxy: 80, 8080

  • TargetHttpsProxy: 443

  • TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222

  • TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222

  • TargetVpnGateway: 500, 4500

ports: pulumi.Output[list] = None

This field is used along with the backend_service field for internal load balancing. When the load balancing scheme is INTERNAL, a single port or a comma separated list of ports can be configured. Only packets addressed to these ports will be forwarded to the backends configured with this forwarding rule. You may specify a maximum of up to 5 ports.

project: pulumi.Output[str] = None

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

region: pulumi.Output[str] = None

A reference to the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules.

The URI of the created resource.

service_label: pulumi.Output[str] = None

An optional prefix to the service name for this Forwarding Rule. If specified, will be the first label of the fully qualified service name. The label must be 1-63 characters long, and comply with RFC1035. Specifically, the label must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. This field is only used for INTERNAL load balancing.

service_name: pulumi.Output[str] = None

The internal fully qualified service name for this Forwarding Rule. This field is only used for INTERNAL load balancing.

subnetwork: pulumi.Output[str] = None

The subnetwork that the load balanced IP should belong to for this Forwarding Rule. This field is only used for INTERNAL load balancing. If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified.

target: pulumi.Output[str] = None

The URL of the target resource to receive the matched traffic. The target must live in the same region as the forwarding rule. The forwarded traffic must be of a type appropriate to the target object.

static get(resource_name, id, opts=None, all_ports=None, allow_global_access=None, backend_service=None, creation_timestamp=None, description=None, ip_address=None, ip_protocol=None, is_mirroring_collector=None, label_fingerprint=None, labels=None, load_balancing_scheme=None, name=None, network=None, network_tier=None, port_range=None, ports=None, project=None, region=None, self_link=None, service_label=None, service_name=None, subnetwork=None, target=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • all_ports (pulumi.Input[bool]) – For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL and protocol is TCP/UDP), set this to true to allow packets addressed to any ports to be forwarded to the backends configured with this forwarding rule. Used with backend service. Cannot be set if port or portRange are set.

  • allow_global_access (pulumi.Input[bool]) – If true, clients can access ILB from all regions. Otherwise only allows from the local region the ILB is located at.

  • backend_service (pulumi.Input[str]) – A BackendService to receive the matched traffic. This is used only for INTERNAL load balancing.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • ip_address (pulumi.Input[str]) – The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule’s load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address must be specified by a literal IP address. > NOTE: While the API allows you to specify various resource paths for an address resource instead, this provider requires this to specifically be an IP address to avoid needing to fetching the IP address from resource paths on refresh or unnecessary diffs.

  • ip_protocol (pulumi.Input[str]) – The IP protocol to which this rule applies. When the load balancing scheme is INTERNAL, only TCP and UDP are valid.

  • is_mirroring_collector (pulumi.Input[bool]) – Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL.

  • label_fingerprint (pulumi.Input[str]) – The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • labels (pulumi.Input[dict]) – Labels to apply to this forwarding rule. A list of key->value pairs.

  • load_balancing_scheme (pulumi.Input[str]) – This signifies what the ForwardingRule will be used for and can be EXTERNAL, INTERNAL, or INTERNAL_MANAGED. EXTERNAL is used for Classic Cloud VPN gateways, protocol forwarding to VMs from an external IP address, and HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP load balancers. INTERNAL is used for protocol forwarding to VMs from an internal IP address, and internal TCP/UDP load balancers. INTERNAL_MANAGED is used for internal HTTP(S) load balancers.

  • name (pulumi.Input[str]) – Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – For internal load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used. This field is only used for INTERNAL load balancing.

  • network_tier (pulumi.Input[str]) – The networking tier used for configuring this address. If this field is not specified, it is assumed to be PREMIUM.

  • port_range (pulumi.Input[str]) – This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:

* TargetHttpProxy: 80, 8080
* TargetHttpsProxy: 443
* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetVpnGateway: 500, 4500
Parameters
  • ports (pulumi.Input[list]) – This field is used along with the backend_service field for internal load balancing. When the load balancing scheme is INTERNAL, a single port or a comma separated list of ports can be configured. Only packets addressed to these ports will be forwarded to the backends configured with this forwarding rule. You may specify a maximum of up to 5 ports.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • region (pulumi.Input[str]) – A reference to the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • service_label (pulumi.Input[str]) – An optional prefix to the service name for this Forwarding Rule. If specified, will be the first label of the fully qualified service name. The label must be 1-63 characters long, and comply with RFC1035. Specifically, the label must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. This field is only used for INTERNAL load balancing.

  • service_name (pulumi.Input[str]) – The internal fully qualified service name for this Forwarding Rule. This field is only used for INTERNAL load balancing.

  • subnetwork (pulumi.Input[str]) – The subnetwork that the load balanced IP should belong to for this Forwarding Rule. This field is only used for INTERNAL load balancing. If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified.

  • target (pulumi.Input[str]) – The URL of the target resource to receive the matched traffic. The target must live in the same region as the forwarding rule. The forwarded traffic must be of a type appropriate to the target object.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.GetAddressResult(address=None, id=None, name=None, project=None, region=None, self_link=None, status=None)

A collection of values returned by getAddress.

address = None

The IP of the created resource.

id = None

The provider-assigned unique ID for this managed resource.

The URI of the created resource.

status = None

Indicates if the address is used. Possible values are: RESERVED or IN_USE.

class pulumi_gcp.compute.GetBackendBucketResult(bucket_name=None, cdn_policies=None, creation_timestamp=None, description=None, enable_cdn=None, id=None, name=None, project=None, self_link=None)

A collection of values returned by getBackendBucket.

bucket_name = None

Cloud Storage bucket name.

cdn_policies = None

Cloud CDN configuration for this Backend Bucket. Structure is documented below.

creation_timestamp = None

Creation timestamp in RFC3339 text format.

description = None

An optional textual description of the resource; provided by the client when the resource is created.

enable_cdn = None

Whether Cloud CDN is enabled for this BackendBucket.

id = None

The provider-assigned unique ID for this managed resource.

The URI of the created resource.

class pulumi_gcp.compute.GetBackendServiceResult(affinity_cookie_ttl_sec=None, backends=None, cdn_policies=None, circuit_breakers=None, connection_draining_timeout_sec=None, consistent_hash=None, creation_timestamp=None, custom_request_headers=None, description=None, enable_cdn=None, fingerprint=None, health_checks=None, iaps=None, id=None, load_balancing_scheme=None, locality_lb_policy=None, log_configs=None, name=None, outlier_detections=None, port_name=None, project=None, protocol=None, security_policy=None, self_link=None, session_affinity=None, timeout_sec=None)

A collection of values returned by getBackendService.

backends = None

The set of backends that serve this Backend Service.

connection_draining_timeout_sec = None

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

description = None

Textual description for the Backend Service.

enable_cdn = None

Whether or not Cloud CDN is enabled on the Backend Service.

fingerprint = None

The fingerprint of the Backend Service.

health_checks = None

The set of HTTP/HTTPS health checks used by the Backend Service.

id = None

The provider-assigned unique ID for this managed resource.

port_name = None

The name of a service that has been added to an instance group in this backend.

protocol = None

The protocol for incoming requests.

The URI of the Backend Service.

session_affinity = None

The Backend Service session stickiness configuration.

timeout_sec = None

The number of seconds to wait for a backend to respond to a request before considering the request failed.

class pulumi_gcp.compute.GetCertificateResult(certificate=None, certificate_id=None, creation_timestamp=None, description=None, id=None, name=None, name_prefix=None, private_key=None, project=None, self_link=None)

A collection of values returned by getCertificate.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_gcp.compute.GetDefaultServiceAccountResult(display_name=None, email=None, id=None, name=None, project=None, unique_id=None)

A collection of values returned by getDefaultServiceAccount.

display_name = None

The display name for the service account.

email = None

Email address of the default service account used by VMs running in this project

id = None

The provider-assigned unique ID for this managed resource.

name = None

The fully-qualified name of the service account.

unique_id = None

The unique id of the service account.

class pulumi_gcp.compute.GetForwardingRuleResult(backend_service=None, description=None, id=None, ip_address=None, ip_protocol=None, load_balancing_scheme=None, name=None, network=None, port_range=None, ports=None, project=None, region=None, self_link=None, subnetwork=None, target=None)

A collection of values returned by getForwardingRule.

backend_service = None

Backend service, if this forwarding rule has one.

description = None

Description of this forwarding rule.

id = None

The provider-assigned unique ID for this managed resource.

ip_address = None

IP address of this forwarding rule.

ip_protocol = None

IP protocol of this forwarding rule.

load_balancing_scheme = None

Type of load balancing of this forwarding rule.

network = None

Network of this forwarding rule.

port_range = None

Port range, if this forwarding rule has one.

ports = None

List of ports to use for internal load balancing, if this forwarding rule has any.

region = None

Region of this forwarding rule.

The URI of the resource.

subnetwork = None

Subnetwork of this forwarding rule.

target = None

URL of the target pool, if this forwarding rule has one.

class pulumi_gcp.compute.GetGlobalAddressResult(address=None, id=None, name=None, project=None, self_link=None, status=None)

A collection of values returned by getGlobalAddress.

address = None

The IP of the created resource.

id = None

The provider-assigned unique ID for this managed resource.

The URI of the created resource.

status = None

Indicates if the address is used. Possible values are: RESERVED or IN_USE.

class pulumi_gcp.compute.GetImageResult(archive_size_bytes=None, creation_timestamp=None, description=None, disk_size_gb=None, family=None, id=None, image_encryption_key_sha256=None, image_id=None, label_fingerprint=None, labels=None, licenses=None, name=None, project=None, self_link=None, source_disk=None, source_disk_encryption_key_sha256=None, source_disk_id=None, source_image_id=None, status=None)

A collection of values returned by getImage.

archive_size_bytes = None

The size of the image tar.gz archive stored in Google Cloud Storage in bytes.

creation_timestamp = None

The creation timestamp in RFC3339 text format.

description = None

An optional description of this image.

disk_size_gb = None

The size of the image when restored onto a persistent disk in gigabytes.

family = None

The family name of the image.

id = None

The provider-assigned unique ID for this managed resource.

image_encryption_key_sha256 = None

The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this image.

image_id = None

The unique identifier for the image.

label_fingerprint = None

A fingerprint for the labels being applied to this image.

labels = None

A map of labels applied to this image.

licenses = None

A list of applicable license URI.

name = None

The name of the image.

The URI of the image.

source_disk = None

The URL of the source disk used to create this image.

source_disk_encryption_key_sha256 = None

The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this image.

source_disk_id = None

The ID value of the disk used to create this image.

source_image_id = None

The ID value of the image used to create this image.

status = None

The status of the image. Possible values are FAILED, PENDING, or READY.

class pulumi_gcp.compute.GetInstanceGroupResult(description=None, id=None, instances=None, name=None, named_ports=None, network=None, project=None, self_link=None, size=None, zone=None)

A collection of values returned by getInstanceGroup.

description = None

Textual description of the instance group.

id = None

The provider-assigned unique ID for this managed resource.

instances = None

List of instances in the group.

named_ports = None

List of named ports in the group.

network = None

The URL of the network the instance group is in.

The URI of the resource.

size = None

The number of instances in the group.

class pulumi_gcp.compute.GetInstanceResult(allow_stopping_for_update=None, attached_disks=None, boot_disks=None, can_ip_forward=None, cpu_platform=None, current_status=None, deletion_protection=None, description=None, desired_status=None, enable_display=None, guest_accelerators=None, hostname=None, id=None, instance_id=None, label_fingerprint=None, labels=None, machine_type=None, metadata=None, metadata_fingerprint=None, metadata_startup_script=None, min_cpu_platform=None, name=None, network_interfaces=None, project=None, resource_policies=None, schedulings=None, scratch_disks=None, self_link=None, service_accounts=None, shielded_instance_configs=None, tags=None, tags_fingerprint=None, zone=None)

A collection of values returned by getInstance.

attached_disks = None

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

boot_disks = None

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

can_ip_forward = None

Whether sending and receiving of packets with non-matching source or destination IPs is allowed.

cpu_platform = None

The CPU platform used by this instance.

deletion_protection = None

Whether deletion protection is enabled on this instance.

description = None

A brief description of the resource.

guest_accelerators = None

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

id = None

The provider-assigned unique ID for this managed resource.

instance_id = None

The server-assigned unique identifier of this instance.

label_fingerprint = None

The unique fingerprint of the labels.

labels = None

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

machine_type = None

The machine type to create.

metadata = None

Metadata key/value pairs made available within the instance.

metadata_fingerprint = None

The unique fingerprint of the metadata.

min_cpu_platform = None

The minimum CPU platform specified for the VM instance.

network_interfaces = None

The networks attached to the instance. Structure is documented below.

schedulings = None

The scheduling strategy being used by the instance.

scratch_disks = None

The scratch disks attached to the instance. Structure is documented below.

The URI of the created resource.

service_accounts = None

The service account to attach to the instance. Structure is documented below.

shielded_instance_configs = None

The shielded vm config being used by the instance. Structure is documented below.

tags = None

The list of tags attached to the instance.

tags_fingerprint = None

The unique fingerprint of the tags.

class pulumi_gcp.compute.GetInstanceSerialPortResult(contents=None, id=None, instance=None, port=None, project=None, zone=None)

A collection of values returned by getInstanceSerialPort.

contents = None

The output of the serial port. Serial port output is available only when the VM instance is running, and logs are limited to the most recent 1 MB of output per port.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_gcp.compute.GetLBIPRangesResult(http_ssl_tcp_internals=None, id=None, networks=None)

A collection of values returned by getLBIPRanges.

http_ssl_tcp_internals = None

The IP ranges used for health checks when HTTP(S), SSL proxy, TCP proxy, and Internal load balancing is used

id = None

The provider-assigned unique ID for this managed resource.

networks = None

The IP ranges used for health checks when Network load balancing is used

class pulumi_gcp.compute.GetNetblockIPRangesResult(cidr_blocks=None, cidr_blocks_ipv4s=None, cidr_blocks_ipv6s=None, id=None, range_type=None)

A collection of values returned by getNetblockIPRanges.

cidr_blocks = None

Retrieve list of all CIDR blocks.

cidr_blocks_ipv4s = None

Retrieve list of the IPv4 CIDR blocks

cidr_blocks_ipv6s = None

Retrieve list of the IPv6 CIDR blocks, if available.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_gcp.compute.GetNetworkEndpointGroupResult(default_port=None, description=None, id=None, name=None, network=None, network_endpoint_type=None, project=None, self_link=None, size=None, subnetwork=None, zone=None)

A collection of values returned by getNetworkEndpointGroup.

default_port = None

The NEG default port.

description = None

The NEG description.

id = None

The provider-assigned unique ID for this managed resource.

network = None

The network to which all network endpoints in the NEG belong.

network_endpoint_type = None

Type of network endpoints in this network endpoint group.

size = None

Number of network endpoints in the network endpoint group.

subnetwork = None

subnetwork to which all network endpoints in the NEG belong.

class pulumi_gcp.compute.GetNetworkResult(description=None, gateway_ipv4=None, id=None, name=None, project=None, self_link=None, subnetworks_self_links=None)

A collection of values returned by getNetwork.

description = None

Description of this network.

gateway_ipv4 = None

The IP address of the gateway.

id = None

The provider-assigned unique ID for this managed resource.

The URI of the resource.

the list of subnetworks which belong to the network

class pulumi_gcp.compute.GetNodeTypesResult(id=None, names=None, project=None, zone=None)

A collection of values returned by getNodeTypes.

id = None

The provider-assigned unique ID for this managed resource.

names = None

A list of node types available in the given zone and project.

class pulumi_gcp.compute.GetRegionInstanceGroupResult(id=None, instances=None, name=None, project=None, region=None, self_link=None, size=None)

A collection of values returned by getRegionInstanceGroup.

id = None

The provider-assigned unique ID for this managed resource.

instances = None

List of instances in the group, as a list of resources, each containing:

name = None

String port name

size = None

The number of instances in the group.

class pulumi_gcp.compute.GetRegionsResult(id=None, names=None, project=None, status=None)

A collection of values returned by getRegions.

id = None

The provider-assigned unique ID for this managed resource.

names = None

A list of regions available in the given project

class pulumi_gcp.compute.GetResourcePolicyResult(description=None, id=None, name=None, project=None, region=None, self_link=None)

A collection of values returned by getResourcePolicy.

description = None

Description of this Resource Policy.

id = None

The provider-assigned unique ID for this managed resource.

The URI of the resource.

class pulumi_gcp.compute.GetRouterResult(bgps=None, creation_timestamp=None, description=None, id=None, name=None, network=None, project=None, region=None, self_link=None)

A collection of values returned by getRouter.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_gcp.compute.GetSSLPolicyResult(creation_timestamp=None, custom_features=None, description=None, enabled_features=None, fingerprint=None, id=None, min_tls_version=None, name=None, profile=None, project=None, self_link=None)

A collection of values returned by getSSLPolicy.

custom_features = None

If the profile is CUSTOM, these are the custom encryption ciphers supported by the profile. If the profile is not CUSTOM, this attribute will be empty.

description = None

Description of this SSL Policy.

enabled_features = None

The set of enabled encryption ciphers as a result of the policy config

fingerprint = None

Fingerprint of this resource.

id = None

The provider-assigned unique ID for this managed resource.

min_tls_version = None

The minimum supported TLS version of this policy.

profile = None

The Google-curated or custom profile used by this policy.

The URI of the created resource.

class pulumi_gcp.compute.GetSubnetworkResult(description=None, gateway_address=None, id=None, ip_cidr_range=None, name=None, network=None, private_ip_google_access=None, project=None, region=None, secondary_ip_ranges=None, self_link=None)

A collection of values returned by getSubnetwork.

description = None

Description of this subnetwork.

gateway_address = None

The IP address of the gateway.

id = None

The provider-assigned unique ID for this managed resource.

ip_cidr_range = None

The range of IP addresses belonging to this subnetwork secondary range.

network = None

The network name or resource link to the parent network of this subnetwork.

private_ip_google_access = None

Whether the VMs in this subnet can access Google services without assigned external IP addresses.

secondary_ip_ranges = None

An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. Structure is documented below.

class pulumi_gcp.compute.GetVPNGatewayResult(description=None, id=None, name=None, network=None, project=None, region=None, self_link=None)

A collection of values returned by getVPNGateway.

description = None

Description of this VPN gateway.

id = None

The provider-assigned unique ID for this managed resource.

network = None

The network of this VPN gateway.

region = None

Region of this VPN gateway.

The URI of the resource.

class pulumi_gcp.compute.GetZonesResult(id=None, names=None, project=None, region=None, status=None)

A collection of values returned by getZones.

id = None

The provider-assigned unique ID for this managed resource.

names = None

A list of zones available in the given region

class pulumi_gcp.compute.GlobalAddress(resource_name, opts=None, address=None, address_type=None, description=None, ip_version=None, labels=None, name=None, network=None, prefix_length=None, project=None, purpose=None, __props__=None, __name__=None, __opts__=None)

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

To get more information about GlobalAddress, see:

import pulumi
import pulumi_gcp as gcp

default = gcp.compute.GlobalAddress("default")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • address (pulumi.Input[str]) – The IP address or beginning of the address range represented by this resource. This can be supplied as an input to reserve a specific address or omitted to allow GCP to choose a valid one for you.

  • address_type (pulumi.Input[str]) – The type of the address to reserve.

* EXTERNAL indicates public/external single IP address.
* INTERNAL indicates internal IP ranges belonging to some network.
Parameters
  • description (pulumi.Input[str]) – An optional description of this resource.

  • ip_version (pulumi.Input[str]) – The IP Version that will be used by this address. The default value is IPV4.

  • labels (pulumi.Input[dict]) – Labels to apply to this address. A list of key->value pairs.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – The URL of the network in which to reserve the IP range. The IP range must be in RFC1918 space. The network cannot be deleted if there are any reserved IP ranges referring to it. This should only be set when using an Internal address.

  • prefix_length (pulumi.Input[float]) – The prefix length of the IP range. If not present, it means the address field is a single IP address. This field is not applicable to addresses with addressType=EXTERNAL.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • purpose (pulumi.Input[str]) – The purpose of the resource. For global internal addresses it can be

* VPC_PEERING - for peer networks
This should only be set when using an Internal address.
address: pulumi.Output[str] = None

The IP address or beginning of the address range represented by this resource. This can be supplied as an input to reserve a specific address or omitted to allow GCP to choose a valid one for you.

address_type: pulumi.Output[str] = None

The type of the address to reserve.

  • EXTERNAL indicates public/external single IP address.

  • INTERNAL indicates internal IP ranges belonging to some network.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource.

ip_version: pulumi.Output[str] = None

The IP Version that will be used by this address. The default value is IPV4.

label_fingerprint: pulumi.Output[str] = None

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels: pulumi.Output[dict] = None

Labels to apply to this address. A list of key->value pairs.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

network: pulumi.Output[str] = None

The URL of the network in which to reserve the IP range. The IP range must be in RFC1918 space. The network cannot be deleted if there are any reserved IP ranges referring to it. This should only be set when using an Internal address.

prefix_length: pulumi.Output[float] = None

The prefix length of the IP range. If not present, it means the address field is a single IP address. This field is not applicable to addresses with addressType=EXTERNAL.

project: pulumi.Output[str] = None

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

purpose: pulumi.Output[str] = None

The purpose of the resource. For global internal addresses it can be

  • VPC_PEERING - for peer networks This should only be set when using an Internal address.

The URI of the created resource.

static get(resource_name, id, opts=None, address=None, address_type=None, creation_timestamp=None, description=None, ip_version=None, label_fingerprint=None, labels=None, name=None, network=None, prefix_length=None, project=None, purpose=None, self_link=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • address (pulumi.Input[str]) – The IP address or beginning of the address range represented by this resource. This can be supplied as an input to reserve a specific address or omitted to allow GCP to choose a valid one for you.

  • address_type (pulumi.Input[str]) – The type of the address to reserve.

* EXTERNAL indicates public/external single IP address.
* INTERNAL indicates internal IP ranges belonging to some network.
Parameters
  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • ip_version (pulumi.Input[str]) – The IP Version that will be used by this address. The default value is IPV4.

  • label_fingerprint (pulumi.Input[str]) – The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • labels (pulumi.Input[dict]) – Labels to apply to this address. A list of key->value pairs.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – The URL of the network in which to reserve the IP range. The IP range must be in RFC1918 space. The network cannot be deleted if there are any reserved IP ranges referring to it. This should only be set when using an Internal address.

  • prefix_length (pulumi.Input[float]) – The prefix length of the IP range. If not present, it means the address field is a single IP address. This field is not applicable to addresses with addressType=EXTERNAL.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • purpose (pulumi.Input[str]) – The purpose of the resource. For global internal addresses it can be

* VPC_PEERING - for peer networks
This should only be set when using an Internal address.
Parameters

self_link (pulumi.Input[str]) – The URI of the created resource.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.GlobalForwardingRule(resource_name, opts=None, description=None, ip_address=None, ip_protocol=None, ip_version=None, labels=None, load_balancing_scheme=None, metadata_filters=None, name=None, network=None, port_range=None, project=None, target=None, __props__=None, __name__=None, __opts__=None)

Represents a GlobalForwardingRule resource. Global forwarding rules are used to forward traffic to the correct load balancer for HTTP load balancing. Global forwarding rules can only be used for HTTP load balancing.

For more information, see https://cloud.google.com/compute/docs/load-balancing/http/

import pulumi
import pulumi_gcp as gcp

default_http_health_check = gcp.compute.HttpHealthCheck("defaultHttpHealthCheck",
    request_path="/",
    check_interval_sec=1,
    timeout_sec=1)
default_backend_service = gcp.compute.BackendService("defaultBackendService",
    port_name="http",
    protocol="HTTP",
    timeout_sec=10,
    health_checks=[default_http_health_check.id])
default_url_map = gcp.compute.URLMap("defaultURLMap",
    description="a description",
    default_service=default_backend_service.id,
    host_rule=[{
        "hosts": ["mysite.com"],
        "pathMatcher": "allpaths",
    }],
    path_matcher=[{
        "name": "allpaths",
        "default_service": default_backend_service.id,
        "path_rule": [{
            "paths": ["/*"],
            "service": default_backend_service.id,
        }],
    }])
default_target_http_proxy = gcp.compute.TargetHttpProxy("defaultTargetHttpProxy",
    description="a description",
    url_map=default_url_map.id)
default_global_forwarding_rule = gcp.compute.GlobalForwardingRule("defaultGlobalForwardingRule",
    target=default_target_http_proxy.id,
    port_range="80")
import pulumi
import pulumi_gcp as gcp

debian_image = gcp.compute.get_image(family="debian-9",
    project="debian-cloud")
instance_template = gcp.compute.InstanceTemplate("instanceTemplate",
    machine_type="n1-standard-1",
    network_interface=[{
        "network": "default",
    }],
    disk=[{
        "sourceImage": debian_image.self_link,
        "autoDelete": True,
        "boot": True,
    }])
igm = gcp.compute.InstanceGroupManager("igm",
    version=[{
        "instanceTemplate": instance_template.id,
        "name": "primary",
    }],
    base_instance_name="internal-glb",
    zone="us-central1-f",
    target_size=1)
default_health_check = gcp.compute.HealthCheck("defaultHealthCheck",
    check_interval_sec=1,
    timeout_sec=1,
    tcp_health_check={
        "port": "80",
    })
default_backend_service = gcp.compute.BackendService("defaultBackendService",
    port_name="http",
    protocol="HTTP",
    timeout_sec=10,
    load_balancing_scheme="INTERNAL_SELF_MANAGED",
    backend=[{
        "group": igm.instance_group,
        "balancingMode": "RATE",
        "capacityScaler": 0.4,
        "maxRatePerInstance": 50,
    }],
    health_checks=[default_health_check.id])
default_url_map = gcp.compute.URLMap("defaultURLMap",
    description="a description",
    default_service=default_backend_service.id,
    host_rule=[{
        "hosts": ["mysite.com"],
        "pathMatcher": "allpaths",
    }],
    path_matcher=[{
        "name": "allpaths",
        "default_service": default_backend_service.id,
        "path_rule": [{
            "paths": ["/*"],
            "service": default_backend_service.id,
        }],
    }])
default_target_http_proxy = gcp.compute.TargetHttpProxy("defaultTargetHttpProxy",
    description="a description",
    url_map=default_url_map.id)
default_global_forwarding_rule = gcp.compute.GlobalForwardingRule("defaultGlobalForwardingRule",
    target=default_target_http_proxy.id,
    port_range="80",
    load_balancing_scheme="INTERNAL_SELF_MANAGED",
    ip_address="0.0.0.0",
    metadata_filters=[{
        "filterMatchCriteria": "MATCH_ANY",
        "filter_labels": [{
            "name": "PLANET",
            "value": "MARS",
        }],
    }])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • ip_address (pulumi.Input[str]) – The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule’s load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address must be specified by a literal IP address. > NOTE: While the API allows you to specify various resource paths for an address resource instead, this provider requires this to specifically be an IP address to avoid needing to fetching the IP address from resource paths on refresh or unnecessary diffs.

  • ip_protocol (pulumi.Input[str]) – The IP protocol to which this rule applies. When the load balancing scheme is INTERNAL_SELF_MANAGED, only TCP is valid.

  • ip_version (pulumi.Input[str]) – The IP Version that will be used by this global forwarding rule.

  • labels (pulumi.Input[dict]) – Labels to apply to this forwarding rule. A list of key->value pairs.

  • load_balancing_scheme (pulumi.Input[str]) – This signifies what the GlobalForwardingRule will be used for. The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) NOTE: Currently global forwarding rules cannot be used for INTERNAL load balancing.

  • metadata_filters (pulumi.Input[list]) – Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels in the provided metadata. metadataFilters specified here can be overridden by those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the metadata label. The length must be between 1 and 1024 characters, inclusive.

  • network (pulumi.Input[str]) – This field is not used for external load balancing. For INTERNAL_SELF_MANAGED load balancing, this field identifies the network that the load balanced IP should belong to for this global forwarding rule. If this field is not specified, the default network will be used.

  • port_range (pulumi.Input[str]) – This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:

* TargetHttpProxy: 80, 8080
* TargetHttpsProxy: 443
* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetVpnGateway: 500, 4500
Parameters
  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • target (pulumi.Input[str]) – The URL of the target resource to receive the matched traffic. The forwarded traffic must be of a type appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid.

The metadata_filters object supports the following:

  • filterLabels (pulumi.Input[list]) - The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. Structure is documented below.

    • name (pulumi.Input[str]) - Name of the metadata label. The length must be between 1 and 1024 characters, inclusive.

    • value (pulumi.Input[str]) - The value that the label must match. The value has a maximum length of 1024 characters.

  • filterMatchCriteria (pulumi.Input[str]) - Specifies how individual filterLabel matches within the list of filterLabels contribute towards the overall metadataFilter match. MATCH_ANY - At least one of the filterLabels must have a matching label in the provided metadata. MATCH_ALL - All filterLabels must have matching labels in the provided metadata.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

ip_address: pulumi.Output[str] = None

The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule’s load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address must be specified by a literal IP address. > NOTE: While the API allows you to specify various resource paths for an address resource instead, this provider requires this to specifically be an IP address to avoid needing to fetching the IP address from resource paths on refresh or unnecessary diffs.

ip_protocol: pulumi.Output[str] = None

The IP protocol to which this rule applies. When the load balancing scheme is INTERNAL_SELF_MANAGED, only TCP is valid.

ip_version: pulumi.Output[str] = None

The IP Version that will be used by this global forwarding rule.

label_fingerprint: pulumi.Output[str] = None

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels: pulumi.Output[dict] = None

Labels to apply to this forwarding rule. A list of key->value pairs.

load_balancing_scheme: pulumi.Output[str] = None

This signifies what the GlobalForwardingRule will be used for. The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) NOTE: Currently global forwarding rules cannot be used for INTERNAL load balancing.

metadata_filters: pulumi.Output[list] = None

Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels in the provided metadata. metadataFilters specified here can be overridden by those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • filterLabels (list) - The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. Structure is documented below.

    • name (str) - Name of the metadata label. The length must be between 1 and 1024 characters, inclusive.

    • value (str) - The value that the label must match. The value has a maximum length of 1024 characters.

  • filterMatchCriteria (str) - Specifies how individual filterLabel matches within the list of filterLabels contribute towards the overall metadataFilter match. MATCH_ANY - At least one of the filterLabels must have a matching label in the provided metadata. MATCH_ALL - All filterLabels must have matching labels in the provided metadata.

name: pulumi.Output[str] = None

Name of the metadata label. The length must be between 1 and 1024 characters, inclusive.

network: pulumi.Output[str] = None

This field is not used for external load balancing. For INTERNAL_SELF_MANAGED load balancing, this field identifies the network that the load balanced IP should belong to for this global forwarding rule. If this field is not specified, the default network will be used.

port_range: pulumi.Output[str] = None

This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:

  • TargetHttpProxy: 80, 8080

  • TargetHttpsProxy: 443

  • TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222

  • TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222

  • TargetVpnGateway: 500, 4500

project: pulumi.Output[str] = None

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

The URI of the created resource.

target: pulumi.Output[str] = None

The URL of the target resource to receive the matched traffic. The forwarded traffic must be of a type appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid.

static get(resource_name, id, opts=None, description=None, ip_address=None, ip_protocol=None, ip_version=None, label_fingerprint=None, labels=None, load_balancing_scheme=None, metadata_filters=None, name=None, network=None, port_range=None, project=None, self_link=None, target=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • ip_address (pulumi.Input[str]) – The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule’s load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address must be specified by a literal IP address. > NOTE: While the API allows you to specify various resource paths for an address resource instead, this provider requires this to specifically be an IP address to avoid needing to fetching the IP address from resource paths on refresh or unnecessary diffs.

  • ip_protocol (pulumi.Input[str]) – The IP protocol to which this rule applies. When the load balancing scheme is INTERNAL_SELF_MANAGED, only TCP is valid.

  • ip_version (pulumi.Input[str]) – The IP Version that will be used by this global forwarding rule.

  • label_fingerprint (pulumi.Input[str]) – The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • labels (pulumi.Input[dict]) – Labels to apply to this forwarding rule. A list of key->value pairs.

  • load_balancing_scheme (pulumi.Input[str]) – This signifies what the GlobalForwardingRule will be used for. The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) NOTE: Currently global forwarding rules cannot be used for INTERNAL load balancing.

  • metadata_filters (pulumi.Input[list]) – Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels in the provided metadata. metadataFilters specified here can be overridden by those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the metadata label. The length must be between 1 and 1024 characters, inclusive.

  • network (pulumi.Input[str]) – This field is not used for external load balancing. For INTERNAL_SELF_MANAGED load balancing, this field identifies the network that the load balanced IP should belong to for this global forwarding rule. If this field is not specified, the default network will be used.

  • port_range (pulumi.Input[str]) – This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:

* TargetHttpProxy: 80, 8080
* TargetHttpsProxy: 443
* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
1883, 5222
* TargetVpnGateway: 500, 4500
Parameters
  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • target (pulumi.Input[str]) – The URL of the target resource to receive the matched traffic. The forwarded traffic must be of a type appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid.

The metadata_filters object supports the following:

  • filterLabels (pulumi.Input[list]) - The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. Structure is documented below.

    • name (pulumi.Input[str]) - Name of the metadata label. The length must be between 1 and 1024 characters, inclusive.

    • value (pulumi.Input[str]) - The value that the label must match. The value has a maximum length of 1024 characters.

  • filterMatchCriteria (pulumi.Input[str]) - Specifies how individual filterLabel matches within the list of filterLabels contribute towards the overall metadataFilter match. MATCH_ANY - At least one of the filterLabels must have a matching label in the provided metadata. MATCH_ALL - All filterLabels must have matching labels in the provided metadata.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.GlobalNetworkEndpoint(resource_name, opts=None, fqdn=None, global_network_endpoint_group=None, ip_address=None, port=None, project=None, __props__=None, __name__=None, __opts__=None)

A Global Network endpoint represents a IP address and port combination that exists outside of GCP. NOTE: Global network endpoints cannot be created outside of a global network endpoint group.

To get more information about GlobalNetworkEndpoint, see:

import pulumi
import pulumi_gcp as gcp

default_endpoint = gcp.compute.GlobalNetworkEndpoint("default-endpoint",
    global_network_endpoint_group=google_compute_network_endpoint_group["neg"]["name"],
    fqdn="www.example.com",
    port=google_compute_network_endpoint_group["neg"]["default_port"],
    ip_address=google_compute_instance["endpoint-instance"]["network_interface"][0]["network_ip"])
default = gcp.compute.Network("default", auto_create_subnetworks=False)
group = gcp.compute.GlobalNetworkEndpointGroup("group",
    network=default.id,
    default_port="90")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • fqdn (pulumi.Input[str]) – Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.

  • global_network_endpoint_group (pulumi.Input[str]) – The global network endpoint group this endpoint is part of.

  • ip_address (pulumi.Input[str]) – IPv4 address external endpoint.

  • port (pulumi.Input[float]) – Port number of the external endpoint.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

fqdn: pulumi.Output[str] = None

Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.

global_network_endpoint_group: pulumi.Output[str] = None

The global network endpoint group this endpoint is part of.

ip_address: pulumi.Output[str] = None

IPv4 address external endpoint.

port: pulumi.Output[float] = None

Port number of the external endpoint.

project: pulumi.Output[str] = None

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

static get(resource_name, id, opts=None, fqdn=None, global_network_endpoint_group=None, ip_address=None, port=None, project=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • fqdn (pulumi.Input[str]) – Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.

  • global_network_endpoint_group (pulumi.Input[str]) – The global network endpoint group this endpoint is part of.

  • ip_address (pulumi.Input[str]) – IPv4 address external endpoint.

  • port (pulumi.Input[float]) – Port number of the external endpoint.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.GlobalNetworkEndpointGroup(resource_name, opts=None, default_port=None, description=None, name=None, network_endpoint_type=None, project=None, __props__=None, __name__=None, __opts__=None)

A global network endpoint group contains endpoints that reside outside of Google Cloud. Currently a global network endpoint group can only support a single endpoint.

To get more information about GlobalNetworkEndpointGroup, see:

import pulumi
import pulumi_gcp as gcp

neg = gcp.compute.GlobalNetworkEndpointGroup("neg",
    default_port="90",
    network_endpoint_type="INTERNET_FQDN_PORT")
import pulumi
import pulumi_gcp as gcp

neg = gcp.compute.GlobalNetworkEndpointGroup("neg",
    default_port=90,
    network_endpoint_type="INTERNET_IP_PORT")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • default_port (pulumi.Input[float]) – The default port used if the port number is not specified in the network endpoint.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • name (pulumi.Input[str]) – Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network_endpoint_type (pulumi.Input[str]) – Type of network endpoints in this network endpoint group.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

default_port: pulumi.Output[float] = None

The default port used if the port number is not specified in the network endpoint.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

name: pulumi.Output[str] = None

Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

network_endpoint_type: pulumi.Output[str] = None

Type of network endpoints in this network endpoint group.

project: pulumi.Output[str] = None

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

The URI of the created resource.

static get(resource_name, id, opts=None, default_port=None, description=None, name=None, network_endpoint_type=None, project=None, self_link=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • default_port (pulumi.Input[float]) – The default port used if the port number is not specified in the network endpoint.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • name (pulumi.Input[str]) – Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network_endpoint_type (pulumi.Input[str]) – Type of network endpoints in this network endpoint group.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.HaVpnGateway(resource_name, opts=None, description=None, name=None, network=None, project=None, region=None, __props__=None, __name__=None, __opts__=None)

Represents a VPN gateway running in GCP. This virtual device is managed by Google, but used only by you. This type of VPN Gateway allows for the creation of VPN solutions with higher availability than classic Target VPN Gateways.

To get more information about HaVpnGateway, see:

import pulumi
import pulumi_gcp as gcp

network1 = gcp.compute.Network("network1", auto_create_subnetworks=False)
ha_gateway1 = gcp.compute.HaVpnGateway("haGateway1",
    region="us-central1",
    network=network1.id)
import pulumi
import pulumi_gcp as gcp

network1 = gcp.compute.Network("network1",
    routing_mode="GLOBAL",
    auto_create_subnetworks=False)
ha_gateway1 = gcp.compute.HaVpnGateway("haGateway1",
    region="us-central1",
    network=network1.id)
network2 = gcp.compute.Network("network2",
    routing_mode="GLOBAL",
    auto_create_subnetworks=False)
ha_gateway2 = gcp.compute.HaVpnGateway("haGateway2",
    region="us-central1",
    network=network2.id)
network1_subnet1 = gcp.compute.Subnetwork("network1Subnet1",
    ip_cidr_range="10.0.1.0/24",
    region="us-central1",
    network=network1.id)
network1_subnet2 = gcp.compute.Subnetwork("network1Subnet2",
    ip_cidr_range="10.0.2.0/24",
    region="us-west1",
    network=network1.id)
network2_subnet1 = gcp.compute.Subnetwork("network2Subnet1",
    ip_cidr_range="192.168.1.0/24",
    region="us-central1",
    network=network2.id)
network2_subnet2 = gcp.compute.Subnetwork("network2Subnet2",
    ip_cidr_range="192.168.2.0/24",
    region="us-east1",
    network=network2.id)
router1 = gcp.compute.Router("router1",
    network=network1.name,
    bgp={
        "asn": 64514,
    })
router2 = gcp.compute.Router("router2",
    network=network2.name,
    bgp={
        "asn": 64515,
    })
tunnel1 = gcp.compute.VPNTunnel("tunnel1",
    region="us-central1",
    vpn_gateway=ha_gateway1.id,
    peer_gcp_gateway=ha_gateway2.id,
    shared_secret="a secret message",
    router=router1.id,
    vpn_gateway_interface=0)
tunnel2 = gcp.compute.VPNTunnel("tunnel2",
    region="us-central1",
    vpn_gateway=ha_gateway1.id,
    peer_gcp_gateway=ha_gateway2.id,
    shared_secret="a secret message",
    router=router1.id,
    vpn_gateway_interface=1)
tunnel3 = gcp.compute.VPNTunnel("tunnel3",
    region="us-central1",
    vpn_gateway=ha_gateway2.id,
    peer_gcp_gateway=ha_gateway1.id,
    shared_secret="a secret message",
    router=router2.id,
    vpn_gateway_interface=0)
tunnel4 = gcp.compute.VPNTunnel("tunnel4",
    region="us-central1",
    vpn_gateway=ha_gateway2.id,
    peer_gcp_gateway=ha_gateway1.id,
    shared_secret="a secret message",
    router=router2.id,
    vpn_gateway_interface=1)
router1_interface1 = gcp.compute.RouterInterface("router1Interface1",
    router=router1.name,
    region="us-central1",
    ip_range="169.254.0.1/30",
    vpn_tunnel=tunnel1.name)
router1_peer1 = gcp.compute.RouterPeer("router1Peer1",
    router=router1.name,
    region="us-central1",
    peer_ip_address="169.254.0.2",
    peer_asn=64515,
    advertised_route_priority=100,
    interface=router1_interface1.name)
router1_interface2 = gcp.compute.RouterInterface("router1Interface2",
    router=router1.name,
    region="us-central1",
    ip_range="169.254.1.1/30",
    vpn_tunnel=tunnel2.name)
router1_peer2 = gcp.compute.RouterPeer("router1Peer2",
    router=router1.name,
    region="us-central1",
    peer_ip_address="169.254.1.2",
    peer_asn=64515,
    advertised_route_priority=100,
    interface=router1_interface2.name)
router2_interface1 = gcp.compute.RouterInterface("router2Interface1",
    router=router2.name,
    region="us-central1",
    ip_range="169.254.0.1/30",
    vpn_tunnel=tunnel3.name)
router2_peer1 = gcp.compute.RouterPeer("router2Peer1",
    router=router2.name,
    region="us-central1",
    peer_ip_address="169.254.0.2",
    peer_asn=64514,
    advertised_route_priority=100,
    interface=router2_interface1.name)
router2_interface2 = gcp.compute.RouterInterface("router2Interface2",
    router=router2.name,
    region="us-central1",
    ip_range="169.254.1.1/30",
    vpn_tunnel=tunnel4.name)
router2_peer2 = gcp.compute.RouterPeer("router2Peer2",
    router=router2.name,
    region="us-central1",
    peer_ip_address="169.254.1.2",
    peer_asn=64514,
    advertised_route_priority=100,
    interface=router2_interface2.name)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – The network this VPN gateway is accepting traffic for.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • region (pulumi.Input[str]) – The region this gateway should sit in.

description: pulumi.Output[str] = None

An optional description of this resource.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

network: pulumi.Output[str] = None

The network this VPN gateway is accepting traffic for.

project: pulumi.Output[str] = None

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

region: pulumi.Output[str] = None

The region this gateway should sit in.

The URI of the created resource.

vpn_interfaces: pulumi.Output[list] = None

A list of interfaces on this VPN gateway.

  • id (float) - an identifier for the resource with format projects/{{project}}/regions/{{region}}/vpnGateways/{{name}}

  • ip_address (str)

static get(resource_name, id, opts=None, description=None, name=None, network=None, project=None, region=None, self_link=None, vpn_interfaces=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • network (pulumi.Input[str]) – The network this VPN gateway is accepting traffic for.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • region (pulumi.Input[str]) – The region this gateway should sit in.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • vpn_interfaces (pulumi.Input[list]) – A list of interfaces on this VPN gateway.

The vpn_interfaces object supports the following:

  • id (pulumi.Input[float]) - an identifier for the resource with format projects/{{project}}/regions/{{region}}/vpnGateways/{{name}}

  • ip_address (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.HealthCheck(resource_name, opts=None, check_interval_sec=None, description=None, healthy_threshold=None, http2_health_check=None, http_health_check=None, https_health_check=None, log_config=None, name=None, project=None, ssl_health_check=None, tcp_health_check=None, timeout_sec=None, unhealthy_threshold=None, __props__=None, __name__=None, __opts__=None)

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:

import pulumi
import pulumi_gcp as gcp

tcp_health_check = gcp.compute.HealthCheck("tcp-health-check",
    check_interval_sec=1,
    tcp_health_check={
        "port": "80",
    },
    timeout_sec=1)
import pulumi
import pulumi_gcp as gcp

tcp_health_check = gcp.compute.HealthCheck("tcp-health-check",
    check_interval_sec=1,
    description="Health check via tcp",
    healthy_threshold=4,
    tcp_health_check={
        "port_name": "health-check-port",
        "portSpecification": "USE_NAMED_PORT",
        "proxy_header": "NONE",
        "request": "ARE YOU HEALTHY?",
        "response": "I AM HEALTHY",
    },
    timeout_sec=1,
    unhealthy_threshold=5)
import pulumi
import pulumi_gcp as gcp

ssl_health_check = gcp.compute.HealthCheck("ssl-health-check",
    check_interval_sec=1,
    ssl_health_check={
        "port": "443",
    },
    timeout_sec=1)
import pulumi
import pulumi_gcp as gcp

ssl_health_check = gcp.compute.HealthCheck("ssl-health-check",
    check_interval_sec=1,
    description="Health check via ssl",
    healthy_threshold=4,
    ssl_health_check={
        "port_name": "health-check-port",
        "portSpecification": "USE_NAMED_PORT",
        "proxy_header": "NONE",
        "request": "ARE YOU HEALTHY?",
        "response": "I AM HEALTHY",
    },
    timeout_sec=1,
    unhealthy_threshold=5)
import pulumi
import pulumi_gcp as gcp

http_health_check = gcp.compute.HealthCheck("http-health-check",
    check_interval_sec=1,
    http_health_check={
        "port": 80,
    },
    timeout_sec=1)
import pulumi
import pulumi_gcp as gcp

http_health_check = gcp.compute.HealthCheck("http-health-check",
    check_interval_sec=1,
    description="Health check via http",
    healthy_threshold=4,
    http_health_check={
        "host": "1.2.3.4",
        "port_name": "health-check-port",
        "portSpecification": "USE_NAMED_PORT",
        "proxy_header": "NONE",
        "request_path": "/mypath",
        "response": "I AM HEALTHY",
    },
    timeout_sec=1,
    unhealthy_threshold=5)
import pulumi
import pulumi_gcp as gcp

https_health_check = gcp.compute.HealthCheck("https-health-check",
    check_interval_sec=1,
    https_health_check={
        "port": "443",
    },
    timeout_sec=1)
import pulumi
import pulumi_gcp as gcp

https_health_check = gcp.compute.HealthCheck("https-health-check",
    check_interval_sec=1,
    description="Health check via https",
    healthy_threshold=4,
    https_health_check={
        "host": "1.2.3.4",
        "port_name": "health-check-port",
        "portSpecification": "USE_NAMED_PORT",
        "proxy_header": "NONE",
        "request_path": "/mypath",
        "response": "I AM HEALTHY",
    },
    timeout_sec=1,
    unhealthy_threshold=5)
import pulumi
import pulumi_gcp as gcp

http2_health_check = gcp.compute.HealthCheck("http2-health-check",
    check_interval_sec=1,
    http2_health_check={
        "port": "443",
    },
    timeout_sec=1)
import pulumi
import pulumi_gcp as gcp

http2_health_check = gcp.compute.HealthCheck("http2-health-check",
    check_interval_sec=1,
    description="Health check via http2",
    healthy_threshold=4,
    http2_health_check={
        "host": "1.2.3.4",
        "port_name": "health-check-port",
        "portSpecification": "USE_NAMED_PORT",
        "proxy_header": "NONE",
        "request_path": "/mypath",
        "response": "I AM HEALTHY",
    },
    timeout_sec=1,
    unhealthy_threshold=5)
import pulumi
import pulumi_gcp as gcp

health_check_with_logging = gcp.compute.HealthCheck("health-check-with-logging",
    timeout_sec=1,
    check_interval_sec=1,
    tcp_health_check={
        "port": "22",
    },
    log_config={
        "enable": True,
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • check_interval_sec (pulumi.Input[float]) – How often (in seconds) to send a health check. The default value is 5 seconds.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • healthy_threshold (pulumi.Input[float]) – A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

  • http2_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • http_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • https_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • log_config (pulumi.Input[dict]) – Configure logging on this health check. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • ssl_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • tcp_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • timeout_sec (pulumi.Input[float]) – How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

  • unhealthy_threshold (pulumi.Input[float]) – A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

The http2_health_check object supports the following:

  • host (pulumi.Input[str]) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (pulumi.Input[str]) - The request path of the HTTP2 health check request. The default value is /.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The http_health_check object supports the following:

  • host (pulumi.Input[str]) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (pulumi.Input[str]) - The request path of the HTTP2 health check request. The default value is /.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The https_health_check object supports the following:

  • host (pulumi.Input[str]) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (pulumi.Input[str]) - The request path of the HTTP2 health check request. The default value is /.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The log_config object supports the following:

  • enable (pulumi.Input[bool]) - Indicates whether or not to export logs. This is false by default, which means no health check logging will be done.

The ssl_health_check object supports the following:

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request (pulumi.Input[str]) - The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The tcp_health_check object supports the following:

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request (pulumi.Input[str]) - The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

check_interval_sec: pulumi.Output[float] = None

How often (in seconds) to send a health check. The default value is 5 seconds.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

healthy_threshold: pulumi.Output[float] = None

A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

http2_health_check: pulumi.Output[dict] = None

A nested object resource Structure is documented below.

  • host (str) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (float) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (str) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (str) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (str) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (str) - The request path of the HTTP2 health check request. The default value is /.

  • response (str) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

http_health_check: pulumi.Output[dict] = None

A nested object resource Structure is documented below.

  • host (str) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (float) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (str) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (str) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (str) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (str) - The request path of the HTTP2 health check request. The default value is /.

  • response (str) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

https_health_check: pulumi.Output[dict] = None

A nested object resource Structure is documented below.

  • host (str) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (float) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (str) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (str) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (str) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (str) - The request path of the HTTP2 health check request. The default value is /.

  • response (str) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

log_config: pulumi.Output[dict] = None

Configure logging on this health check. Structure is documented below.

  • enable (bool) - Indicates whether or not to export logs. This is false by default, which means no health check logging will be done.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project: pulumi.Output[str] = None

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

The URI of the created resource.

ssl_health_check: pulumi.Output[dict] = None

A nested object resource Structure is documented below.

  • port (float) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (str) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (str) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (str) - Specifies the type of proxy header to append before sending data to the backend.

  • request (str) - The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII.

  • response (str) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

tcp_health_check: pulumi.Output[dict] = None

A nested object resource Structure is documented below.

  • port (float) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (str) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (str) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (str) - Specifies the type of proxy header to append before sending data to the backend.

  • request (str) - The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII.

  • response (str) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

timeout_sec: pulumi.Output[float] = None

How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

type: pulumi.Output[str] = None

The type of the health check. One of HTTP, HTTPS, TCP, or SSL.

unhealthy_threshold: pulumi.Output[float] = None

A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

static get(resource_name, id, opts=None, check_interval_sec=None, creation_timestamp=None, description=None, healthy_threshold=None, http2_health_check=None, http_health_check=None, https_health_check=None, log_config=None, name=None, project=None, self_link=None, ssl_health_check=None, tcp_health_check=None, timeout_sec=None, type=None, unhealthy_threshold=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • check_interval_sec (pulumi.Input[float]) – How often (in seconds) to send a health check. The default value is 5 seconds.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • healthy_threshold (pulumi.Input[float]) – A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

  • http2_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • http_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • https_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • log_config (pulumi.Input[dict]) – Configure logging on this health check. Structure is documented below.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • ssl_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • tcp_health_check (pulumi.Input[dict]) – A nested object resource Structure is documented below.

  • timeout_sec (pulumi.Input[float]) – How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

  • type (pulumi.Input[str]) – The type of the health check. One of HTTP, HTTPS, TCP, or SSL.

  • unhealthy_threshold (pulumi.Input[float]) – A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

The http2_health_check object supports the following:

  • host (pulumi.Input[str]) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (pulumi.Input[str]) - The request path of the HTTP2 health check request. The default value is /.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The http_health_check object supports the following:

  • host (pulumi.Input[str]) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (pulumi.Input[str]) - The request path of the HTTP2 health check request. The default value is /.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The https_health_check object supports the following:

  • host (pulumi.Input[str]) - The value of the host header in the HTTP2 health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request_path (pulumi.Input[str]) - The request path of the HTTP2 health check request. The default value is /.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The log_config object supports the following:

  • enable (pulumi.Input[bool]) - Indicates whether or not to export logs. This is false by default, which means no health check logging will be done.

The ssl_health_check object supports the following:

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request (pulumi.Input[str]) - The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

The tcp_health_check object supports the following:

  • port (pulumi.Input[float]) - The TCP port number for the HTTP2 health check request. The default value is 443.

  • port_name (pulumi.Input[str]) - Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence.

  • portSpecification (pulumi.Input[str]) - Specifies how port is selected for health checking, can be one of the following values:

    • USE_FIXED_PORT: The port number in port is used for health checking.

    • USE_NAMED_PORT: The portName is used for health checking.

    • USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. If not specified, HTTP2 health check follows behavior specified in port and portName fields.

  • proxy_header (pulumi.Input[str]) - Specifies the type of proxy header to append before sending data to the backend.

  • request (pulumi.Input[str]) - The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII.

  • response (pulumi.Input[str]) - The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.HttpHealthCheck(resource_name, opts=None, check_interval_sec=None, description=None, healthy_threshold=None, host=None, name=None, port=None, project=None, request_path=None, timeout_sec=None, unhealthy_threshold=None, __props__=None, __name__=None, __opts__=None)

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

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

To get more information about HttpHealthCheck, see:

import pulumi
import pulumi_gcp as gcp

default = gcp.compute.HttpHealthCheck("default",
    check_interval_sec=1,
    request_path="/health_check",
    timeout_sec=1)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • check_interval_sec (pulumi.Input[float]) – How often (in seconds) to send a health check. The default value is 5 seconds.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • healthy_threshold (pulumi.Input[float]) – A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

  • host (pulumi.Input[str]) – The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • port (pulumi.Input[float]) – The TCP port number for the HTTP health check request. The default value is 80.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • request_path (pulumi.Input[str]) – The request path of the HTTP health check request. The default value is /.

  • timeout_sec (pulumi.Input[float]) – How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

  • unhealthy_threshold (pulumi.Input[float]) – A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

check_interval_sec: pulumi.Output[float] = None

How often (in seconds) to send a health check. The default value is 5 seconds.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

healthy_threshold: pulumi.Output[float] = None

A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

host: pulumi.Output[str] = None

The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

port: pulumi.Output[float] = None

The TCP port number for the HTTP health check request. The default value is 80.

project: pulumi.Output[str] = None

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

request_path: pulumi.Output[str] = None

The request path of the HTTP health check request. The default value is /.

The URI of the created resource.

timeout_sec: pulumi.Output[float] = None

How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

unhealthy_threshold: pulumi.Output[float] = None

A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

static get(resource_name, id, opts=None, check_interval_sec=None, creation_timestamp=None, description=None, healthy_threshold=None, host=None, name=None, port=None, project=None, request_path=None, self_link=None, timeout_sec=None, unhealthy_threshold=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • check_interval_sec (pulumi.Input[float]) – How often (in seconds) to send a health check. The default value is 5 seconds.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • healthy_threshold (pulumi.Input[float]) – A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

  • host (pulumi.Input[str]) – The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • port (pulumi.Input[float]) – The TCP port number for the HTTP health check request. The default value is 80.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • request_path (pulumi.Input[str]) – The request path of the HTTP health check request. The default value is /.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • timeout_sec (pulumi.Input[float]) – How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

  • unhealthy_threshold (pulumi.Input[float]) – A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.HttpsHealthCheck(resource_name, opts=None, check_interval_sec=None, description=None, healthy_threshold=None, host=None, name=None, port=None, project=None, request_path=None, timeout_sec=None, unhealthy_threshold=None, __props__=None, __name__=None, __opts__=None)

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

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

To get more information about HttpsHealthCheck, see:

import pulumi
import pulumi_gcp as gcp

default = gcp.compute.HttpsHealthCheck("default",
    check_interval_sec=1,
    request_path="/health_check",
    timeout_sec=1)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • check_interval_sec (pulumi.Input[float]) – How often (in seconds) to send a health check. The default value is 5 seconds.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • healthy_threshold (pulumi.Input[float]) – A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

  • host (pulumi.Input[str]) – The value of the host header in the HTTPS health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • port (pulumi.Input[float]) – The TCP port number for the HTTPS health check request. The default value is 80.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • request_path (pulumi.Input[str]) – The request path of the HTTPS health check request. The default value is /.

  • timeout_sec (pulumi.Input[float]) – How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

  • unhealthy_threshold (pulumi.Input[float]) – A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

check_interval_sec: pulumi.Output[float] = None

How often (in seconds) to send a health check. The default value is 5 seconds.

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

healthy_threshold: pulumi.Output[float] = None

A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

host: pulumi.Output[str] = None

The value of the host header in the HTTPS health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

name: pulumi.Output[str] = None

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

port: pulumi.Output[float] = None

The TCP port number for the HTTPS health check request. The default value is 80.

project: pulumi.Output[str] = None

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

request_path: pulumi.Output[str] = None

The request path of the HTTPS health check request. The default value is /.

The URI of the created resource.

timeout_sec: pulumi.Output[float] = None

How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

unhealthy_threshold: pulumi.Output[float] = None

A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

static get(resource_name, id, opts=None, check_interval_sec=None, creation_timestamp=None, description=None, healthy_threshold=None, host=None, name=None, port=None, project=None, request_path=None, self_link=None, timeout_sec=None, unhealthy_threshold=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • check_interval_sec (pulumi.Input[float]) – How often (in seconds) to send a health check. The default value is 5 seconds.

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • healthy_threshold (pulumi.Input[float]) – A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

  • host (pulumi.Input[str]) – The value of the host header in the HTTPS health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used.

  • name (pulumi.Input[str]) – Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • port (pulumi.Input[float]) – The TCP port number for the HTTPS health check request. The default value is 80.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • request_path (pulumi.Input[str]) – The request path of the HTTPS health check request. The default value is /.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • timeout_sec (pulumi.Input[float]) – How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

  • unhealthy_threshold (pulumi.Input[float]) – A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.Image(resource_name, opts=None, description=None, disk_size_gb=None, family=None, guest_os_features=None, labels=None, licenses=None, name=None, project=None, raw_disk=None, source_disk=None, __props__=None, __name__=None, __opts__=None)

Represents an Image resource.

Google Compute Engine uses operating system images to create the root persistent disks for your instances. You specify an image when you create an instance. Images contain a boot loader, an operating system, and a root file system. Linux operating system images are also capable of running containers on Compute Engine.

Images can be either public or custom.

Public images are provided and maintained by Google, open-source communities, and third-party vendors. By default, all projects have access to these images and can use them to create instances. Custom images are available only to your project. You can create a custom image from root persistent disks and other images. Then, use the custom image to create an instance.

To get more information about Image, see:

import pulumi
import pulumi_gcp as gcp

example = gcp.compute.Image("example", raw_disk={
    "source": "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz",
})
import pulumi
import pulumi_gcp as gcp

example = gcp.compute.Image("example",
    guest_os_features=[
        {
            "type": "SECURE_BOOT",
        },
        {
            "type": "MULTI_IP_SUBNET",
        },
    ],
    raw_disk={
        "source": "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz",
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • disk_size_gb (pulumi.Input[float]) – Size of the image when restored onto a persistent disk (in GB).

  • family (pulumi.Input[str]) – The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.

  • guest_os_features (pulumi.Input[list]) – A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

  • labels (pulumi.Input[dict]) – Labels to apply to this Image.

  • licenses (pulumi.Input[list]) – Any applicable license URI.

  • name (pulumi.Input[str]) – Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • raw_disk (pulumi.Input[dict]) – The parameters of the raw disk image. Structure is documented below.

  • source_disk (pulumi.Input[str]) – The source disk to create this image based on. You must provide either this property or the rawDisk.source property but not both to create an image.

The guest_os_features object supports the following:

The raw_disk object supports the following:

  • containerType (pulumi.Input[str]) - The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

  • sha1 (pulumi.Input[str]) - An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

  • source (pulumi.Input[str]) - The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

archive_size_bytes: pulumi.Output[float] = None

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

creation_timestamp: pulumi.Output[str] = None

Creation timestamp in RFC3339 text format.

description: pulumi.Output[str] = None

An optional description of this resource. Provide this property when you create the resource.

disk_size_gb: pulumi.Output[float] = None

Size of the image when restored onto a persistent disk (in GB).

family: pulumi.Output[str] = None

The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.

guest_os_features: pulumi.Output[list] = None

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

label_fingerprint: pulumi.Output[str] = None

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels: pulumi.Output[dict] = None

Labels to apply to this Image.

licenses: pulumi.Output[list] = None

Any applicable license URI.

name: pulumi.Output[str] = None

Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project: pulumi.Output[str] = None

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

raw_disk: pulumi.Output[dict] = None

The parameters of the raw disk image. Structure is documented below.

  • containerType (str) - The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

  • sha1 (str) - An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

  • source (str) - The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

The URI of the created resource.

source_disk: pulumi.Output[str] = None

The source disk to create this image based on. You must provide either this property or the rawDisk.source property but not both to create an image.

static get(resource_name, id, opts=None, archive_size_bytes=None, creation_timestamp=None, description=None, disk_size_gb=None, family=None, guest_os_features=None, label_fingerprint=None, labels=None, licenses=None, name=None, project=None, raw_disk=None, self_link=None, source_disk=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • archive_size_bytes (pulumi.Input[float]) – Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

  • creation_timestamp (pulumi.Input[str]) – Creation timestamp in RFC3339 text format.

  • description (pulumi.Input[str]) – An optional description of this resource. Provide this property when you create the resource.

  • disk_size_gb (pulumi.Input[float]) – Size of the image when restored onto a persistent disk (in GB).

  • family (pulumi.Input[str]) – The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.

  • guest_os_features (pulumi.Input[list]) – A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

  • label_fingerprint (pulumi.Input[str]) – The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • labels (pulumi.Input[dict]) – Labels to apply to this Image.

  • licenses (pulumi.Input[list]) – Any applicable license URI.

  • name (pulumi.Input[str]) – Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • raw_disk (pulumi.Input[dict]) – The parameters of the raw disk image. Structure is documented below.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • source_disk (pulumi.Input[str]) – The source disk to create this image based on. You must provide either this property or the rawDisk.source property but not both to create an image.

The guest_os_features object supports the following:

The raw_disk object supports the following:

  • containerType (pulumi.Input[str]) - The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

  • sha1 (pulumi.Input[str]) - An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

  • source (pulumi.Input[str]) - The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.Instance(resource_name, opts=None, allow_stopping_for_update=None, attached_disks=None, boot_disk=None, can_ip_forward=None, deletion_protection=None, description=None, desired_status=None, enable_display=None, guest_accelerators=None, hostname=None, labels=None, machine_type=None, metadata=None, metadata_startup_script=None, min_cpu_platform=None, name=None, network_interfaces=None, project=None, resource_policies=None, scheduling=None, scratch_disks=None, service_account=None, shielded_instance_config=None, tags=None, zone=None, __props__=None, __name__=None, __opts__=None)

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

import pulumi
import pulumi_gcp as gcp

default = gcp.compute.Instance("default",
    boot_disk={
        "initializeParams": {
            "image": "debian-cloud/debian-9",
        },
    },
    machine_type="n1-standard-1",
    metadata={
        "foo": "bar",
    },
    metadata_startup_script="echo hi > /test.txt",
    network_interfaces=[{
        "accessConfig": [{}],
        "network": "default",
    }],
    scratch_disks=[{
        "interface": "SCSI",
    }],
    service_account={
        "scopes": [
            "userinfo-email",
            "compute-ro",
            "storage-ro",
        ],
    },
    tags=[
        "foo",
        "bar",
    ],
    zone="us-central1-a")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • allow_stopping_for_update (pulumi.Input[bool]) – If true, allows this prvider 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.

  • attached_disks (pulumi.Input[list]) – Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.

  • boot_disk (pulumi.Input[dict]) – The boot disk for the instance. Structure is documented below.

  • can_ip_forward (pulumi.Input[bool]) – Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.

  • deletion_protection (pulumi.Input[bool]) – Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.

  • description (pulumi.Input[str]) – A brief description of this resource.

  • desired_status (pulumi.Input[str]) – Desired status of the instance. Either "RUNNING" or "TERMINATED".

  • enable_display (pulumi.Input[bool]) – Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • guest_accelerators (pulumi.Input[list]) – 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.

  • hostname (pulumi.Input[str]) – A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of labels 1-63 characters long matching the regular expression a-z, concatenated with periods. The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created.

  • labels (pulumi.Input[dict]) – A map of key/value label pairs to assign to the instance.

  • machine_type (pulumi.Input[str]) – The machine type to create.

  • metadata (pulumi.Input[dict]) – Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.

  • metadata_startup_script (pulumi.Input[str]) – 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. Users are free to use either mechanism - the only distinction is that this separate attribute willl cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.

  • min_cpu_platform (pulumi.Input[str]) – 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 or your instance must have a desired_status of TERMINATED in order to update this field.

  • name (pulumi.Input[str]) – A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

  • network_interfaces (pulumi.Input[list]) – Networks to attach to the instance. This can be specified multiple times. Structure is documented below.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • resource_policies (pulumi.Input[str]) – – A list of short names or self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.

  • scheduling (pulumi.Input[dict]) – The scheduling strategy to use. More details about this configuration option are detailed below.

  • scratch_disks (pulumi.Input[list]) – Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.

  • service_account (pulumi.Input[dict]) – Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • shielded_instance_config (pulumi.Input[dict]) –

    Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here.

  • tags (pulumi.Input[list]) – A list of tags to attach to the instance.

  • zone (pulumi.Input[str]) – The zone that the machine should be created in.

The attached_disks object supports the following:

  • device_name (pulumi.Input[str]) - Name with which the attached disk will be accessible under /dev/disk/by-id/google-*

  • diskEncryptionKeyRaw (pulumi.Input[str]) - A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • diskEncryptionKeySha256 (pulumi.Input[str])

  • kmsKeySelfLink (pulumi.Input[str]) - The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • mode (pulumi.Input[str]) - Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

  • source (pulumi.Input[str]) - The name or self_link of the disk to attach to this instance.

The boot_disk object supports the following:

  • autoDelete (pulumi.Input[bool]) - Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.

  • device_name (pulumi.Input[str]) - Name with which the attached disk will be accessible under /dev/disk/by-id/google-*

  • diskEncryptionKeyRaw (pulumi.Input[str]) - A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • diskEncryptionKeySha256 (pulumi.Input[str])

  • initializeParams (pulumi.Input[dict]) - Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.

    • image (pulumi.Input[str]) - The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

    • labels (pulumi.Input[dict]) - A map of key/value label pairs to assign to the instance.

    • size (pulumi.Input[float]) - The size of the image in gigabytes. If not specified, it will inherit the size of its base image.

    • type (pulumi.Input[str]) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

  • kmsKeySelfLink (pulumi.Input[str]) - The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • mode (pulumi.Input[str]) - Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

  • source (pulumi.Input[str]) - The name or self_link of the disk to attach to this instance.

The guest_accelerators object supports the following:

  • count (pulumi.Input[float]) - The number of the guest accelerator cards exposed to this instance.

  • type (pulumi.Input[str]) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

The network_interfaces object supports the following:

  • accessConfigs (pulumi.Input[list]) - Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.

    • natIp (pulumi.Input[str]) - The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.

    • network_tier (pulumi.Input[str]) - The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.

    • publicPtrDomainName (pulumi.Input[str]) - The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.

  • aliasIpRanges (pulumi.Input[list]) - An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.

    • ip_cidr_range (pulumi.Input[str]) - The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).

    • subnetworkRangeName (pulumi.Input[str]) - The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.

  • name (pulumi.Input[str]) - A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

  • network (pulumi.Input[str]) - The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.

  • networkIp (pulumi.Input[str]) - The private IP address to assign to the instance. If empty, the address will be automatically assigned.

  • subnetwork (pulumi.Input[str]) - The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided.

  • subnetworkProject (pulumi.Input[str]) - The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.

The scheduling object supports the following:

  • automaticRestart (pulumi.Input[bool]) - Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.

  • minNodeCpus (pulumi.Input[float])

  • nodeAffinities (pulumi.Input[list]) - Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.

    • key (pulumi.Input[str]) - The key for the node affinity label.

    • operator (pulumi.Input[str]) - The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.

    • values (pulumi.Input[list])

  • onHostMaintenance (pulumi.Input[str]) - Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.

  • preemptible (pulumi.Input[bool]) - Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.

The scratch_disks object supports the following:

  • interface (pulumi.Input[str]) - The disk interface to use for attaching this disk; either SCSI or NVME.

The service_account object supports the following:

  • email (pulumi.Input[str]) - The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • scopes (pulumi.Input[list]) - A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

The shielded_instance_config object supports the following:

  • enableIntegrityMonitoring (pulumi.Input[bool]) - – Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true.

  • enableSecureBoot (pulumi.Input[bool]) - – Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false.

  • enableVtpm (pulumi.Input[bool]) - – Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true.

allow_stopping_for_update: pulumi.Output[bool] = None

If true, allows this prvider 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.

attached_disks: pulumi.Output[list] = None

Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.

  • device_name (str) - Name with which the attached disk will be accessible under /dev/disk/by-id/google-*

  • diskEncryptionKeyRaw (str) - A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • diskEncryptionKeySha256 (str)

  • kmsKeySelfLink (str) - The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • mode (str) - Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

  • source (str) - The name or self_link of the disk to attach to this instance.

boot_disk: pulumi.Output[dict] = None

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

  • autoDelete (bool) - Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.

  • device_name (str) - Name with which the attached disk will be accessible under /dev/disk/by-id/google-*

  • diskEncryptionKeyRaw (str) - A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • diskEncryptionKeySha256 (str)

  • initializeParams (dict) - Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.

    • image (str) - The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

    • labels (dict) - A map of key/value label pairs to assign to the instance.

    • size (float) - The size of the image in gigabytes. If not specified, it will inherit the size of its base image.

    • type (str) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

  • kmsKeySelfLink (str) - The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • mode (str) - Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

  • source (str) - The name or self_link of the disk to attach to this instance.

can_ip_forward: pulumi.Output[bool] = None

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

cpu_platform: pulumi.Output[str] = None

The CPU platform used by this instance.

deletion_protection: pulumi.Output[bool] = None

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

description: pulumi.Output[str] = None

A brief description of this resource.

desired_status: pulumi.Output[str] = None

Desired status of the instance. Either "RUNNING" or "TERMINATED".

enable_display: pulumi.Output[bool] = None

Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

guest_accelerators: pulumi.Output[list] = None

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.

  • count (float) - The number of the guest accelerator cards exposed to this instance.

  • type (str) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

hostname: pulumi.Output[str] = None

A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of labels 1-63 characters long matching the regular expression a-z, concatenated with periods. The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created.

instance_id: pulumi.Output[str] = None

The server-assigned unique identifier of this instance.

label_fingerprint: pulumi.Output[str] = None

The unique fingerprint of the labels.

labels: pulumi.Output[dict] = None

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

machine_type: pulumi.Output[str] = None

The machine type to create.

metadata: pulumi.Output[dict] = None

Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.

metadata_fingerprint: pulumi.Output[str] = None

The unique fingerprint of the metadata.

metadata_startup_script: pulumi.Output[str] = None

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. Users are free to use either mechanism - the only distinction is that this separate attribute willl cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.

min_cpu_platform: pulumi.Output[str] = None

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 or your instance must have a desired_status of TERMINATED in order to update this field.

name: pulumi.Output[str] = None

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

network_interfaces: pulumi.Output[list] = None

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

  • accessConfigs (list) - Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.

    • natIp (str) - The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.

    • network_tier (str) - The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.

    • publicPtrDomainName (str) - The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.

  • aliasIpRanges (list) - An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.

    • ip_cidr_range (str) - The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).

    • subnetworkRangeName (str) - The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.

  • name (str) - A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

  • network (str) - The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.

  • networkIp (str) - The private IP address to assign to the instance. If empty, the address will be automatically assigned.

  • subnetwork (str) - The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided.

  • subnetworkProject (str) - The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.

project: pulumi.Output[str] = None

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

resource_policies: pulumi.Output[str] = None

– A list of short names or self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.

scheduling: pulumi.Output[dict] = None

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

  • automaticRestart (bool) - Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.

  • minNodeCpus (float)

  • nodeAffinities (list) - Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.

    • key (str) - The key for the node affinity label.

    • operator (str) - The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.

    • values (list)

  • onHostMaintenance (str) - Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.

  • preemptible (bool) - Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.

scratch_disks: pulumi.Output[list] = None

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

  • interface (str) - The disk interface to use for attaching this disk; either SCSI or NVME.

The URI of the created resource.

service_account: pulumi.Output[dict] = None

Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • email (str) - The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • scopes (list) - A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

shielded_instance_config: pulumi.Output[dict] = None

Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here.

  • enableIntegrityMonitoring (bool) - – Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true.

  • enableSecureBoot (bool) - – Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false.

  • enableVtpm (bool) - – Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true.

tags: pulumi.Output[list] = None

A list of tags to attach to the instance.

tags_fingerprint: pulumi.Output[str] = None

The unique fingerprint of the tags.

zone: pulumi.Output[str] = None

The zone that the machine should be created in.

static get(resource_name, id, opts=None, allow_stopping_for_update=None, attached_disks=None, boot_disk=None, can_ip_forward=None, cpu_platform=None, current_status=None, deletion_protection=None, description=None, desired_status=None, enable_display=None, guest_accelerators=None, hostname=None, instance_id=None, label_fingerprint=None, labels=None, machine_type=None, metadata=None, metadata_fingerprint=None, metadata_startup_script=None, min_cpu_platform=None, name=None, network_interfaces=None, project=None, resource_policies=None, scheduling=None, scratch_disks=None, self_link=None, service_account=None, shielded_instance_config=None, tags=None, tags_fingerprint=None, zone=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • allow_stopping_for_update (pulumi.Input[bool]) – If true, allows this prvider 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.

  • attached_disks (pulumi.Input[list]) – Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.

  • boot_disk (pulumi.Input[dict]) – The boot disk for the instance. Structure is documented below.

  • can_ip_forward (pulumi.Input[bool]) – Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.

  • cpu_platform (pulumi.Input[str]) – The CPU platform used by this instance.

  • deletion_protection (pulumi.Input[bool]) – Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.

  • description (pulumi.Input[str]) – A brief description of this resource.

  • desired_status (pulumi.Input[str]) – Desired status of the instance. Either "RUNNING" or "TERMINATED".

  • enable_display (pulumi.Input[bool]) –

    Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • guest_accelerators (pulumi.Input[list]) – 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.

  • hostname (pulumi.Input[str]) – A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of labels 1-63 characters long matching the regular expression a-z, concatenated with periods. The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created.

  • instance_id (pulumi.Input[str]) – The server-assigned unique identifier of this instance.

  • label_fingerprint (pulumi.Input[str]) – The unique fingerprint of the labels.

  • labels (pulumi.Input[dict]) – A map of key/value label pairs to assign to the instance.

  • machine_type (pulumi.Input[str]) – The machine type to create.

  • metadata (pulumi.Input[dict]) – Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.

  • metadata_fingerprint (pulumi.Input[str]) – The unique fingerprint of the metadata.

  • metadata_startup_script (pulumi.Input[str]) – 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. Users are free to use either mechanism - the only distinction is that this separate attribute willl cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.

  • min_cpu_platform (pulumi.Input[str]) –

    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 or your instance must have a desired_status of TERMINATED in order to update this field.

  • name (pulumi.Input[str]) – A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

  • network_interfaces (pulumi.Input[list]) – Networks to attach to the instance. This can be specified multiple times. Structure is documented below.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • resource_policies (pulumi.Input[str]) – – A list of short names or self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.

  • scheduling (pulumi.Input[dict]) – The scheduling strategy to use. More details about this configuration option are detailed below.

  • scratch_disks (pulumi.Input[list]) – Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • service_account (pulumi.Input[dict]) – Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • shielded_instance_config (pulumi.Input[dict]) –

    Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here.

  • tags (pulumi.Input[list]) – A list of tags to attach to the instance.

  • tags_fingerprint (pulumi.Input[str]) – The unique fingerprint of the tags.

  • zone (pulumi.Input[str]) – The zone that the machine should be created in.

The attached_disks object supports the following:

  • device_name (pulumi.Input[str]) - Name with which the attached disk will be accessible under /dev/disk/by-id/google-*

  • diskEncryptionKeyRaw (pulumi.Input[str]) - A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • diskEncryptionKeySha256 (pulumi.Input[str])

  • kmsKeySelfLink (pulumi.Input[str]) - The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • mode (pulumi.Input[str]) - Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

  • source (pulumi.Input[str]) - The name or self_link of the disk to attach to this instance.

The boot_disk object supports the following:

  • autoDelete (pulumi.Input[bool]) - Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.

  • device_name (pulumi.Input[str]) - Name with which the attached disk will be accessible under /dev/disk/by-id/google-*

  • diskEncryptionKeyRaw (pulumi.Input[str]) - A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • diskEncryptionKeySha256 (pulumi.Input[str])

  • initializeParams (pulumi.Input[dict]) - Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.

    • image (pulumi.Input[str]) - The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

    • labels (pulumi.Input[dict]) - A map of key/value label pairs to assign to the instance.

    • size (pulumi.Input[float]) - The size of the image in gigabytes. If not specified, it will inherit the size of its base image.

    • type (pulumi.Input[str]) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

  • kmsKeySelfLink (pulumi.Input[str]) - The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.

  • mode (pulumi.Input[str]) - Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

  • source (pulumi.Input[str]) - The name or self_link of the disk to attach to this instance.

The guest_accelerators object supports the following:

  • count (pulumi.Input[float]) - The number of the guest accelerator cards exposed to this instance.

  • type (pulumi.Input[str]) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

The network_interfaces object supports the following:

  • accessConfigs (pulumi.Input[list]) - Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.

    • natIp (pulumi.Input[str]) - The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.

    • network_tier (pulumi.Input[str]) - The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.

    • publicPtrDomainName (pulumi.Input[str]) - The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.

  • aliasIpRanges (pulumi.Input[list]) - An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.

    • ip_cidr_range (pulumi.Input[str]) - The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).

    • subnetworkRangeName (pulumi.Input[str]) - The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.

  • name (pulumi.Input[str]) - A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

  • network (pulumi.Input[str]) - The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.

  • networkIp (pulumi.Input[str]) - The private IP address to assign to the instance. If empty, the address will be automatically assigned.

  • subnetwork (pulumi.Input[str]) - The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided.

  • subnetworkProject (pulumi.Input[str]) - The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.

The scheduling object supports the following:

  • automaticRestart (pulumi.Input[bool]) - Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.

  • minNodeCpus (pulumi.Input[float])

  • nodeAffinities (pulumi.Input[list]) - Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.

    • key (pulumi.Input[str]) - The key for the node affinity label.

    • operator (pulumi.Input[str]) - The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.

    • values (pulumi.Input[list])

  • onHostMaintenance (pulumi.Input[str]) - Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.

  • preemptible (pulumi.Input[bool]) - Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.

The scratch_disks object supports the following:

  • interface (pulumi.Input[str]) - The disk interface to use for attaching this disk; either SCSI or NVME.

The service_account object supports the following:

  • email (pulumi.Input[str]) - The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

  • scopes (pulumi.Input[list]) - A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

The shielded_instance_config object supports the following:

  • enableIntegrityMonitoring (pulumi.Input[bool]) - – Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true.

  • enableSecureBoot (pulumi.Input[bool]) - – Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false.

  • enableVtpm (pulumi.Input[bool]) - – Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.compute.InstanceFromTemplate(resource_name, opts=None, allow_stopping_for_update=None, attached_disks=None, boot_disk=None, can_ip_forward=None, deletion_protection=None, description=None, desired_status=None, enable_display=None, guest_accelerators=None, hostname=None, labels=None, machine_type=None, metadata=None, metadata_startup_script=None, min_cpu_platform=None, name=None, network_interfaces=None, project=None, resource_policies=None, scheduling=None, scratch_disks=None, service_account=None, shielded_instance_config=None, source_instance_template=None, tags=None, zone=None, __props__=None, __name__=None, __opts__=None)

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 compute.Instance resource.

import pulumi
import pulumi_gcp as gcp

tpl_instance_template = gcp.