Transport class

The Transport resource is a top-level resource used by customers to control Partner Cross-Cloud Interconnect (CCI) connections.

To get more information about Transport, see:

Example Usage

Network Connectivity Transport Basic

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

const project = gcp.organizations.getProject({});
const primary_network = new gcp.compute.Network("primary-network", {
    name: "tf-test-my-vpc-network_14939",
    autoCreateSubnetworks: false,
});
const primary = new gcp.networkconnectivity.Transport("primary", {
    name: "tf-test-basic-transport_59865",
    region: "us-east4",
    description: "A sample transport",
    remoteProfile: project.then(project => `https://networkconnectivity.googleapis.com/v1/${project.id}/locations/us-east4/remoteTransportProfiles/aws-us-east-1`),
    network: primary_network.name,
    bandwidth: "BPS_1G",
    remoteAccountId: "123",
    labels: {
        "label-one": "value-one",
    },
});
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.get_project()
primary_network = gcp.compute.Network("primary-network",
    name="tf-test-my-vpc-network_14939",
    auto_create_subnetworks=False)
primary = gcp.networkconnectivity.Transport("primary",
    name="tf-test-basic-transport_59865",
    region="us-east4",
    description="A sample transport",
    remote_profile=f"https://networkconnectivity.googleapis.com/v1/{project.id}/locations/us-east4/remoteTransportProfiles/aws-us-east-1",
    network=primary_network.name,
    bandwidth="BPS_1G",
    remote_account_id="123",
    labels={
        "label-one": "value-one",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var project = Gcp.Organizations.GetProject.Invoke();

    var primary_network = new Gcp.Compute.Network("primary-network", new()
    {
        Name = "tf-test-my-vpc-network_14939",
        AutoCreateSubnetworks = false,
    });

    var primary = new Gcp.NetworkConnectivity.Transport("primary", new()
    {
        Name = "tf-test-basic-transport_59865",
        Region = "us-east4",
        Description = "A sample transport",
        RemoteProfile = $"https://networkconnectivity.googleapis.com/v1/{project.Apply(getProjectResult => getProjectResult.Id)}/locations/us-east4/remoteTransportProfiles/aws-us-east-1",
        Network = primary_network.Name,
        Bandwidth = "BPS_1G",
        RemoteAccountId = "123",
        Labels =
        {
            { "label-one", "value-one" },
        },
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		primary_network, err := compute.NewNetwork(ctx, "primary-network", &compute.NetworkArgs{
			Name:                  pulumi.String("tf-test-my-vpc-network_14939"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = networkconnectivity.NewTransport(ctx, "primary", &networkconnectivity.TransportArgs{
			Name:            pulumi.String("tf-test-basic-transport_59865"),
			Region:          pulumi.String("us-east4"),
			Description:     pulumi.String("A sample transport"),
			RemoteProfile:   pulumi.Sprintf("https://networkconnectivity.googleapis.com/v1/%v/locations/us-east4/remoteTransportProfiles/aws-us-east-1", project.Id),
			Network:         primary_network.Name,
			Bandwidth:       pulumi.String("BPS_1G"),
			RemoteAccountId: pulumi.String("123"),
			Labels: pulumi.StringMap{
				"label-one": pulumi.String("value-one"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_organizations_getproject" "project" {
}

resource "gcp_compute_network" "primary-network" {
  name                    = "tf-test-my-vpc-network_14939"
  auto_create_subnetworks = false
}
resource "gcp_networkconnectivity_transport" "primary" {
  name              = "tf-test-basic-transport_59865"
  region            = "us-east4"
  description       = "A sample transport"
  remote_profile    ="https://networkconnectivity.googleapis.com/v1/${data.gcp_organizations_getproject.project.id}/locations/us-east4/remoteTransportProfiles/aws-us-east-1"
  network           = gcp_compute_network.primary-network.name
  bandwidth         = "BPS_1G"
  remote_account_id = "123"
  labels = {
    "label-one" = "value-one"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.networkconnectivity.Transport;
import com.pulumi.gcp.networkconnectivity.TransportArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

        var primary_network = new Network("primary-network", NetworkArgs.builder()
            .name("tf-test-my-vpc-network_14939")
            .autoCreateSubnetworks(false)
            .build());

        var primary = new Transport("primary", TransportArgs.builder()
            .name("tf-test-basic-transport_59865")
            .region("us-east4")
            .description("A sample transport")
            .remoteProfile(String.format("https://networkconnectivity.googleapis.com/v1/%s/locations/us-east4/remoteTransportProfiles/aws-us-east-1", project.id()))
            .network(primary_network.name())
            .bandwidth("BPS_1G")
            .remoteAccountId("123")
            .labels(Map.of("label-one", "value-one"))
            .build());

    }
}
resources:
  primary-network:
    type: gcp:compute:Network
    properties:
      name: tf-test-my-vpc-network_14939
      autoCreateSubnetworks: false
  primary:
    type: gcp:networkconnectivity:Transport
    properties:
      name: tf-test-basic-transport_59865
      region: us-east4
      description: A sample transport
      remoteProfile: https://networkconnectivity.googleapis.com/v1/${project.id}/locations/us-east4/remoteTransportProfiles/aws-us-east-1
      network: ${["primary-network"].name}
      bandwidth: BPS_1G
      remoteAccountId: '123'
      labels:
        label-one: value-one
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}

Import

Transport can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{region}}/transports/{{name}}
  • {{project}}/{{region}}/{{name}}
  • {{region}}/{{name}}
  • {{name}}

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

$ pulumi import gcp:networkconnectivity/transport:Transport default projects/{{project}}/locations/{{region}}/transports/{{name}}
$ pulumi import gcp:networkconnectivity/transport:Transport default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:networkconnectivity/transport:Transport default {{region}}/{{name}}
$ pulumi import gcp:networkconnectivity/transport:Transport default {{name}}

Constructors

Transport(String name, {TransportArgs? args, CustomResourceOptions? options})
Creates a new Transport. name The Pulumi resource name. args Arguments used to configure this Transport. The set of arguments for Transport. options Resource options controlling this resource's behavior.
Transport.reference(String urn)
Creates a typed reference to an existing Transport resource.

Properties

adminEnabled ↔ Output<bool?>
(Optional, Beta) Administrative state of the underlying connectivity. If set to true (default), connectivity should be available between your environments. If set to false, the connectivity over these links is disabled. Disabling your Transport does not affect billing, and retains the underlying network bandwidth associated with the connectivity.
latefinal
advertisedRoutes ↔ Output<List<String>?>
List of IP Prefixes that will be advertised to the remote provider. Both IPv4 and IPv6 addresses are supported.
latefinal
autoAccept ↔ Output<bool?>
(Optional, Beta) Controls whether resources proposed by the Transport are automatically accepted on behalf of the user.
latefinal
bandwidth ↔ Output<String>
Bandwidth of the Transport. This must be one of the supported bandwidths for the remote profile.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
description ↔ Output<String?>
An optional description of this resource.
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
generatedActivationKey ↔ Output<String>
Output only Google-generated activation key. This is only output if the selected profile supports an OUTPUT key flow. Inputting this to the provider is only valid while the resource is in a PENDING_KEY state. Once the provider has accepted the key, the resource will move to the CONFIGURING state.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
hub ↔ Output<String?>
(Optional, Beta) The NCC Hub that the Transport should attach to. The hub must be in the same project as the Transport.
latefinal
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
labels ↔ Output<Map<String, String>?>
Optional labels in key:value format. For more information about labels, see Requirements for labels. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.
latefinal
mtuLimit ↔ Output<int?>
Output only The maximum transmission unit (MTU) of a packet that can be sent over this transport.
latefinal
name ↔ Output<String>
Name of the resource, see google.aip.dev/122 for resource naming.
latefinal
network ↔ Output<String?>
Resource URL of the Network that will be peered with this Transport. This field must be provided during resource creation and cannot be changed.
latefinal
peeringNetwork ↔ Output<String>
VPC Network URI that was created for the VPC Peering connection to the provided network. If VPC Peering is disconnected, this can be used to re-establish.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
providedActivationKey ↔ Output<String?>
Key used for establishing a connection with the remote transport. This key can only be provided if the profile supports an INPUT key flow and the resource is in the PENDING_KEY state.
latefinal
pscRoutingEnabled ↔ Output<bool?>
(Optional, Beta) Controls whether a Routing VPC Spoke should be created and attached to the NCC Hub.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
region ↔ Output<String>
The region of this resource. This is required to construct the resource name, but is not sent to the API since the region is already contained in the parent field.
latefinal
remoteAccountId ↔ Output<String?>
The user supplied account id for the CSP associated with the remote profile.
latefinal
remoteProfile ↔ Output<String>
Resource URL of the remoteTransportProfile that this Transport is connecting to.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackType ↔ Output<String>
IP version stack for the established connectivity. Possible values are: IPV4_IPV6, IPV4_ONLY.
latefinal
state ↔ Output<String>
Output Only State of the underlying connectivity.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {TransportState? state, CustomResourceOptions? options}) → Transport
Gets an existing Transport resource's state with the given name and id.