Show / Hide Table of Contents

Class Address

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:

  • API documentation
  • How-to Guides
  • Reserving a Static External IP Address
  • Reserving a Static Internal IP Address

Example Usage - Address Basic

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var ipAddress = new Gcp.Compute.Address("ipAddress", new Gcp.Compute.AddressArgs
    {
    });
}

}

Example Usage - Address With Subnetwork

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var defaultNetwork = new Gcp.Compute.Network("defaultNetwork", new Gcp.Compute.NetworkArgs
    {
    });
    var defaultSubnetwork = new Gcp.Compute.Subnetwork("defaultSubnetwork", new Gcp.Compute.SubnetworkArgs
    {
        IpCidrRange = "10.0.0.0/16",
        Region = "us-central1",
        Network = defaultNetwork.Id,
    });
    var internalWithSubnetAndAddress = new Gcp.Compute.Address("internalWithSubnetAndAddress", new Gcp.Compute.AddressArgs
    {
        Subnetwork = defaultSubnetwork.Id,
        AddressType = "INTERNAL",
        Address = "10.0.42.42",
        Region = "us-central1",
    });
}

}

Example Usage - Address With Gce Endpoint

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var internalWithGceEndpoint = new Gcp.Compute.Address("internalWithGceEndpoint", new Gcp.Compute.AddressArgs
    {
        AddressType = "INTERNAL",
        Purpose = "GCE_ENDPOINT",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Address
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class Address : CustomResource

Constructors

View Source

Address(String, AddressArgs, CustomResourceOptions)

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

Declaration
public Address(string name, AddressArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

AddressArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AddressType

The type of address to reserve.

Declaration
public Output<string> AddressType { get; }
Property Value
Type Description
Output<System.String>
View Source

CreationTimestamp

Creation timestamp in RFC3339 text format.

Declaration
public Output<string> CreationTimestamp { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

An optional description of this resource.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

IPAddress

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.

Declaration
public Output<string> IPAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

LabelFingerprint

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

Declaration
public Output<string> LabelFingerprint { get; }
Property Value
Type Description
Output<System.String>
View Source

Labels

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

Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

Name

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.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

NetworkTier

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

Declaration
public Output<string> NetworkTier { get; }
Property Value
Type Description
Output<System.String>
View Source

Project

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

Declaration
public Output<string> Project { get; }
Property Value
Type Description
Output<System.String>
View Source

Purpose

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.
Declaration
public Output<string> Purpose { get; }
Property Value
Type Description
Output<System.String>
View Source

Region

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

Declaration
public Output<string> Region { get; }
Property Value
Type Description
Output<System.String>
View Source

SelfLink

The URI of the created resource.

Declaration
public Output<string> SelfLink { get; }
Property Value
Type Description
Output<System.String>
View Source

Subnetwork

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.

Declaration
public Output<string> Subnetwork { get; }
Property Value
Type Description
Output<System.String>
View Source

Users

The URLs of the resources that are using this address.

Declaration
public Output<ImmutableArray<string>> Users { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>

Methods

View Source

Get(String, Input<String>, AddressState, CustomResourceOptions)

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

Declaration
public static Address Get(string name, Input<string> id, AddressState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

AddressState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Address
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.