alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.vpc.RouterInterfaceConnection

Import

The router interface connection can be imported using the id, e.g.

 $ pulumi import alicloud:vpc/routerInterfaceConnection:RouterInterfaceConnection foo ri-abc123456

Example Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var region = config.Get("region") ?? "cn-hangzhou";
    var name = config.Get("name") ?? "alicloudRouterInterfaceConnectionBasic";
    var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
    {
        VpcName = name,
        CidrBlock = "172.16.0.0/12",
    });

    var barNetwork = new AliCloud.Vpc.Network("barNetwork", new()
    {
        VpcName = name,
        CidrBlock = "192.168.0.0/16",
    }, new CustomResourceOptions
    {
        Provider = alicloud,
    });

    var initiate = new AliCloud.Vpc.RouterInterface("initiate", new()
    {
        OppositeRegion = region,
        RouterType = "VRouter",
        RouterId = fooNetwork.RouterId,
        Role = "InitiatingSide",
        Specification = "Large.2",
        Description = name,
        InstanceChargeType = "PostPaid",
    });

    var opposite = new AliCloud.Vpc.RouterInterface("opposite", new()
    {
        OppositeRegion = region,
        RouterType = "VRouter",
        RouterId = barNetwork.RouterId,
        Role = "AcceptingSide",
        Specification = "Large.1",
        Description = $"{name}-opposite",
    }, new CustomResourceOptions
    {
        Provider = alicloud,
    });

    var barRouterInterfaceConnection = new AliCloud.Vpc.RouterInterfaceConnection("barRouterInterfaceConnection", new()
    {
        InterfaceId = opposite.Id,
        OppositeInterfaceId = initiate.Id,
    }, new CustomResourceOptions
    {
        Provider = alicloud,
    });

    // A integrated router interface connection tunnel requires both InitiatingSide and AcceptingSide configuring opposite router interface.
    var fooRouterInterfaceConnection = new AliCloud.Vpc.RouterInterfaceConnection("fooRouterInterfaceConnection", new()
    {
        InterfaceId = initiate.Id,
        OppositeInterfaceId = opposite.Id,
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            barRouterInterfaceConnection,
        },
    });

    // The connection must start from the accepting side.
});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		region := "cn-hangzhou"
		if param := cfg.Get("region"); param != "" {
			region = param
		}
		name := "alicloudRouterInterfaceConnectionBasic"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		fooNetwork, err := vpc.NewNetwork(ctx, "fooNetwork", &vpc.NetworkArgs{
			VpcName:   pulumi.String(name),
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		barNetwork, err := vpc.NewNetwork(ctx, "barNetwork", &vpc.NetworkArgs{
			VpcName:   pulumi.String(name),
			CidrBlock: pulumi.String("192.168.0.0/16"),
		}, pulumi.Provider(alicloud))
		if err != nil {
			return err
		}
		initiate, err := vpc.NewRouterInterface(ctx, "initiate", &vpc.RouterInterfaceArgs{
			OppositeRegion:     pulumi.String(region),
			RouterType:         pulumi.String("VRouter"),
			RouterId:           fooNetwork.RouterId,
			Role:               pulumi.String("InitiatingSide"),
			Specification:      pulumi.String("Large.2"),
			Description:        pulumi.String(name),
			InstanceChargeType: pulumi.String("PostPaid"),
		})
		if err != nil {
			return err
		}
		opposite, err := vpc.NewRouterInterface(ctx, "opposite", &vpc.RouterInterfaceArgs{
			OppositeRegion: pulumi.String(region),
			RouterType:     pulumi.String("VRouter"),
			RouterId:       barNetwork.RouterId,
			Role:           pulumi.String("AcceptingSide"),
			Specification:  pulumi.String("Large.1"),
			Description:    pulumi.String(fmt.Sprintf("%v-opposite", name)),
		}, pulumi.Provider(alicloud))
		if err != nil {
			return err
		}
		barRouterInterfaceConnection, err := vpc.NewRouterInterfaceConnection(ctx, "barRouterInterfaceConnection", &vpc.RouterInterfaceConnectionArgs{
			InterfaceId:         opposite.ID(),
			OppositeInterfaceId: initiate.ID(),
		}, pulumi.Provider(alicloud))
		if err != nil {
			return err
		}
		_, err = vpc.NewRouterInterfaceConnection(ctx, "fooRouterInterfaceConnection", &vpc.RouterInterfaceConnectionArgs{
			InterfaceId:         initiate.ID(),
			OppositeInterfaceId: opposite.ID(),
		}, pulumi.DependsOn([]pulumi.Resource{
			barRouterInterfaceConnection,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.RouterInterface;
import com.pulumi.alicloud.vpc.RouterInterfaceArgs;
import com.pulumi.alicloud.vpc.RouterInterfaceConnection;
import com.pulumi.alicloud.vpc.RouterInterfaceConnectionArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
        final var config = ctx.config();
        final var region = config.get("region").orElse("cn-hangzhou");
        final var name = config.get("name").orElse("alicloudRouterInterfaceConnectionBasic");
        var fooNetwork = new Network("fooNetwork", NetworkArgs.builder()        
            .vpcName(name)
            .cidrBlock("172.16.0.0/12")
            .build());

        var barNetwork = new Network("barNetwork", NetworkArgs.builder()        
            .vpcName(name)
            .cidrBlock("192.168.0.0/16")
            .build(), CustomResourceOptions.builder()
                .provider(alicloud)
                .build());

        var initiate = new RouterInterface("initiate", RouterInterfaceArgs.builder()        
            .oppositeRegion(region)
            .routerType("VRouter")
            .routerId(fooNetwork.routerId())
            .role("InitiatingSide")
            .specification("Large.2")
            .description(name)
            .instanceChargeType("PostPaid")
            .build());

        var opposite = new RouterInterface("opposite", RouterInterfaceArgs.builder()        
            .oppositeRegion(region)
            .routerType("VRouter")
            .routerId(barNetwork.routerId())
            .role("AcceptingSide")
            .specification("Large.1")
            .description(String.format("%s-opposite", name))
            .build(), CustomResourceOptions.builder()
                .provider(alicloud)
                .build());

        var barRouterInterfaceConnection = new RouterInterfaceConnection("barRouterInterfaceConnection", RouterInterfaceConnectionArgs.builder()        
            .interfaceId(opposite.id())
            .oppositeInterfaceId(initiate.id())
            .build(), CustomResourceOptions.builder()
                .provider(alicloud)
                .build());

        var fooRouterInterfaceConnection = new RouterInterfaceConnection("fooRouterInterfaceConnection", RouterInterfaceConnectionArgs.builder()        
            .interfaceId(initiate.id())
            .oppositeInterfaceId(opposite.id())
            .build(), CustomResourceOptions.builder()
                .dependsOn(barRouterInterfaceConnection)
                .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
region = config.get("region")
if region is None:
    region = "cn-hangzhou"
name = config.get("name")
if name is None:
    name = "alicloudRouterInterfaceConnectionBasic"
foo_network = alicloud.vpc.Network("fooNetwork",
    vpc_name=name,
    cidr_block="172.16.0.0/12")
bar_network = alicloud.vpc.Network("barNetwork",
    vpc_name=name,
    cidr_block="192.168.0.0/16",
    opts=pulumi.ResourceOptions(provider=alicloud))
initiate = alicloud.vpc.RouterInterface("initiate",
    opposite_region=region,
    router_type="VRouter",
    router_id=foo_network.router_id,
    role="InitiatingSide",
    specification="Large.2",
    description=name,
    instance_charge_type="PostPaid")
opposite = alicloud.vpc.RouterInterface("opposite",
    opposite_region=region,
    router_type="VRouter",
    router_id=bar_network.router_id,
    role="AcceptingSide",
    specification="Large.1",
    description=f"{name}-opposite",
    opts=pulumi.ResourceOptions(provider=alicloud))
bar_router_interface_connection = alicloud.vpc.RouterInterfaceConnection("barRouterInterfaceConnection",
    interface_id=opposite.id,
    opposite_interface_id=initiate.id,
    opts=pulumi.ResourceOptions(provider=alicloud))
# A integrated router interface connection tunnel requires both InitiatingSide and AcceptingSide configuring opposite router interface.
foo_router_interface_connection = alicloud.vpc.RouterInterfaceConnection("fooRouterInterfaceConnection",
    interface_id=initiate.id,
    opposite_interface_id=opposite.id,
    opts=pulumi.ResourceOptions(depends_on=[bar_router_interface_connection]))
# The connection must start from the accepting side.
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const region = config.get("region") || "cn-hangzhou";
const name = config.get("name") || "alicloudRouterInterfaceConnectionBasic";
const fooNetwork = new alicloud.vpc.Network("fooNetwork", {
    vpcName: name,
    cidrBlock: "172.16.0.0/12",
});
const barNetwork = new alicloud.vpc.Network("barNetwork", {
    vpcName: name,
    cidrBlock: "192.168.0.0/16",
}, {
    provider: alicloud,
});
const initiate = new alicloud.vpc.RouterInterface("initiate", {
    oppositeRegion: region,
    routerType: "VRouter",
    routerId: fooNetwork.routerId,
    role: "InitiatingSide",
    specification: "Large.2",
    description: name,
    instanceChargeType: "PostPaid",
});
const opposite = new alicloud.vpc.RouterInterface("opposite", {
    oppositeRegion: region,
    routerType: "VRouter",
    routerId: barNetwork.routerId,
    role: "AcceptingSide",
    specification: "Large.1",
    description: `${name}-opposite`,
}, {
    provider: alicloud,
});
const barRouterInterfaceConnection = new alicloud.vpc.RouterInterfaceConnection("barRouterInterfaceConnection", {
    interfaceId: opposite.id,
    oppositeInterfaceId: initiate.id,
}, {
    provider: alicloud,
});
// A integrated router interface connection tunnel requires both InitiatingSide and AcceptingSide configuring opposite router interface.
const fooRouterInterfaceConnection = new alicloud.vpc.RouterInterfaceConnection("fooRouterInterfaceConnection", {
    interfaceId: initiate.id,
    oppositeInterfaceId: opposite.id,
}, {
    dependsOn: [barRouterInterfaceConnection],
});
// The connection must start from the accepting side.
configuration:
  region:
    type: string
    default: cn-hangzhou
  name:
    type: string
    default: alicloudRouterInterfaceConnectionBasic
resources:
  fooNetwork:
    type: alicloud:vpc:Network
    properties:
      vpcName: ${name}
      cidrBlock: 172.16.0.0/12
  barNetwork:
    type: alicloud:vpc:Network
    properties:
      vpcName: ${name}
      cidrBlock: 192.168.0.0/16
    options:
      provider: ${alicloud}
  initiate:
    type: alicloud:vpc:RouterInterface
    properties:
      oppositeRegion: ${region}
      routerType: VRouter
      routerId: ${fooNetwork.routerId}
      role: InitiatingSide
      specification: Large.2
      description: ${name}
      instanceChargeType: PostPaid
  opposite:
    type: alicloud:vpc:RouterInterface
    properties:
      oppositeRegion: ${region}
      routerType: VRouter
      routerId: ${barNetwork.routerId}
      role: AcceptingSide
      specification: Large.1
      description: ${name}-opposite
    options:
      provider: ${alicloud}
  # A integrated router interface connection tunnel requires both InitiatingSide and AcceptingSide configuring opposite router interface.
  fooRouterInterfaceConnection:
    type: alicloud:vpc:RouterInterfaceConnection
    properties:
      interfaceId: ${initiate.id}
      oppositeInterfaceId: ${opposite.id}
    options:
      dependson:
        - ${barRouterInterfaceConnection}
  barRouterInterfaceConnection:
    type: alicloud:vpc:RouterInterfaceConnection
    properties:
      interfaceId: ${opposite.id}
      oppositeInterfaceId: ${initiate.id}
    options:
      provider: ${alicloud}

Create RouterInterfaceConnection Resource

new RouterInterfaceConnection(name: string, args: RouterInterfaceConnectionArgs, opts?: CustomResourceOptions);
@overload
def RouterInterfaceConnection(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              interface_id: Optional[str] = None,
                              opposite_interface_id: Optional[str] = None,
                              opposite_interface_owner_id: Optional[str] = None,
                              opposite_router_id: Optional[str] = None,
                              opposite_router_type: Optional[str] = None)
@overload
def RouterInterfaceConnection(resource_name: str,
                              args: RouterInterfaceConnectionArgs,
                              opts: Optional[ResourceOptions] = None)
func NewRouterInterfaceConnection(ctx *Context, name string, args RouterInterfaceConnectionArgs, opts ...ResourceOption) (*RouterInterfaceConnection, error)
public RouterInterfaceConnection(string name, RouterInterfaceConnectionArgs args, CustomResourceOptions? opts = null)
public RouterInterfaceConnection(String name, RouterInterfaceConnectionArgs args)
public RouterInterfaceConnection(String name, RouterInterfaceConnectionArgs args, CustomResourceOptions options)
type: alicloud:vpc:RouterInterfaceConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

RouterInterfaceConnection Resource Properties

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

Inputs

The RouterInterfaceConnection resource accepts the following input properties:

InterfaceId string

One side router interface ID.

OppositeInterfaceId string

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

OppositeInterfaceOwnerId string
OppositeRouterId string

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

OppositeRouterType string

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

InterfaceId string

One side router interface ID.

OppositeInterfaceId string

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

OppositeInterfaceOwnerId string
OppositeRouterId string

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

OppositeRouterType string

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interfaceId String

One side router interface ID.

oppositeInterfaceId String

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

oppositeInterfaceOwnerId String
oppositeRouterId String

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

oppositeRouterType String

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interfaceId string

One side router interface ID.

oppositeInterfaceId string

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

oppositeInterfaceOwnerId string
oppositeRouterId string

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

oppositeRouterType string

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interface_id str

One side router interface ID.

opposite_interface_id str

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

opposite_interface_owner_id str
opposite_router_id str

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

opposite_router_type str

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interfaceId String

One side router interface ID.

oppositeInterfaceId String

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

oppositeInterfaceOwnerId String
oppositeRouterId String

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

oppositeRouterType String

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing RouterInterfaceConnection Resource

Get an existing RouterInterfaceConnection 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?: RouterInterfaceConnectionState, opts?: CustomResourceOptions): RouterInterfaceConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        interface_id: Optional[str] = None,
        opposite_interface_id: Optional[str] = None,
        opposite_interface_owner_id: Optional[str] = None,
        opposite_router_id: Optional[str] = None,
        opposite_router_type: Optional[str] = None) -> RouterInterfaceConnection
func GetRouterInterfaceConnection(ctx *Context, name string, id IDInput, state *RouterInterfaceConnectionState, opts ...ResourceOption) (*RouterInterfaceConnection, error)
public static RouterInterfaceConnection Get(string name, Input<string> id, RouterInterfaceConnectionState? state, CustomResourceOptions? opts = null)
public static RouterInterfaceConnection get(String name, Output<String> id, RouterInterfaceConnectionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:
InterfaceId string

One side router interface ID.

OppositeInterfaceId string

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

OppositeInterfaceOwnerId string
OppositeRouterId string

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

OppositeRouterType string

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

InterfaceId string

One side router interface ID.

OppositeInterfaceId string

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

OppositeInterfaceOwnerId string
OppositeRouterId string

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

OppositeRouterType string

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interfaceId String

One side router interface ID.

oppositeInterfaceId String

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

oppositeInterfaceOwnerId String
oppositeRouterId String

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

oppositeRouterType String

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interfaceId string

One side router interface ID.

oppositeInterfaceId string

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

oppositeInterfaceOwnerId string
oppositeRouterId string

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

oppositeRouterType string

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interface_id str

One side router interface ID.

opposite_interface_id str

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

opposite_interface_owner_id str
opposite_router_id str

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

opposite_router_type str

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

interfaceId String

One side router interface ID.

oppositeInterfaceId String

Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.

oppositeInterfaceOwnerId String
oppositeRouterId String

Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.

oppositeRouterType String

Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.