1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. Datacenter
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.Datacenter

Explore with Pulumi AI

Manages a Virtual Data Center on IonosCloud.

Example Usage

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

const example = new ionoscloud.Datacenter("example", {
    description: "datacenter description",
    location: "us/las",
    secAuthProtection: false,
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.Datacenter("example",
    description="datacenter description",
    location="us/las",
    sec_auth_protection=False)
Copy
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 {
		_, err := ionoscloud.NewDatacenter(ctx, "example", &ionoscloud.DatacenterArgs{
			Description:       pulumi.String("datacenter description"),
			Location:          pulumi.String("us/las"),
			SecAuthProtection: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;

return await Deployment.RunAsync(() => 
{
    var example = new Ionoscloud.Datacenter("example", new()
    {
        Description = "datacenter description",
        Location = "us/las",
        SecAuthProtection = false,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.Datacenter;
import com.pulumi.ionoscloud.DatacenterArgs;
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 example = new Datacenter("example", DatacenterArgs.builder()
            .description("datacenter description")
            .location("us/las")
            .secAuthProtection(false)
            .build());

    }
}
Copy
resources:
  example:
    type: ionoscloud:Datacenter
    properties:
      description: datacenter description
      location: us/las
      secAuthProtection: false
Copy

Attaching a NSG to a Datacenter

Deleting the resource or setting the empty string for the nsg_id field will de-attach any previously linked NSG from the Datacenter.

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

const exampleDatacenter = new ionoscloud.Datacenter("exampleDatacenter", {location: "de/txl"});
const exampleNsg = new ionoscloud.Nsg("exampleNsg", {
    description: "Example NSG Description",
    datacenterId: exampleDatacenter.datacenterId,
});
const exampleDatacenterNsgSelection = new ionoscloud.DatacenterNsgSelection("exampleDatacenterNsgSelection", {
    datacenterId: exampleDatacenter.datacenterId,
    nsgId: exampleNsg.nsgId,
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example_datacenter = ionoscloud.Datacenter("exampleDatacenter", location="de/txl")
example_nsg = ionoscloud.Nsg("exampleNsg",
    description="Example NSG Description",
    datacenter_id=example_datacenter.datacenter_id)
example_datacenter_nsg_selection = ionoscloud.DatacenterNsgSelection("exampleDatacenterNsgSelection",
    datacenter_id=example_datacenter.datacenter_id,
    nsg_id=example_nsg.nsg_id)
Copy
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 {
		exampleDatacenter, err := ionoscloud.NewDatacenter(ctx, "exampleDatacenter", &ionoscloud.DatacenterArgs{
			Location: pulumi.String("de/txl"),
		})
		if err != nil {
			return err
		}
		exampleNsg, err := ionoscloud.NewNsg(ctx, "exampleNsg", &ionoscloud.NsgArgs{
			Description:  pulumi.String("Example NSG Description"),
			DatacenterId: exampleDatacenter.DatacenterId,
		})
		if err != nil {
			return err
		}
		_, err = ionoscloud.NewDatacenterNsgSelection(ctx, "exampleDatacenterNsgSelection", &ionoscloud.DatacenterNsgSelectionArgs{
			DatacenterId: exampleDatacenter.DatacenterId,
			NsgId:        exampleNsg.NsgId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;

return await Deployment.RunAsync(() => 
{
    var exampleDatacenter = new Ionoscloud.Datacenter("exampleDatacenter", new()
    {
        Location = "de/txl",
    });

    var exampleNsg = new Ionoscloud.Nsg("exampleNsg", new()
    {
        Description = "Example NSG Description",
        DatacenterId = exampleDatacenter.DatacenterId,
    });

    var exampleDatacenterNsgSelection = new Ionoscloud.DatacenterNsgSelection("exampleDatacenterNsgSelection", new()
    {
        DatacenterId = exampleDatacenter.DatacenterId,
        NsgId = exampleNsg.NsgId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.Datacenter;
import com.pulumi.ionoscloud.DatacenterArgs;
import com.pulumi.ionoscloud.Nsg;
import com.pulumi.ionoscloud.NsgArgs;
import com.pulumi.ionoscloud.DatacenterNsgSelection;
import com.pulumi.ionoscloud.DatacenterNsgSelectionArgs;
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 exampleDatacenter = new Datacenter("exampleDatacenter", DatacenterArgs.builder()
            .location("de/txl")
            .build());

        var exampleNsg = new Nsg("exampleNsg", NsgArgs.builder()
            .description("Example NSG Description")
            .datacenterId(exampleDatacenter.datacenterId())
            .build());

        var exampleDatacenterNsgSelection = new DatacenterNsgSelection("exampleDatacenterNsgSelection", DatacenterNsgSelectionArgs.builder()
            .datacenterId(exampleDatacenter.datacenterId())
            .nsgId(exampleNsg.nsgId())
            .build());

    }
}
Copy
resources:
  exampleDatacenter:
    type: ionoscloud:Datacenter
    properties:
      location: de/txl
  exampleNsg:
    type: ionoscloud:Nsg
    properties:
      description: Example NSG Description
      datacenterId: ${exampleDatacenter.datacenterId}
  exampleDatacenterNsgSelection:
    type: ionoscloud:DatacenterNsgSelection
    properties:
      datacenterId: ${exampleDatacenter.datacenterId}
      nsgId: ${exampleNsg.nsgId}
Copy

Create Datacenter Resource

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

Constructor syntax

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

@overload
def Datacenter(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               location: Optional[str] = None,
               datacenter_id: Optional[str] = None,
               description: Optional[str] = None,
               name: Optional[str] = None,
               sec_auth_protection: Optional[bool] = None,
               timeouts: Optional[DatacenterTimeoutsArgs] = None)
func NewDatacenter(ctx *Context, name string, args DatacenterArgs, opts ...ResourceOption) (*Datacenter, error)
public Datacenter(string name, DatacenterArgs args, CustomResourceOptions? opts = null)
public Datacenter(String name, DatacenterArgs args)
public Datacenter(String name, DatacenterArgs args, CustomResourceOptions options)
type: ionoscloud:Datacenter
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. DatacenterArgs
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. DatacenterArgs
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. DatacenterArgs
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. DatacenterArgs
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. DatacenterArgs
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 datacenterResource = new Ionoscloud.Datacenter("datacenterResource", new()
{
    Location = "string",
    DatacenterId = "string",
    Description = "string",
    Name = "string",
    SecAuthProtection = false,
    Timeouts = new Ionoscloud.Inputs.DatacenterTimeoutsArgs
    {
        Create = "string",
        Default = "string",
        Delete = "string",
        Update = "string",
    },
});
Copy
example, err := ionoscloud.NewDatacenter(ctx, "datacenterResource", &ionoscloud.DatacenterArgs{
	Location:          pulumi.String("string"),
	DatacenterId:      pulumi.String("string"),
	Description:       pulumi.String("string"),
	Name:              pulumi.String("string"),
	SecAuthProtection: pulumi.Bool(false),
	Timeouts: &ionoscloud.DatacenterTimeoutsArgs{
		Create:  pulumi.String("string"),
		Default: pulumi.String("string"),
		Delete:  pulumi.String("string"),
		Update:  pulumi.String("string"),
	},
})
Copy
var datacenterResource = new Datacenter("datacenterResource", DatacenterArgs.builder()
    .location("string")
    .datacenterId("string")
    .description("string")
    .name("string")
    .secAuthProtection(false)
    .timeouts(DatacenterTimeoutsArgs.builder()
        .create("string")
        .default_("string")
        .delete("string")
        .update("string")
        .build())
    .build());
Copy
datacenter_resource = ionoscloud.Datacenter("datacenterResource",
    location="string",
    datacenter_id="string",
    description="string",
    name="string",
    sec_auth_protection=False,
    timeouts={
        "create": "string",
        "default": "string",
        "delete": "string",
        "update": "string",
    })
Copy
const datacenterResource = new ionoscloud.Datacenter("datacenterResource", {
    location: "string",
    datacenterId: "string",
    description: "string",
    name: "string",
    secAuthProtection: false,
    timeouts: {
        create: "string",
        "default": "string",
        "delete": "string",
        update: "string",
    },
});
Copy
type: ionoscloud:Datacenter
properties:
    datacenterId: string
    description: string
    location: string
    name: string
    secAuthProtection: false
    timeouts:
        create: string
        default: string
        delete: string
        update: string
Copy

Datacenter 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 Datacenter resource accepts the following input properties:

Location This property is required. string
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
DatacenterId string
Description string
[string] Description for the Virtual Data Center.
Name string
[string] The name of the Virtual Data Center.
SecAuthProtection bool
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
Timeouts DatacenterTimeouts
Location This property is required. string
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
DatacenterId string
Description string
[string] Description for the Virtual Data Center.
Name string
[string] The name of the Virtual Data Center.
SecAuthProtection bool
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
Timeouts DatacenterTimeoutsArgs
location This property is required. String
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
datacenterId String
description String
[string] Description for the Virtual Data Center.
name String
[string] The name of the Virtual Data Center.
secAuthProtection Boolean
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts DatacenterTimeouts
location This property is required. string
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
datacenterId string
description string
[string] Description for the Virtual Data Center.
name string
[string] The name of the Virtual Data Center.
secAuthProtection boolean
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts DatacenterTimeouts
location This property is required. str
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
datacenter_id str
description str
[string] Description for the Virtual Data Center.
name str
[string] The name of the Virtual Data Center.
sec_auth_protection bool
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts DatacenterTimeoutsArgs
location This property is required. String
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
datacenterId String
description String
[string] Description for the Virtual Data Center.
name String
[string] The name of the Virtual Data Center.
secAuthProtection Boolean
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts Property Map

Outputs

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

CpuArchitectures List<DatacenterCpuArchitecture>
Array of features and CPU families available in a location
Features List<string>
List of features supported by the location this data center is part of
Id string
The provider-assigned unique ID for this managed resource.
Ipv6CidrBlock string
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
Version double
The version of that Data Center. Gets incremented with every change
CpuArchitectures []DatacenterCpuArchitecture
Array of features and CPU families available in a location
Features []string
List of features supported by the location this data center is part of
Id string
The provider-assigned unique ID for this managed resource.
Ipv6CidrBlock string
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
Version float64
The version of that Data Center. Gets incremented with every change
cpuArchitectures List<DatacenterCpuArchitecture>
Array of features and CPU families available in a location
features List<String>
List of features supported by the location this data center is part of
id String
The provider-assigned unique ID for this managed resource.
ipv6CidrBlock String
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
version Double
The version of that Data Center. Gets incremented with every change
cpuArchitectures DatacenterCpuArchitecture[]
Array of features and CPU families available in a location
features string[]
List of features supported by the location this data center is part of
id string
The provider-assigned unique ID for this managed resource.
ipv6CidrBlock string
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
version number
The version of that Data Center. Gets incremented with every change
cpu_architectures Sequence[DatacenterCpuArchitecture]
Array of features and CPU families available in a location
features Sequence[str]
List of features supported by the location this data center is part of
id str
The provider-assigned unique ID for this managed resource.
ipv6_cidr_block str
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
version float
The version of that Data Center. Gets incremented with every change
cpuArchitectures List<Property Map>
Array of features and CPU families available in a location
features List<String>
List of features supported by the location this data center is part of
id String
The provider-assigned unique ID for this managed resource.
ipv6CidrBlock String
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
version Number
The version of that Data Center. Gets incremented with every change

Look up Existing Datacenter Resource

Get an existing Datacenter 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?: DatacenterState, opts?: CustomResourceOptions): Datacenter
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cpu_architectures: Optional[Sequence[DatacenterCpuArchitectureArgs]] = None,
        datacenter_id: Optional[str] = None,
        description: Optional[str] = None,
        features: Optional[Sequence[str]] = None,
        ipv6_cidr_block: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        sec_auth_protection: Optional[bool] = None,
        timeouts: Optional[DatacenterTimeoutsArgs] = None,
        version: Optional[float] = None) -> Datacenter
func GetDatacenter(ctx *Context, name string, id IDInput, state *DatacenterState, opts ...ResourceOption) (*Datacenter, error)
public static Datacenter Get(string name, Input<string> id, DatacenterState? state, CustomResourceOptions? opts = null)
public static Datacenter get(String name, Output<String> id, DatacenterState state, CustomResourceOptions options)
resources:  _:    type: ionoscloud:Datacenter    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:
CpuArchitectures List<DatacenterCpuArchitecture>
Array of features and CPU families available in a location
DatacenterId string
Description string
[string] Description for the Virtual Data Center.
Features List<string>
List of features supported by the location this data center is part of
Ipv6CidrBlock string
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
Location string
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
Name string
[string] The name of the Virtual Data Center.
SecAuthProtection bool
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
Timeouts DatacenterTimeouts
Version double
The version of that Data Center. Gets incremented with every change
CpuArchitectures []DatacenterCpuArchitectureArgs
Array of features and CPU families available in a location
DatacenterId string
Description string
[string] Description for the Virtual Data Center.
Features []string
List of features supported by the location this data center is part of
Ipv6CidrBlock string
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
Location string
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
Name string
[string] The name of the Virtual Data Center.
SecAuthProtection bool
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
Timeouts DatacenterTimeoutsArgs
Version float64
The version of that Data Center. Gets incremented with every change
cpuArchitectures List<DatacenterCpuArchitecture>
Array of features and CPU families available in a location
datacenterId String
description String
[string] Description for the Virtual Data Center.
features List<String>
List of features supported by the location this data center is part of
ipv6CidrBlock String
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
location String
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
name String
[string] The name of the Virtual Data Center.
secAuthProtection Boolean
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts DatacenterTimeouts
version Double
The version of that Data Center. Gets incremented with every change
cpuArchitectures DatacenterCpuArchitecture[]
Array of features and CPU families available in a location
datacenterId string
description string
[string] Description for the Virtual Data Center.
features string[]
List of features supported by the location this data center is part of
ipv6CidrBlock string
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
location string
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
name string
[string] The name of the Virtual Data Center.
secAuthProtection boolean
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts DatacenterTimeouts
version number
The version of that Data Center. Gets incremented with every change
cpu_architectures Sequence[DatacenterCpuArchitectureArgs]
Array of features and CPU families available in a location
datacenter_id str
description str
[string] Description for the Virtual Data Center.
features Sequence[str]
List of features supported by the location this data center is part of
ipv6_cidr_block str
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
location str
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
name str
[string] The name of the Virtual Data Center.
sec_auth_protection bool
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts DatacenterTimeoutsArgs
version float
The version of that Data Center. Gets incremented with every change
cpuArchitectures List<Property Map>
Array of features and CPU families available in a location
datacenterId String
description String
[string] Description for the Virtual Data Center.
features List<String>
List of features supported by the location this data center is part of
ipv6CidrBlock String
The automatically-assigned /56 IPv6 CIDR block if IPv6 is enabled on this virtual data center
location String
[string] The regional location where the Virtual Data Center will be created. This argument is immutable.
name String
[string] The name of the Virtual Data Center.
secAuthProtection Boolean
[bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
timeouts Property Map
version Number
The version of that Data Center. Gets incremented with every change

Supporting Types

DatacenterCpuArchitecture
, DatacenterCpuArchitectureArgs

CpuFamily This property is required. string
A valid CPU family name
MaxCores This property is required. double
The maximum number of cores available
MaxRam This property is required. double
The maximum number of RAM in MB
Vendor This property is required. string
A valid CPU vendor name
CpuFamily This property is required. string
A valid CPU family name
MaxCores This property is required. float64
The maximum number of cores available
MaxRam This property is required. float64
The maximum number of RAM in MB
Vendor This property is required. string
A valid CPU vendor name
cpuFamily This property is required. String
A valid CPU family name
maxCores This property is required. Double
The maximum number of cores available
maxRam This property is required. Double
The maximum number of RAM in MB
vendor This property is required. String
A valid CPU vendor name
cpuFamily This property is required. string
A valid CPU family name
maxCores This property is required. number
The maximum number of cores available
maxRam This property is required. number
The maximum number of RAM in MB
vendor This property is required. string
A valid CPU vendor name
cpu_family This property is required. str
A valid CPU family name
max_cores This property is required. float
The maximum number of cores available
max_ram This property is required. float
The maximum number of RAM in MB
vendor This property is required. str
A valid CPU vendor name
cpuFamily This property is required. String
A valid CPU family name
maxCores This property is required. Number
The maximum number of cores available
maxRam This property is required. Number
The maximum number of RAM in MB
vendor This property is required. String
A valid CPU vendor name

DatacenterTimeouts
, DatacenterTimeoutsArgs

Create string
Default string
Delete string
Update string
Create string
Default string
Delete string
Update string
create String
default_ String
delete String
update String
create string
default string
delete string
update string
create String
default String
delete String
update String

Import

Resource Datacenter can be imported using the resource id, e.g.

$ pulumi import ionoscloud:index/datacenter:Datacenter mydc datacenter uuid
Copy

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.