1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. NetworkAttachment
Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi

gcp.compute.NetworkAttachment

Explore with Pulumi AI

A network attachment is a resource that lets a producer Virtual Private Cloud (VPC) network initiate connections to a consumer VPC network through a Private Service Connect interface.

To get more information about NetworkAttachment, see:

Example Usage

Network Attachment Basic

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

const defaultNetwork = new gcp.compute.Network("default", {
    name: "basic-network",
    autoCreateSubnetworks: false,
});
const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
    name: "basic-subnetwork",
    region: "us-central1",
    network: defaultNetwork.id,
    ipCidrRange: "10.0.0.0/16",
});
const rejectedProducerProject = new gcp.organizations.Project("rejected_producer_project", {
    projectId: "prj-rejected",
    name: "prj-rejected",
    orgId: "123456789",
    billingAccount: "000000-0000000-0000000-000000",
    deletionPolicy: "DELETE",
});
const acceptedProducerProject = new gcp.organizations.Project("accepted_producer_project", {
    projectId: "prj-accepted",
    name: "prj-accepted",
    orgId: "123456789",
    billingAccount: "000000-0000000-0000000-000000",
    deletionPolicy: "DELETE",
});
const _default = new gcp.compute.NetworkAttachment("default", {
    name: "basic-network-attachment",
    region: "us-central1",
    description: "basic network attachment description",
    connectionPreference: "ACCEPT_MANUAL",
    subnetworks: [defaultSubnetwork.selfLink],
    producerAcceptLists: [acceptedProducerProject.projectId],
    producerRejectLists: [rejectedProducerProject.projectId],
});
Copy
import pulumi
import pulumi_gcp as gcp

default_network = gcp.compute.Network("default",
    name="basic-network",
    auto_create_subnetworks=False)
default_subnetwork = gcp.compute.Subnetwork("default",
    name="basic-subnetwork",
    region="us-central1",
    network=default_network.id,
    ip_cidr_range="10.0.0.0/16")
rejected_producer_project = gcp.organizations.Project("rejected_producer_project",
    project_id="prj-rejected",
    name="prj-rejected",
    org_id="123456789",
    billing_account="000000-0000000-0000000-000000",
    deletion_policy="DELETE")
accepted_producer_project = gcp.organizations.Project("accepted_producer_project",
    project_id="prj-accepted",
    name="prj-accepted",
    org_id="123456789",
    billing_account="000000-0000000-0000000-000000",
    deletion_policy="DELETE")
