ionoscloud.compute.Crossconnect
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 "@ionos-cloud/sdk-pulumi";
const crossConnectTestResource = new ionoscloud.compute.Crossconnect("CrossConnectTestResource", {
name: "CrossConnectTestResource",
description: "CrossConnectTestResource",
});
const dc1 = new ionoscloud.compute.Datacenter("dc1", {
location: "de/txl",
name: "dc1",
});
const dc2 = new ionoscloud.compute.Datacenter("dc2", {
location: "de/txl",
name: "dc2",
});
const dc1lan = new ionoscloud.compute.Lan("dc1lan", {
datacenterId: dc1.id,
"public": false,
name: "dc1lan",
pcc: crossConnectTestResource.id,
});
const dc2lan = new ionoscloud.compute.Lan("dc2lan", {
datacenterId: dc2.id,
"public": false,
name: "dc2lan",
pcc: crossConnectTestResource.id,
});
import pulumi
import pulumi_ionoscloud as ionoscloud
cross_connect_test_resource = ionoscloud.compute.Crossconnect("CrossConnectTestResource",
name="CrossConnectTestResource",
description="CrossConnectTestResource")
dc1 = ionoscloud.compute.Datacenter("dc1",
location="de/txl",
name="dc1")
dc2 = ionoscloud.compute.Datacenter("dc2",
location="de/txl",
name="dc2")
dc1lan = ionoscloud.compute.Lan("dc1lan",
datacenter_id=dc1.id,
public=False,
name="dc1lan",
pcc=cross_connect_test_resource.id)
dc2lan = ionoscloud.compute.Lan("dc2lan",
datacenter_id=dc2.id,
public=False,
name="dc2lan",
pcc=cross_connect_test_resource.id)
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
crossConnectTestResource, err := compute.NewCrossconnect(ctx, "CrossConnectTestResource", &compute.CrossconnectArgs{
Name: pulumi.String("CrossConnectTestResource"),
Description: pulumi.String("CrossConnectTestResource"),
})
if err != nil {
return err
}
dc1, err := compute.NewDatacenter(ctx, "dc1", &compute.DatacenterArgs{
Location: pulumi.String("de/txl"),
Name: pulumi.String("dc1"),
})
if err != nil {
return err
}
dc2, err := compute.NewDatacenter(ctx, "dc2", &compute.DatacenterArgs{
Location: pulumi.String("de/txl"),
Name: pulumi.String("dc2"),
})
if err != nil {
return err
}
_, err = compute.NewLan(ctx, "dc1lan", &compute.LanArgs{
DatacenterId: dc1.ID(),
Public: pulumi.Bool(false),
Name: pulumi.String("dc1lan"),
Pcc: crossConnectTestResource.ID(),
})
if err != nil {
return err
}
_, err = compute.NewLan(ctx, "dc2lan", &compute.LanArgs{
DatacenterId: dc2.ID(),
Public: pulumi.Bool(false),
Name: pulumi.String("dc2lan"),
Pcc: crossConnectTestResource.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var crossConnectTestResource = new Ionoscloud.Compute.Crossconnect("CrossConnectTestResource", new()
{
Name = "CrossConnectTestResource",
Description = "CrossConnectTestResource",
});
var dc1 = new Ionoscloud.Compute.Datacenter("dc1", new()
{
Location = "de/txl",
Name = "dc1",
});
var dc2 = new Ionoscloud.Compute.Datacenter("dc2", new()
{
Location = "de/txl",
Name = "dc2",
});
var dc1lan = new Ionoscloud.Compute.Lan("dc1lan", new()
{
DatacenterId = dc1.Id,
Public = false,
Name = "dc1lan",
Pcc = crossConnectTestResource.Id,
});
var dc2lan = new Ionoscloud.Compute.Lan("dc2lan", new()
{
DatacenterId = dc2.Id,
Public = false,
Name = "dc2lan",
Pcc = crossConnectTestResource.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.compute.Crossconnect;
import com.pulumi.ionoscloud.compute.CrossconnectArgs;
import com.pulumi.ionoscloud.compute.Datacenter;
import com.pulumi.ionoscloud.compute.DatacenterArgs;
import com.pulumi.ionoscloud.compute.Lan;
import com.pulumi.ionoscloud.compute.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 Crossconnect("crossConnectTestResource", CrossconnectArgs.builder()
.name("CrossConnectTestResource")
.description("CrossConnectTestResource")
.build());
var dc1 = new Datacenter("dc1", DatacenterArgs.builder()
.location("de/txl")
.name("dc1")
.build());
var dc2 = new Datacenter("dc2", DatacenterArgs.builder()
.location("de/txl")
.name("dc2")
.build());
var dc1lan = new Lan("dc1lan", LanArgs.builder()
.datacenterId(dc1.id())
.public_(false)
.name("dc1lan")
.pcc(crossConnectTestResource.id())
.build());
var dc2lan = new Lan("dc2lan", LanArgs.builder()
.datacenterId(dc2.id())
.public_(false)
.name("dc2lan")
.pcc(crossConnectTestResource.id())
.build());
}
}
resources:
crossConnectTestResource:
type: ionoscloud:compute:Crossconnect
name: CrossConnectTestResource
properties:
name: CrossConnectTestResource
description: CrossConnectTestResource
dc1:
type: ionoscloud:compute:Datacenter
properties:
location: de/txl
name: dc1
dc2:
type: ionoscloud:compute:Datacenter
properties:
location: de/txl
name: dc2
dc1lan:
type: ionoscloud:compute:Lan
properties:
datacenterId: ${dc1.id}
public: false
name: dc1lan
pcc: ${crossConnectTestResource.id}
dc2lan:
type: ionoscloud:compute:Lan
properties:
datacenterId: ${dc2.id}
public: false
name: dc2lan
pcc: ${crossConnectTestResource.id}
Create Crossconnect Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Crossconnect(name: string, args?: CrossconnectArgs, opts?: CustomResourceOptions);
@overload
def Crossconnect(resource_name: str,
args: Optional[CrossconnectArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Crossconnect(resource_name: str,
opts: Optional[ResourceOptions] = None,
connectable_datacenters: Optional[Sequence[CrossconnectConnectableDatacenterArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
peers: Optional[Sequence[CrossconnectPeerArgs]] = None)
func NewCrossconnect(ctx *Context, name string, args *CrossconnectArgs, opts ...ResourceOption) (*Crossconnect, error)
public Crossconnect(string name, CrossconnectArgs? args = null, CustomResourceOptions? opts = null)
public Crossconnect(String name, CrossconnectArgs args)
public Crossconnect(String name, CrossconnectArgs args, CustomResourceOptions options)
type: ionoscloud:compute:Crossconnect
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 CrossconnectArgs
- 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 CrossconnectArgs
- 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 CrossconnectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CrossconnectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CrossconnectArgs
- 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 crossconnectResource = new Ionoscloud.Compute.Crossconnect("crossconnectResource", new()
{
ConnectableDatacenters = new[]
{
new Ionoscloud.Compute.Inputs.CrossconnectConnectableDatacenterArgs
{
Id = "string",
Location = "string",
Name = "string",
},
},
Description = "string",
Name = "string",
Peers = new[]
{
new Ionoscloud.Compute.Inputs.CrossconnectPeerArgs
{
DatacenterId = "string",
DatacenterName = "string",
LanId = "string",
LanName = "string",
Location = "string",
},
},
});
example, err := compute.NewCrossconnect(ctx, "crossconnectResource", &compute.CrossconnectArgs{
ConnectableDatacenters: compute.CrossconnectConnectableDatacenterArray{
&compute.CrossconnectConnectableDatacenterArgs{
Id: pulumi.String("string"),
Location: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Peers: compute.CrossconnectPeerArray{
&compute.CrossconnectPeerArgs{
DatacenterId: pulumi.String("string"),
DatacenterName: pulumi.String("string"),
LanId: pulumi.String("string"),
LanName: pulumi.String("string"),
Location: pulumi.String("string"),
},
},
})
var crossconnectResource = new Crossconnect("crossconnectResource", CrossconnectArgs.builder()
.connectableDatacenters(CrossconnectConnectableDatacenterArgs.builder()
.id("string")
.location("string")
.name("string")
.build())
.description("string")
.name("string")
.peers(CrossconnectPeerArgs.builder()
.datacenterId("string")
.datacenterName("string")
.lanId("string")
.lanName("string")
.location("string")
.build())
.build());
crossconnect_resource = ionoscloud.compute.Crossconnect("crossconnectResource",
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",
}])
const crossconnectResource = new ionoscloud.compute.Crossconnect("crossconnectResource", {
connectableDatacenters: [{
id: "string",
location: "string",
name: "string",
}],
description: "string",
name: "string",
peers: [{
datacenterId: "string",
datacenterName: "string",
lanId: "string",
lanName: "string",
location: "string",
}],
});
type: ionoscloud:compute:Crossconnect
properties:
connectableDatacenters:
- id: string
location: string
name: string
description: string
name: string
peers:
- datacenterId: string
datacenterName: string
lanId: string
lanName: string
location: string
Crossconnect 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 Crossconnect resource accepts the following input properties:
- Connectable
Datacenters List<Ionoscloud.Crossconnect 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<Ionoscloud.
Crossconnect Peer> - Lists LAN's joined to this cross connect
- Connectable
Datacenters []CrossconnectConnectable 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
[]Crossconnect
Peer Args - Lists LAN's joined to this cross connect
- connectable
Datacenters List<CrossconnectConnectable 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<Crossconnect
Peer> - Lists LAN's joined to this cross connect
- connectable
Datacenters CrossconnectConnectable 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
Crossconnect
Peer[] - Lists LAN's joined to this cross connect
- connectable_
datacenters Sequence[CrossconnectConnectable 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[Crossconnect
Peer Args] - Lists LAN's joined to this cross connect
- 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
Outputs
All input properties are implicitly available as output properties. Additionally, the Crossconnect 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 Crossconnect Resource
Get an existing Crossconnect 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?: CrossconnectState, opts?: CustomResourceOptions): Crossconnect
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
connectable_datacenters: Optional[Sequence[CrossconnectConnectableDatacenterArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
peers: Optional[Sequence[CrossconnectPeerArgs]] = None) -> Crossconnect
func GetCrossconnect(ctx *Context, name string, id IDInput, state *CrossconnectState, opts ...ResourceOption) (*Crossconnect, error)
public static Crossconnect Get(string name, Input<string> id, CrossconnectState? state, CustomResourceOptions? opts = null)
public static Crossconnect get(String name, Output<String> id, CrossconnectState state, CustomResourceOptions options)
resources: _: type: ionoscloud:compute:Crossconnect 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<Ionoscloud.Crossconnect 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<Ionoscloud.
Crossconnect Peer> - Lists LAN's joined to this cross connect
- Connectable
Datacenters []CrossconnectConnectable 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
[]Crossconnect
Peer Args - Lists LAN's joined to this cross connect
- connectable
Datacenters List<CrossconnectConnectable 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<Crossconnect
Peer> - Lists LAN's joined to this cross connect
- connectable
Datacenters CrossconnectConnectable 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
Crossconnect
Peer[] - Lists LAN's joined to this cross connect
- connectable_
datacenters Sequence[CrossconnectConnectable 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[Crossconnect
Peer Args] - Lists LAN's joined to this cross connect
- 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
Supporting Types
CrossconnectConnectableDatacenter, CrossconnectConnectableDatacenterArgs
CrossconnectPeer, CrossconnectPeerArgs
- 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
Import
A Cross Connect resource can be imported using its resource id
, e.g.
$ pulumi import ionoscloud:compute/crossconnect:Crossconnect 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 pulumi.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.