ionoscloud.PrivateCrossconnect
Explore with Pulumi AI
Manages a Cross Connect on IonosCloud. Cross Connect allows you to connect virtual data centers (VDC) with each other using a private LAN. The VDCs to be connected need to belong to the same IONOS Cloud contract and location. You can only use private LANs for a Cross Connect connection. A LAN can only be a part of one Cross Connect.
The IP addresses of the NICs used for the Cross Connect connection may not be used in more than one NIC and they need to belong to the same IP range.
Example Usage
To connect two datacenters we need 2 lans defined, one in each datacenter. After, we reference the cross-connect through which we want the connection to be established.
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const crossConnectTestResource = new ionoscloud.PrivateCrossconnect("crossConnectTestResource", {description: "CrossConnectTestResource"});
const dc1 = new ionoscloud.Datacenter("dc1", {location: "de/txl"});
const dc2 = new ionoscloud.Datacenter("dc2", {location: "de/txl"});
const dc1lan = new ionoscloud.Lan("dc1lan", {
datacenterId: dc1.datacenterId,
"public": false,
pcc: crossConnectTestResource.privateCrossconnectId,
});
const dc2lan = new ionoscloud.Lan("dc2lan", {
datacenterId: dc2.datacenterId,
"public": false,
pcc: crossConnectTestResource.privateCrossconnectId,
});
import pulumi
import pulumi_ionoscloud as ionoscloud
cross_connect_test_resource = ionoscloud.PrivateCrossconnect("crossConnectTestResource", description="CrossConnectTestResource")
dc1 = ionoscloud.Datacenter("dc1", location="de/txl")
dc2 = ionoscloud.Datacenter("dc2", location="de/txl")
dc1lan = ionoscloud.Lan("dc1lan",
datacenter_id=dc1.datacenter_id,
public=False,
pcc=cross_connect_test_resource.private_crossconnect_id)
dc2lan = ionoscloud.Lan("dc2lan",
datacenter_id=dc2.datacenter_id,
public=False,
pcc=cross_connect_test_resource.private_crossconnect_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
crossConnectTestResource, err := ionoscloud.NewPrivateCrossconnect(ctx, "crossConnectTestResource", &ionoscloud.PrivateCrossconnectArgs{
Description: pulumi.String("CrossConnectTestResource"),
})
if err != nil {
return err
}
dc1, err := ionoscloud.NewDatacenter(ctx, "dc1", &ionoscloud.DatacenterArgs{
Location: pulumi.String("de/txl"),
})
if err != nil {
return err
}
dc2, err := ionoscloud.NewDatacenter(ctx, "dc2", &ionoscloud.DatacenterArgs{
Location: pulumi.String("de/txl"),
})
if err != nil {
return err
}
_, err = ionoscloud.NewLan(ctx, "dc1lan", &ionoscloud.LanArgs{
DatacenterId: dc1.DatacenterId,
Public: pulumi.Bool(false),
Pcc: crossConnectTestResource.PrivateCrossconnectId,
})
if err != nil {
return err
}
_, err = ionoscloud.NewLan(ctx, "dc2lan", &ionoscloud.LanArgs{
DatacenterId: dc2.DatacenterId,
Public: pulumi.Bool(false),
Pcc: crossConnectTestResource.PrivateCrossconnectId,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var crossConnectTestResource = new Ionoscloud.PrivateCrossconnect("crossConnectTestResource", new()
{
Description = "CrossConnectTestResource",
});
var dc1 = new Ionoscloud.Datacenter("dc1", new()
{
Location = "de/txl",
});
var dc2 = new Ionoscloud.Datacenter("dc2", new()
{
Location = "de/txl",
});
var dc1lan = new Ionoscloud.Lan("dc1lan", new()
{
DatacenterId = dc1.DatacenterId,
Public = false,
Pcc = crossConnectTestResource.PrivateCrossconnectId,
});
var dc2lan = new Ionoscloud.Lan("dc2lan", new()
{
DatacenterId = dc2.DatacenterId,
Public = false,
Pcc = crossConnectTestResource.PrivateCrossconnectId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.PrivateCrossconnect;
import com.pulumi.ionoscloud.PrivateCrossconnectArgs;
import com.pulumi.ionoscloud.Datacenter;
import com.pulumi.ionoscloud.DatacenterArgs;
import com.pulumi.ionoscloud.Lan;
import com.pulumi.ionoscloud.LanArgs;
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 crossConnectTestResource = new PrivateCrossconnect("crossConnectTestResource", PrivateCrossconnectArgs.builder()
.description("CrossConnectTestResource")
.build());
var dc1 = new Datacenter("dc1", DatacenterArgs.builder()
.location("de/txl")
.build());
var dc2 = new Datacenter("dc2", DatacenterArgs.builder()
.location("de/txl")
.build());
var dc1lan = new Lan("dc1lan", LanArgs.builder()
.datacenterId(dc1.datacenterId())
.public_(false)
.pcc(crossConnectTestResource.privateCrossconnectId())
.build());
var dc2lan = new Lan("dc2lan", LanArgs.builder()
.datacenterId(dc2.datacenterId())
.public_(false)
.pcc(crossConnectTestResource.privateCrossconnectId())
.build());
}
}
resources:
crossConnectTestResource:
type: ionoscloud:PrivateCrossconnect
properties:
description: CrossConnectTestResource
dc1:
type: ionoscloud:Datacenter
properties:
location: de/txl
dc2:
type: ionoscloud:Datacenter
properties:
location: de/txl
dc1lan:
type: ionoscloud:Lan
properties:
datacenterId: ${dc1.datacenterId}
public: false
pcc: ${crossConnectTestResource.privateCrossconnectId}
dc2lan:
type: ionoscloud:Lan
properties:
datacenterId: ${dc2.datacenterId}
public: false
pcc: ${crossConnectTestResource.privateCrossconnectId}
Create PrivateCrossconnect Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateCrossconnect(name: string, args?: PrivateCrossconnectArgs, opts?: CustomResourceOptions);
@overload
def PrivateCrossconnect(resource_name: str,
args: Optional[PrivateCrossconnectArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def PrivateCrossconnect(resource_name: str,
opts: Optional[ResourceOptions] = None,
connectable_datacenters: Optional[Sequence[PrivateCrossconnectConnectableDatacenterArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
peers: Optional[Sequence[PrivateCrossconnectPeerArgs]] = None,
private_crossconnect_id: Optional[str] = None,
timeouts: Optional[PrivateCrossconnectTimeoutsArgs] = None)
func NewPrivateCrossconnect(ctx *Context, name string, args *PrivateCrossconnectArgs, opts ...ResourceOption) (*PrivateCrossconnect, error)
public PrivateCrossconnect(string name, PrivateCrossconnectArgs? args = null, CustomResourceOptions? opts = null)
public PrivateCrossconnect(String name, PrivateCrossconnectArgs args)
public PrivateCrossconnect(String name, PrivateCrossconnectArgs args, CustomResourceOptions options)
type: ionoscloud:PrivateCrossconnect
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PrivateCrossconnectArgs
- 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 PrivateCrossconnectArgs
- 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 PrivateCrossconnectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateCrossconnectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateCrossconnectArgs
- 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 privateCrossconnectResource = new Ionoscloud.PrivateCrossconnect("privateCrossconnectResource", new()
{
ConnectableDatacenters = new[]
{
new Ionoscloud.Inputs.PrivateCrossconnectConnectableDatacenterArgs
{
Id = "string",
Location = "string",
Name = "string",
},
},
Description = "string",
Name = "string",
Peers = new[]
{
new Ionoscloud.Inputs.PrivateCrossconnectPeerArgs
{
DatacenterId = "string",
DatacenterName = "string",
LanId = "string",
LanName = "string",
Location = "string",
},
},
PrivateCrossconnectId = "string",
Timeouts = new Ionoscloud.Inputs.PrivateCrossconnectTimeoutsArgs
{
Create = "string",
Default = "string",
Delete = "string",
Update = "string",
},
});
example, err := ionoscloud.NewPrivateCrossconnect(ctx, "privateCrossconnectResource", &ionoscloud.PrivateCrossconnectArgs{
ConnectableDatacenters: ionoscloud.PrivateCrossconnectConnectableDatacenterArray{
&ionoscloud.PrivateCrossconnectConnectableDatacenterArgs{
Id: pulumi.String("string"),
Location: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Peers: ionoscloud.PrivateCrossconnectPeerArray{
&ionoscloud.PrivateCrossconnectPeerArgs{
DatacenterId: pulumi.String("string"),
DatacenterName: pulumi.String("string"),
LanId: pulumi.String("string"),
LanName: pulumi.String("string"),
Location: pulumi.String("string"),
},
},
PrivateCrossconnectId: pulumi.String("string"),
Timeouts: &ionoscloud.PrivateCrossconnectTimeoutsArgs{
Create: pulumi.String("string"),
Default: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var privateCrossconnectResource = new PrivateCrossconnect("privateCrossconnectResource", PrivateCrossconnectArgs.builder()
.connectableDatacenters(PrivateCrossconnectConnectableDatacenterArgs.builder()
.id("string")
.location("string")
.name("string")
.build())
.description("string")
.name("string")
.peers(PrivateCrossconnectPeerArgs.builder()
.datacenterId("string")
.datacenterName("string")
.lanId("string")
.lanName("string")
.location("string")
.build())
.privateCrossconnectId("string")
.timeouts(PrivateCrossconnectTimeoutsArgs.builder()
.create("string")
.default_("string")
.delete("string")
.update("string")
.build())
.build());
private_crossconnect_resource = ionoscloud.PrivateCrossconnect("privateCrossconnectResource",
connectable_datacenters=[{
"id": "string",
"location": "string",
"name": "string",
}],
description="string",
name="string",
peers=[{
"datacenter_id": "string",
"datacenter_name": "string",
"lan_id": "string",
"lan_name": "string",
"location": "string",
}],
private_crossconnect_id="string",
timeouts={
"create": "string",
"default": "string",
"delete": "string",
"update": "string",
})
const privateCrossconnectResource = new ionoscloud.PrivateCrossconnect("privateCrossconnectResource", {
connectableDatacenters: [{
id: "string",
location: "string",
name: "string",
}],
description: "string",
name: "string",
peers: [{
datacenterId: "string",
datacenterName: "string",
lanId: "string",
lanName: "string",
location: "string",
}],
privateCrossconnectId: "string",
timeouts: {
create: "string",
"default": "string",
"delete": "string",
update: "string",
},
});
type: ionoscloud:PrivateCrossconnect
properties:
connectableDatacenters:
- id: string
location: string
name: string
description: string
name: string
peers:
- datacenterId: string
datacenterName: string
lanId: string
lanName: string
location: string
privateCrossconnectId: string
timeouts:
create: string
default: string
delete: string
update: string
PrivateCrossconnect 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 PrivateCrossconnect resource accepts the following input properties:
- Connectable
Datacenters List<PrivateCrossconnect Connectable Datacenter> - A list containing all the connectable datacenters
- Description string
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- Name string
- [string] The name of the cross-connection.
- Peers
List<Private
Crossconnect Peer> - Lists LAN's joined to this cross connect
- Private
Crossconnect stringId - Timeouts
Private
Crossconnect Timeouts
- Connectable
Datacenters []PrivateCrossconnect Connectable Datacenter Args - A list containing all the connectable datacenters
- Description string
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- Name string
- [string] The name of the cross-connection.
- Peers
[]Private
Crossconnect Peer Args - Lists LAN's joined to this cross connect
- Private
Crossconnect stringId - Timeouts
Private
Crossconnect Timeouts Args
- connectable
Datacenters List<PrivateCrossconnect Connectable Datacenter> - A list containing all the connectable datacenters
- description String
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name String
- [string] The name of the cross-connection.
- peers
List<Private
Crossconnect Peer> - Lists LAN's joined to this cross connect
- private
Crossconnect StringId - timeouts
Private
Crossconnect Timeouts
- connectable
Datacenters PrivateCrossconnect Connectable Datacenter[] - A list containing all the connectable datacenters
- description string
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name string
- [string] The name of the cross-connection.
- peers
Private
Crossconnect Peer[] - Lists LAN's joined to this cross connect
- private
Crossconnect stringId - timeouts
Private
Crossconnect Timeouts
- connectable_
datacenters Sequence[PrivateCrossconnect Connectable Datacenter Args] - A list containing all the connectable datacenters
- description str
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name str
- [string] The name of the cross-connection.
- peers
Sequence[Private
Crossconnect Peer Args] - Lists LAN's joined to this cross connect
- private_
crossconnect_ strid - timeouts
Private
Crossconnect Timeouts Args
- connectable
Datacenters List<Property Map> - A list containing all the connectable datacenters
- description String
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name String
- [string] The name of the cross-connection.
- peers List<Property Map>
- Lists LAN's joined to this cross connect
- private
Crossconnect StringId - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateCrossconnect 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 PrivateCrossconnect Resource
Get an existing PrivateCrossconnect 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?: PrivateCrossconnectState, opts?: CustomResourceOptions): PrivateCrossconnect
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
connectable_datacenters: Optional[Sequence[PrivateCrossconnectConnectableDatacenterArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
peers: Optional[Sequence[PrivateCrossconnectPeerArgs]] = None,
private_crossconnect_id: Optional[str] = None,
timeouts: Optional[PrivateCrossconnectTimeoutsArgs] = None) -> PrivateCrossconnect
func GetPrivateCrossconnect(ctx *Context, name string, id IDInput, state *PrivateCrossconnectState, opts ...ResourceOption) (*PrivateCrossconnect, error)
public static PrivateCrossconnect Get(string name, Input<string> id, PrivateCrossconnectState? state, CustomResourceOptions? opts = null)
public static PrivateCrossconnect get(String name, Output<String> id, PrivateCrossconnectState state, CustomResourceOptions options)
resources: _: type: ionoscloud:PrivateCrossconnect get: id: ${id}
- 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.
- Connectable
Datacenters List<PrivateCrossconnect Connectable Datacenter> - A list containing all the connectable datacenters
- Description string
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- Name string
- [string] The name of the cross-connection.
- Peers
List<Private
Crossconnect Peer> - Lists LAN's joined to this cross connect
- Private
Crossconnect stringId - Timeouts
Private
Crossconnect Timeouts
- Connectable
Datacenters []PrivateCrossconnect Connectable Datacenter Args - A list containing all the connectable datacenters
- Description string
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- Name string
- [string] The name of the cross-connection.
- Peers
[]Private
Crossconnect Peer Args - Lists LAN's joined to this cross connect
- Private
Crossconnect stringId - Timeouts
Private
Crossconnect Timeouts Args
- connectable
Datacenters List<PrivateCrossconnect Connectable Datacenter> - A list containing all the connectable datacenters
- description String
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name String
- [string] The name of the cross-connection.
- peers
List<Private
Crossconnect Peer> - Lists LAN's joined to this cross connect
- private
Crossconnect StringId - timeouts
Private
Crossconnect Timeouts
- connectable
Datacenters PrivateCrossconnect Connectable Datacenter[] - A list containing all the connectable datacenters
- description string
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name string
- [string] The name of the cross-connection.
- peers
Private
Crossconnect Peer[] - Lists LAN's joined to this cross connect
- private
Crossconnect stringId - timeouts
Private
Crossconnect Timeouts
- connectable_
datacenters Sequence[PrivateCrossconnect Connectable Datacenter Args] - A list containing all the connectable datacenters
- description str
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name str
- [string] The name of the cross-connection.
- peers
Sequence[Private
Crossconnect Peer Args] - Lists LAN's joined to this cross connect
- private_
crossconnect_ strid - timeouts
Private
Crossconnect Timeouts Args
- connectable
Datacenters List<Property Map> - A list containing all the connectable datacenters
- description String
- [string] A short description for the cross-connection.
connectable datacenters
- (Computed) A list containing all the connectable datacenters
- name String
- [string] The name of the cross-connection.
- peers List<Property Map>
- Lists LAN's joined to this cross connect
- private
Crossconnect StringId - timeouts Property Map
Supporting Types
PrivateCrossconnectConnectableDatacenter, PrivateCrossconnectConnectableDatacenterArgs
PrivateCrossconnectPeer, PrivateCrossconnectPeerArgs
- Datacenter
Id string - The id of the cross-connected datacenter
- Datacenter
Name string - The name of the cross-connected datacenter
- Lan
Id string - The id of the cross-connected LAN
- Lan
Name string - The name of the cross-connected LAN
- Location string
- The location of the cross-connected datacenter
- Datacenter
Id string - The id of the cross-connected datacenter
- Datacenter
Name string - The name of the cross-connected datacenter
- Lan
Id string - The id of the cross-connected LAN
- Lan
Name string - The name of the cross-connected LAN
- Location string
- The location of the cross-connected datacenter
- datacenter
Id String - The id of the cross-connected datacenter
- datacenter
Name String - The name of the cross-connected datacenter
- lan
Id String - The id of the cross-connected LAN
- lan
Name String - The name of the cross-connected LAN
- location String
- The location of the cross-connected datacenter
- datacenter
Id string - The id of the cross-connected datacenter
- datacenter
Name string - The name of the cross-connected datacenter
- lan
Id string - The id of the cross-connected LAN
- lan
Name string - The name of the cross-connected LAN
- location string
- The location of the cross-connected datacenter
- datacenter_
id str - The id of the cross-connected datacenter
- datacenter_
name str - The name of the cross-connected datacenter
- lan_
id str - The id of the cross-connected LAN
- lan_
name str - The name of the cross-connected LAN
- location str
- The location of the cross-connected datacenter
- datacenter
Id String - The id of the cross-connected datacenter
- datacenter
Name String - The name of the cross-connected datacenter
- lan
Id String - The id of the cross-connected LAN
- lan
Name String - The name of the cross-connected LAN
- location String
- The location of the cross-connected datacenter
PrivateCrossconnectTimeouts, PrivateCrossconnectTimeoutsArgs
Import
A Cross Connect resource can be imported using its resource id
, e.g.
$ pulumi import ionoscloud:index/privateCrossconnect:PrivateCrossconnect demo ionoscloud_private_crossconnect_uuid
This can be helpful when you want to import cross-connects which you have already created manually or using other means, outside of terraform.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.