default = gcp.compute.NetworkAttachment("default",
    name="basic-network-attachment",
    region="us-central1",
    description="basic network attachment description",
    connection_preference="ACCEPT_MANUAL",
    subnetworks=[default_subnetwork.self_link],
    producer_accept_lists=[accepted_producer_project.project_id],
    producer_reject_lists=[rejected_producer_project.project_id])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
			Name:                  pulumi.String("basic-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
			Name:        pulumi.String("basic-subnetwork"),
			Region:      pulumi.String("us-central1"),
			Network:     defaultNetwork.ID(),
			IpCidrRange: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		rejectedProducerProject, err := organizations.NewProject(ctx, "rejected_producer_project", &organizations.ProjectArgs{
			ProjectId:      pulumi.String("prj-rejected"),
			Name:           pulumi.String("prj-rejected"),
			OrgId:          pulumi.String("123456789"),
			BillingAccount: pulumi.String("000000-0000000-0000000-000000"),
			DeletionPolicy: pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		acceptedProducerProject, err := organizations.NewProject(ctx, "accepted_producer_project", &organizations.ProjectArgs{
			ProjectId:      pulumi.String("prj-accepted"),
			Name:           pulumi.String("prj-accepted"),
			OrgId:          pulumi.String("123456789"),
			BillingAccount: pulumi.String("000000-0000000-0000000-000000"),
			DeletionPolicy: pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewNetworkAttachment(ctx, "default", &compute.NetworkAttachmentArgs{
			Name:                 pulumi.String("basic-network-attachment"),
			Region:               pulumi.String("us-central1"),
			Description:          pulumi.String("basic network attachment description"),
			ConnectionPreference: pulumi.String("ACCEPT_MANUAL"),
			Subnetworks: pulumi.StringArray{
				defaultSubnetwork.SelfLink,
			},
			ProducerAcceptLists: pulumi.StringArray{
				acceptedProducerProject.ProjectId,
			},
			ProducerRejectLists: pulumi.StringArray{
				rejectedProducerProject.ProjectId,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var defaultNetwork = new Gcp.Compute.Network("default", new()
    {
        Name = "basic-network",
        AutoCreateSubnetworks = false,
    });

    var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
    {
        Name = "basic-subnetwork",
        Region = "us-central1",
        Network = defaultNetwork.Id,
        IpCidrRange = "10.0.0.0/16",
    });

    var rejectedProducerProject = new Gcp.Organizations.Project("rejected_producer_project", new()
    {
        ProjectId = "prj-rejected",
        Name = "prj-rejected",
        OrgId = "123456789",
        BillingAccount = "000000-0000000-0000000-000000",
        DeletionPolicy = "DELETE",
    });

    var acceptedProducerProject = new Gcp.Organizations.Project("accepted_producer_project", new()
    {
        ProjectId = "prj-accepted",
        Name = "prj-accepted",
        OrgId = "123456789",
        BillingAccount = "000000-0000000-0000000-000000",
        DeletionPolicy = "DELETE",
    });

    var @default = new Gcp.Compute.NetworkAttachment("default", new()
    {
        Name = "basic-network-attachment",
        Region = "us-central1",
        Description = "basic network attachment description",
        ConnectionPreference = "ACCEPT_MANUAL",
        Subnetworks = new[]
        {
            defaultSubnetwork.SelfLink,
        },
        ProducerAcceptLists = new[]
        {
            acceptedProducerProject.ProjectId,
        },
        ProducerRejectLists = new[]
        {
            rejectedProducerProject.ProjectId,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.compute.NetworkAttachment;
import com.pulumi.gcp.compute.NetworkAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
            .name("basic-network")
            .autoCreateSubnetworks(false)
            .build());

        var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
            .name("basic-subnetwork")
            .region("us-central1")
            .network(defaultNetwork.id())
            .ipCidrRange("10.0.0.0/16")
            .build());

        var rejectedProducerProject = new Project("rejectedProducerProject", ProjectArgs.builder()
            .projectId("prj-rejected")
            .name("prj-rejected")
            .orgId("123456789")
            .billingAccount("000000-0000000-0000000-000000")
            .deletionPolicy("DELETE")
            .build());

        var acceptedProducerProject = new Project("acceptedProducerProject", ProjectArgs.builder()
            .projectId("prj-accepted")
            .name("prj-accepted")
            .orgId("123456789")
            .billingAccount("000000-0000000-0000000-000000")
            .deletionPolicy("DELETE")
            .build());

        var default_ = new NetworkAttachment("default", NetworkAttachmentArgs.builder()
            .name("basic-network-attachment")
            .region("us-central1")
            .description("basic network attachment description")
            .connectionPreference("ACCEPT_MANUAL")
            .subnetworks(defaultSubnetwork.selfLink())
            .producerAcceptLists(acceptedProducerProject.projectId())
            .producerRejectLists(rejectedProducerProject.projectId())
            .build());

    }
}
Copy
resources:
  default:
    type: gcp:compute:NetworkAttachment
    properties:
      name: basic-network-attachment
      region: us-central1
      description: basic network attachment description
      connectionPreference: ACCEPT_MANUAL
      subnetworks:
        - ${defaultSubnetwork.selfLink}
      producerAcceptLists:
        - ${acceptedProducerProject.projectId}
      producerRejectLists:
        - ${rejectedProducerProject.projectId}
  defaultNetwork:
    type: gcp:compute:Network
    name: default
    properties:
      name: basic-network
      autoCreateSubnetworks: false
  defaultSubnetwork:
    type: gcp:compute:Subnetwork
    name: default
    properties:
      name: basic-subnetwork
      region: us-central1
      network: ${defaultNetwork.id}
      ipCidrRange: 10.0.0.0/16
  rejectedProducerProject:
    type: gcp:organizations:Project
    name: rejected_producer_project
    properties:
      projectId: prj-rejected
      name: prj-rejected
      orgId: '123456789'
      billingAccount: 000000-0000000-0000000-000000
      deletionPolicy: DELETE
  acceptedProducerProject:
    type: gcp:organizations:Project
    name: accepted_producer_project
    properties:
      projectId: prj-accepted
      name: prj-accepted
      orgId: '123456789'
      billingAccount: 000000-0000000-0000000-000000
      deletionPolicy: DELETE
Copy

Network Attachment Instance Usage

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

const _default = new gcp.compute.Network("default", {
    name: "basic-network",
    autoCreateSubnetworks: false,
});
const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
    name: "basic-subnetwork",
    region: "us-central1",
    network: _default.id,
    ipCidrRange: "10.0.0.0/16",
});
const defaultNetworkAttachment = new gcp.compute.NetworkAttachment("default", {
    name: "basic-network-attachment",
    region: "us-central1",
    description: "my basic network attachment",
    subnetworks: [defaultSubnetwork.id],
    connectionPreference: "ACCEPT_AUTOMATIC",
});
const defaultInstance = new gcp.compute.Instance("default", {
    name: "basic-instance",
    zone: "us-central1-a",
    machineType: "e2-micro",
    bootDisk: {
        initializeParams: {
            image: "debian-cloud/debian-11",
        },
    },
    networkInterfaces: [
        {
            network: "default",
        },
        {
            networkAttachment: defaultNetworkAttachment.selfLink,
        },
    ],
});
Copy
import pulumi
import pulumi_gcp as gcp

default = gcp.compute.Network("default",
    name="basic-network",
    auto_create_subnetworks=False)
default_subnetwork = gcp.compute.Subnetwork("default",
    name="basic-subnetwork",
    region="us-central1",
    network=default.id,
    ip_cidr_range="10.0.0.0/16")
default_network_attachment = gcp.compute.NetworkAttachment("default",
    name="basic-network-attachment",
    region="us-central1",
    description="my basic network attachment",
    subnetworks=[default_subnetwork.id],
    connection_preference="ACCEPT_AUTOMATIC")
default_instance = gcp.compute.Instance("default",
    name="basic-instance",
    zone="us-central1-a",
    machine_type="e2-micro",
    boot_disk={
        "initialize_params": {
            "image": "debian-cloud/debian-11",
        },
    },
    network_interfaces=[
        {
            "network": "default",
        },
        {
            "network_attachment": default_network_attachment.self_link,
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
			Name:                  pulumi.String("basic-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
			Name:        pulumi.String("basic-subnetwork"),
			Region:      pulumi.String("us-central1"),
			Network:     _default.ID(),
			IpCidrRange: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		defaultNetworkAttachment, err := compute.NewNetworkAttachment(ctx, "default", &compute.NetworkAttachmentArgs{
			Name:        pulumi.String("basic-network-attachment"),
			Region:      pulumi.String("us-central1"),
			Description: pulumi.String("my basic network attachment"),
			Subnetworks: pulumi.StringArray{
				defaultSubnetwork.ID(),
			},
			ConnectionPreference: pulumi.String("ACCEPT_AUTOMATIC"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewInstance(ctx, "default", &compute.InstanceArgs{
			Name:        pulumi.String("basic-instance"),
			Zone:        pulumi.String("us-central1-a"),
			MachineType: pulumi.String("e2-micro"),
			BootDisk: &compute.InstanceBootDiskArgs{
				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
					Image: pulumi.String("debian-cloud/debian-11"),
				},
			},
			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
				&compute.InstanceNetworkInterfaceArgs{
					Network: pulumi.String("default"),
				},
				&compute.InstanceNetworkInterfaceArgs{
					NetworkAttachment: defaultNetworkAttachment.SelfLink,
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var @default = new Gcp.Compute.Network("default", new()
    {
        Name = "basic-network",
        AutoCreateSubnetworks = false,
    });

    var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
    {
        Name = "basic-subnetwork",
        Region = "us-central1",
        Network = @default.Id,
        IpCidrRange = "10.0.0.0/16",
    });

    var defaultNetworkAttachment = new Gcp.Compute.NetworkAttachment("default", new()
    {
        Name = "basic-network-attachment",
        Region = "us-central1",
        Description = "my basic network attachment",
        Subnetworks = new[]
        {
            defaultSubnetwork.Id,
        },
        ConnectionPreference = "ACCEPT_AUTOMATIC",
    });

    var defaultInstance = new Gcp.Compute.Instance("default", new()
    {
        Name = "basic-instance",
        Zone = "us-central1-a",
        MachineType = "e2-micro",
        BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
        {
            InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
            {
                Image = "debian-cloud/debian-11",
            },
        },
        NetworkInterfaces = new[]
        {
            new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
            {
                Network = "default",
            },
            new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
            {
                NetworkAttachment = defaultNetworkAttachment.SelfLink,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.NetworkAttachment;
import com.pulumi.gcp.compute.NetworkAttachmentArgs;
import com.pulumi.gcp.compute.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var default_ = new Network("default", NetworkArgs.builder()
            .name("basic-network")
            .autoCreateSubnetworks(false)
            .build());

        var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
            .name("basic-subnetwork")
            .region("us-central1")
            .network(default_.id())
            .ipCidrRange("10.0.0.0/16")
            .build());

        var defaultNetworkAttachment = new NetworkAttachment("defaultNetworkAttachment", NetworkAttachmentArgs.builder()
            .name("basic-network-attachment")
            .region("us-central1")
            .description("my basic network attachment")
            .subnetworks(defaultSubnetwork.id())
            .connectionPreference("ACCEPT_AUTOMATIC")
            .build());

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
            .name("basic-instance")
            .zone("us-central1-a")
            .machineType("e2-micro")
            .bootDisk(InstanceBootDiskArgs.builder()
                .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
                    .image("debian-cloud/debian-11")
                    .build())
                .build())
            .networkInterfaces(            
                InstanceNetworkInterfaceArgs.builder()
                    .network("default")
                    .build(),
                InstanceNetworkInterfaceArgs.builder()
                    .networkAttachment(defaultNetworkAttachment.selfLink())
                    .build())
            .build());

    }
}
Copy
resources:
  default:
    type: gcp:compute:Network
    properties:
      name: basic-network
      autoCreateSubnetworks: false
  defaultSubnetwork:
    type: gcp:compute:Subnetwork
    name: default
    properties:
      name: basic-subnetwork
      region: us-central1
      network: ${default.id}
      ipCidrRange: 10.0.0.0/16
  defaultNetworkAttachment:
    type: gcp:compute:NetworkAttachment
    name: default
    properties:
      name: basic-network-attachment
      region: us-central1
      description: my basic network attachment
      subnetworks:
        - ${defaultSubnetwork.id}
      connectionPreference: ACCEPT_AUTOMATIC
  defaultInstance:
    type: gcp:compute:Instance
    name: default
    properties:
      name: basic-instance
      zone: us-central1-a
      machineType: e2-micro
      bootDisk:
        initializeParams:
          image: debian-cloud/debian-11
      networkInterfaces:
        - network: default
        - networkAttachment: ${defaultNetworkAttachment.selfLink}
Copy

Create NetworkAttachment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NetworkAttachment(name: string, args: NetworkAttachmentArgs, opts?: CustomResourceOptions);
@overload
def NetworkAttachment(resource_name: str,
                      args: NetworkAttachmentArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def NetworkAttachment(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      connection_preference: Optional[str] = None,
                      subnetworks: Optional[Sequence[str]] = None,
                      description: Optional[str] = None,
                      name: Optional[str] = None,
                      producer_accept_lists: Optional[Sequence[str]] = None,
                      producer_reject_lists: Optional[Sequence[str]] = None,
                      project: Optional[str] = None,
                      region: Optional[str] = None)
func NewNetworkAttachment(ctx *Context, name string, args NetworkAttachmentArgs, opts ...ResourceOption) (*NetworkAttachment, error)
public NetworkAttachment(string name, NetworkAttachmentArgs args, CustomResourceOptions? opts = null)
public NetworkAttachment(String name, NetworkAttachmentArgs args)
public NetworkAttachment(String name, NetworkAttachmentArgs args, CustomResourceOptions options)
type: gcp:compute:NetworkAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NetworkAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NetworkAttachmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NetworkAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var networkAttachmentResource = new Gcp.Compute.NetworkAttachment("networkAttachmentResource", new()
{
    ConnectionPreference = "string",
    Subnetworks = new[]
    {
        "string",
    },
    Description = "string",
    Name = "string",
    ProducerAcceptLists = new[]
    {
        "string",
    },
    ProducerRejectLists = new[]
    {
        "string",
    },
    Project = "string",
    Region = "string",
});
Copy
example, err := compute.NewNetworkAttachment(ctx, "networkAttachmentResource", &compute.NetworkAttachmentArgs{
	ConnectionPreference: pulumi.String("string"),
	Subnetworks: pulumi.StringArray{
		pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	ProducerAcceptLists: pulumi.StringArray{
		pulumi.String("string"),
	},
	ProducerRejectLists: pulumi.StringArray{
		pulumi.String("string"),
	},
	Project: pulumi.String("string"),
	Region:  pulumi.String("string"),
})
Copy
var networkAttachmentResource = new NetworkAttachment("networkAttachmentResource", NetworkAttachmentArgs.builder()
    .connectionPreference("string")
    .subnetworks("string")
    .description("string")
    .name("string")
    .producerAcceptLists("string")
    .producerRejectLists("string")
    .project("string")
    .region("string")
    .build());
Copy
network_attachment_resource = gcp.compute.NetworkAttachment("networkAttachmentResource",
    connection_preference="string",
    subnetworks=["string"],
    description="string",
    name="string",
    producer_accept_lists=["string"],
    producer_reject_lists=["string"],
    project="string",
    region="string")
Copy
const networkAttachmentResource = new gcp.compute.NetworkAttachment("networkAttachmentResource", {
    connectionPreference: "string",
    subnetworks: ["string"],
    description: "string",
    name: "string",
    producerAcceptLists: ["string"],
    producerRejectLists: ["string"],
    project: "string",
    region: "string",
});
Copy
type: gcp:compute:NetworkAttachment
properties:
    connectionPreference: string
    description: string
    name: string
    producerAcceptLists:
        - string
    producerRejectLists:
        - string
    project: string
    region: string
    subnetworks:
        - string
Copy

NetworkAttachment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The NetworkAttachment resource accepts the following input properties:

ConnectionPreference
This property is required.
Changes to this property will trigger replacement.
string
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
Subnetworks
This property is required.
Changes to this property will trigger replacement.
List<string>
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
Name Changes to this property will trigger replacement. string
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.
ProducerAcceptLists Changes to this property will trigger replacement. List<string>
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
ProducerRejectLists Changes to this property will trigger replacement. List<string>
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


ConnectionPreference
This property is required.
Changes to this property will trigger replacement.
string
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
Subnetworks
This property is required.
Changes to this property will trigger replacement.
[]string
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
Name Changes to this property will trigger replacement. string
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.
ProducerAcceptLists Changes to this property will trigger replacement. []string
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
ProducerRejectLists Changes to this property will trigger replacement. []string
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


connectionPreference
This property is required.
Changes to this property will trigger replacement.
String
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
subnetworks
This property is required.
Changes to this property will trigger replacement.
List<String>
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
name Changes to this property will trigger replacement. String
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.
producerAcceptLists Changes to this property will trigger replacement. List<String>
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectLists Changes to this property will trigger replacement. List<String>
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


connectionPreference
This property is required.
Changes to this property will trigger replacement.
string
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
subnetworks
This property is required.
Changes to this property will trigger replacement.
string[]
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
name Changes to this property will trigger replacement. string
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.
producerAcceptLists Changes to this property will trigger replacement. string[]
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectLists Changes to this property will trigger replacement. string[]
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


connection_preference
This property is required.
Changes to this property will trigger replacement.
str
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
subnetworks
This property is required.
Changes to this property will trigger replacement.
Sequence[str]
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
description Changes to this property will trigger replacement. str
An optional description of this resource. Provide this property when you create the resource.
name Changes to this property will trigger replacement. 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.
producer_accept_lists Changes to this property will trigger replacement. Sequence[str]
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producer_reject_lists Changes to this property will trigger replacement. Sequence[str]
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


connectionPreference
This property is required.
Changes to this property will trigger replacement.
String
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
subnetworks
This property is required.
Changes to this property will trigger replacement.
List<String>
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
name Changes to this property will trigger replacement. String
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.
producerAcceptLists Changes to this property will trigger replacement. List<String>
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectLists Changes to this property will trigger replacement. List<String>
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


Outputs

All input properties are implicitly available as output properties. Additionally, the NetworkAttachment resource produces the following output properties:

ConnectionEndpoints List<NetworkAttachmentConnectionEndpoint>
An array of connections for all the producers connected to this network attachment. Structure is documented below.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Fingerprint string
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
Id string
The provider-assigned unique ID for this managed resource.
Kind string
Type of the resource.
Network string
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
SelfLink string
Server-defined URL for the resource.
SelfLinkWithId string
Server-defined URL for this resource's resource id.
ConnectionEndpoints []NetworkAttachmentConnectionEndpoint
An array of connections for all the producers connected to this network attachment. Structure is documented below.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Fingerprint string
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
Id string
The provider-assigned unique ID for this managed resource.
Kind string
Type of the resource.
Network string
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
SelfLink string
Server-defined URL for the resource.
SelfLinkWithId string
Server-defined URL for this resource's resource id.
connectionEndpoints List<NetworkAttachmentConnectionEndpoint>
An array of connections for all the producers connected to this network attachment. Structure is documented below.
creationTimestamp String
Creation timestamp in RFC3339 text format.
fingerprint String
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
id String
The provider-assigned unique ID for this managed resource.
kind String
Type of the resource.
network String
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
selfLink String
Server-defined URL for the resource.
selfLinkWithId String
Server-defined URL for this resource's resource id.
connectionEndpoints NetworkAttachmentConnectionEndpoint[]
An array of connections for all the producers connected to this network attachment. Structure is documented below.
creationTimestamp string
Creation timestamp in RFC3339 text format.
fingerprint string
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
id string
The provider-assigned unique ID for this managed resource.
kind string
Type of the resource.
network string
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
selfLink string
Server-defined URL for the resource.
selfLinkWithId string
Server-defined URL for this resource's resource id.
connection_endpoints Sequence[NetworkAttachmentConnectionEndpoint]
An array of connections for all the producers connected to this network attachment. Structure is documented below.
creation_timestamp str
Creation timestamp in RFC3339 text format.
fingerprint str
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
id str
The provider-assigned unique ID for this managed resource.
kind str
Type of the resource.
network str
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
self_link str
Server-defined URL for the resource.
self_link_with_id str
Server-defined URL for this resource's resource id.
connectionEndpoints List<Property Map>
An array of connections for all the producers connected to this network attachment. Structure is documented below.
creationTimestamp String
Creation timestamp in RFC3339 text format.
fingerprint String
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
id String
The provider-assigned unique ID for this managed resource.
kind String
Type of the resource.
network String
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
selfLink String
Server-defined URL for the resource.
selfLinkWithId String
Server-defined URL for this resource's resource id.

Look up Existing NetworkAttachment Resource

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

public static get(name: string, id: Input<ID>, state?: NetworkAttachmentState, opts?: CustomResourceOptions): NetworkAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        connection_endpoints: Optional[Sequence[NetworkAttachmentConnectionEndpointArgs]] = None,
        connection_preference: Optional[str] = None,
        creation_timestamp: Optional[str] = None,
        description: Optional[str] = None,
        fingerprint: Optional[str] = None,
        kind: Optional[str] = None,
        name: Optional[str] = None,
        network: Optional[str] = None,
        producer_accept_lists: Optional[Sequence[str]] = None,
        producer_reject_lists: Optional[Sequence[str]] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        self_link: Optional[str] = None,
        self_link_with_id: Optional[str] = None,
        subnetworks: Optional[Sequence[str]] = None) -> NetworkAttachment
func GetNetworkAttachment(ctx *Context, name string, id IDInput, state *NetworkAttachmentState, opts ...ResourceOption) (*NetworkAttachment, error)
public static NetworkAttachment Get(string name, Input<string> id, NetworkAttachmentState? state, CustomResourceOptions? opts = null)
public static NetworkAttachment get(String name, Output<String> id, NetworkAttachmentState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:NetworkAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ConnectionEndpoints List<NetworkAttachmentConnectionEndpoint>
An array of connections for all the producers connected to this network attachment. Structure is documented below.
ConnectionPreference Changes to this property will trigger replacement. string
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
Fingerprint string
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
Kind string
Type of the resource.
Name Changes to this property will trigger replacement. string
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 string
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
ProducerAcceptLists Changes to this property will trigger replacement. List<string>
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
ProducerRejectLists Changes to this property will trigger replacement. List<string>
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


SelfLink string
Server-defined URL for the resource.
SelfLinkWithId string
Server-defined URL for this resource's resource id.
Subnetworks Changes to this property will trigger replacement. List<string>
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
ConnectionEndpoints []NetworkAttachmentConnectionEndpointArgs
An array of connections for all the producers connected to this network attachment. Structure is documented below.
ConnectionPreference Changes to this property will trigger replacement. string
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
Fingerprint string
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
Kind string
Type of the resource.
Name Changes to this property will trigger replacement. string
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 string
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
ProducerAcceptLists Changes to this property will trigger replacement. []string
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
ProducerRejectLists Changes to this property will trigger replacement. []string
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


SelfLink string
Server-defined URL for the resource.
SelfLinkWithId string
Server-defined URL for this resource's resource id.
Subnetworks Changes to this property will trigger replacement. []string
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
connectionEndpoints List<NetworkAttachmentConnectionEndpoint>
An array of connections for all the producers connected to this network attachment. Structure is documented below.
connectionPreference Changes to this property will trigger replacement. String
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
fingerprint String
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
kind String
Type of the resource.
name Changes to this property will trigger replacement. String
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 String
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
producerAcceptLists Changes to this property will trigger replacement. List<String>
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectLists Changes to this property will trigger replacement. List<String>
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


selfLink String
Server-defined URL for the resource.
selfLinkWithId String
Server-defined URL for this resource's resource id.
subnetworks Changes to this property will trigger replacement. List<String>
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
connectionEndpoints NetworkAttachmentConnectionEndpoint[]
An array of connections for all the producers connected to this network attachment. Structure is documented below.
connectionPreference Changes to this property will trigger replacement. string
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
creationTimestamp string
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
fingerprint string
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
kind string
Type of the resource.
name Changes to this property will trigger replacement. string
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 string
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
producerAcceptLists Changes to this property will trigger replacement. string[]
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectLists Changes to this property will trigger replacement. string[]
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


selfLink string
Server-defined URL for the resource.
selfLinkWithId string
Server-defined URL for this resource's resource id.
subnetworks Changes to this property will trigger replacement. string[]
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
connection_endpoints Sequence[NetworkAttachmentConnectionEndpointArgs]
An array of connections for all the producers connected to this network attachment. Structure is documented below.
connection_preference Changes to this property will trigger replacement. str
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
creation_timestamp str
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. str
An optional description of this resource. Provide this property when you create the resource.
fingerprint str
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
kind str
Type of the resource.
name Changes to this property will trigger replacement. 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 str
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
producer_accept_lists Changes to this property will trigger replacement. Sequence[str]
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producer_reject_lists Changes to this property will trigger replacement. Sequence[str]
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


self_link str
Server-defined URL for the resource.
self_link_with_id str
Server-defined URL for this resource's resource id.
subnetworks Changes to this property will trigger replacement. Sequence[str]
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.
connectionEndpoints List<Property Map>
An array of connections for all the producers connected to this network attachment. Structure is documented below.
connectionPreference Changes to this property will trigger replacement. String
The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. Possible values are: ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
fingerprint String
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
kind String
Type of the resource.
name Changes to this property will trigger replacement. String
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 String
The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
producerAcceptLists Changes to this property will trigger replacement. List<String>
Projects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectLists Changes to this property will trigger replacement. List<String>
Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.


selfLink String
Server-defined URL for the resource.
selfLinkWithId String
Server-defined URL for this resource's resource id.
subnetworks Changes to this property will trigger replacement. List<String>
An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.

Supporting Types

NetworkAttachmentConnectionEndpoint
, NetworkAttachmentConnectionEndpointArgs

IpAddress string
(Output) The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
ProjectIdOrNum string
(Output) The project id or number of the interface to which the IP was assigned.
SecondaryIpCidrRanges string
(Output) Alias IP ranges from the same subnetwork.
Status string
(Output) The status of a connected endpoint to this network attachment.
Subnetwork string
(Output) The subnetwork used to assign the IP to the producer instance network interface.
IpAddress string
(Output) The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
ProjectIdOrNum string
(Output) The project id or number of the interface to which the IP was assigned.
SecondaryIpCidrRanges string
(Output) Alias IP ranges from the same subnetwork.
Status string
(Output) The status of a connected endpoint to this network attachment.
Subnetwork string
(Output) The subnetwork used to assign the IP to the producer instance network interface.
ipAddress String
(Output) The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
projectIdOrNum String
(Output) The project id or number of the interface to which the IP was assigned.
secondaryIpCidrRanges String
(Output) Alias IP ranges from the same subnetwork.
status String
(Output) The status of a connected endpoint to this network attachment.
subnetwork String
(Output) The subnetwork used to assign the IP to the producer instance network interface.
ipAddress string
(Output) The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
projectIdOrNum string
(Output) The project id or number of the interface to which the IP was assigned.
secondaryIpCidrRanges string
(Output) Alias IP ranges from the same subnetwork.
status string
(Output) The status of a connected endpoint to this network attachment.
subnetwork string
(Output) The subnetwork used to assign the IP to the producer instance network interface.
ip_address str
(Output) The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
project_id_or_num str
(Output) The project id or number of the interface to which the IP was assigned.
secondary_ip_cidr_ranges str
(Output) Alias IP ranges from the same subnetwork.
status str
(Output) The status of a connected endpoint to this network attachment.
subnetwork str
(Output) The subnetwork used to assign the IP to the producer instance network interface.
ipAddress String
(Output) The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
projectIdOrNum String
(Output) The project id or number of the interface to which the IP was assigned.
secondaryIpCidrRanges String
(Output) Alias IP ranges from the same subnetwork.
status String
(Output) The status of a connected endpoint to this network attachment.
subnetwork String
(Output) The subnetwork used to assign the IP to the producer instance network interface.

Import

NetworkAttachment can be imported using any of these accepted formats:

  • projects/{{project}}/regions/{{region}}/networkAttachments/{{name}}

  • {{project}}/{{region}}/{{name}}

  • {{region}}/{{name}}

  • {{name}}

When using the pulumi import command, NetworkAttachment can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/networkAttachment:NetworkAttachment default projects/{{project}}/regions/{{region}}/networkAttachments/{{name}}
Copy
$ pulumi import gcp:compute/networkAttachment:NetworkAttachment default {{project}}/{{region}}/{{name}}
Copy
$ pulumi import gcp:compute/networkAttachment:NetworkAttachment default {{region}}/{{name}}
Copy
$ pulumi import gcp:compute/networkAttachment:NetworkAttachment default {{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.