1. Packages
  2. Ionoscloud
  3. API Docs
  4. compute
  5. Datacenter
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.compute.Datacenter

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

    Manages a Virtual Data Center on IonosCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
    
    const example = new ionoscloud.compute.Datacenter("example", {
        name: "Datacenter Example",
        location: "us/las",
        description: "datacenter description",
        secAuthProtection: false,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.compute.Datacenter("example",
        name="Datacenter Example",
        location="us/las",
        description="datacenter description",
        sec_auth_protection=False)
    
    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 {
    		_, err := compute.NewDatacenter(ctx, "example", &compute.DatacenterArgs{
    			Name:              pulumi.String("Datacenter Example"),
    			Location:          pulumi.String("us/las"),
    			Description:       pulumi.String("datacenter description"),
    			SecAuthProtection: pulumi.Bool(false),
    		})
    		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 example = new Ionoscloud.Compute.Datacenter("example", new()
        {
            Name = "Datacenter Example",
            Location = "us/las",
            Description = "datacenter description",
            SecAuthProtection = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.compute.Datacenter;
    import com.pulumi.ionoscloud.compute.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()
                .name("Datacenter Example")
                .location("us/las")
                .description("datacenter description")
                .secAuthProtection(false)
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:compute:Datacenter
        properties:
          name: Datacenter Example
          location: us/las
          description: datacenter description
          secAuthProtection: false
    

    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 "@ionos-cloud/sdk-pulumi";
    
    const example = new ionoscloud.compute.Datacenter("example", {
        name: "Datacenter NSG Example",
        location: "de/txl",
    });
    const exampleNsg = new ionoscloud.nsg.Nsg("example", {
        name: "Example NSG",
        description: "Example NSG Description",
        datacenterId: example.id,
    });
    const exampleDatacenterNsgSelection = new ionoscloud.nsg.DatacenterNsgSelection("example", {
        datacenterId: example.id,
        nsgId: exampleNsg.id,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.compute.Datacenter("example",
        name="Datacenter NSG Example",
        location="de/txl")
    example_nsg = ionoscloud.nsg.Nsg("example",
        name="Example NSG",
        description="Example NSG Description",
        datacenter_id=example.id)
    example_datacenter_nsg_selection = ionoscloud.nsg.DatacenterNsgSelection("example",
        datacenter_id=example.id,
        nsg_id=example_nsg.id)
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/nsg"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := compute.NewDatacenter(ctx, "example", &compute.DatacenterArgs{
    			Name:     pulumi.String("Datacenter NSG Example"),
    			Location: pulumi.String("de/txl"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleNsg, err := nsg.NewNsg(ctx, "example", &nsg.NsgArgs{
    			Name:         pulumi.String("Example NSG"),
    			Description:  pulumi.String("Example NSG Description"),
    			DatacenterId: example.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = nsg.NewDatacenterNsgSelection(ctx, "example", &nsg.DatacenterNsgSelectionArgs{
    			DatacenterId: example.ID(),
    			NsgId:        exampleNsg.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 example = new Ionoscloud.Compute.Datacenter("example", new()
        {
            Name = "Datacenter NSG Example",
            Location = "de/txl",
        });
    
        var exampleNsg = new Ionoscloud.Nsg.Nsg("example", new()
        {
            Name = "Example NSG",
            Description = "Example NSG Description",
            DatacenterId = example.Id,
        });
    
        var exampleDatacenterNsgSelection = new Ionoscloud.Nsg.DatacenterNsgSelection("example", new()
        {
            DatacenterId = example.Id,
            NsgId = exampleNsg.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.compute.Datacenter;
    import com.pulumi.ionoscloud.compute.DatacenterArgs;
    import com.pulumi.ionoscloud.nsg.Nsg;
    import com.pulumi.ionoscloud.nsg.NsgArgs;
    import com.pulumi.ionoscloud.nsg.DatacenterNsgSelection;
    import com.pulumi.ionoscloud.nsg.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 example = new Datacenter("example", DatacenterArgs.builder()
                .name("Datacenter NSG Example")
                .location("de/txl")
                .build());
    
            var exampleNsg = new Nsg("exampleNsg", NsgArgs.builder()
                .name("Example NSG")
                .description("Example NSG Description")
                .datacenterId(example.id())
                .build());
    
            var exampleDatacenterNsgSelection = new DatacenterNsgSelection("exampleDatacenterNsgSelection", DatacenterNsgSelectionArgs.builder()
                .datacenterId(example.id())
                .nsgId(exampleNsg.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:compute:Datacenter
        properties:
          name: Datacenter NSG Example
          location: de/txl
      exampleNsg:
        type: ionoscloud:nsg:Nsg
        name: example
        properties:
          name: Example NSG
          description: Example NSG Description
          datacenterId: ${example.id}
      exampleDatacenterNsgSelection:
        type: ionoscloud:nsg:DatacenterNsgSelection
        name: example
        properties:
          datacenterId: ${example.id}
          nsgId: ${exampleNsg.id}
    

    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,
                   description: Optional[str] = None,
                   name: Optional[str] = None,
                   sec_auth_protection: Optional[bool] = 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:compute:Datacenter
    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 DatacenterArgs
    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 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 string
    The unique name of the resource.
    args DatacenterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatacenterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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.Compute.Datacenter("datacenterResource", new()
    {
        Location = "string",
        Description = "string",
        Name = "string",
        SecAuthProtection = false,
    });
    
    example, err := compute.NewDatacenter(ctx, "datacenterResource", &compute.DatacenterArgs{
    	Location:          pulumi.String("string"),
    	Description:       pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	SecAuthProtection: pulumi.Bool(false),
    })
    
    var datacenterResource = new Datacenter("datacenterResource", DatacenterArgs.builder()
        .location("string")
        .description("string")
        .name("string")
        .secAuthProtection(false)
        .build());
    
    datacenter_resource = ionoscloud.compute.Datacenter("datacenterResource",
        location="string",
        description="string",
        name="string",
        sec_auth_protection=False)
    
    const datacenterResource = new ionoscloud.compute.Datacenter("datacenterResource", {
        location: "string",
        description: "string",
        name: "string",
        secAuthProtection: false,
    });
    
    type: ionoscloud:compute:Datacenter
    properties:
        description: string
        location: string
        name: string
        secAuthProtection: false
    

    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 string
    [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
    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
    Location string
    [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
    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
    location String
    [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
    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
    location string
    [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
    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
    location str
    [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
    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
    location String
    [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
    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

    Outputs

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

    CpuArchitectures List<Ionoscloud.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 int
    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 int
    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 Integer
    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 int
    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,
            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,
            version: Optional[int] = 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:compute:Datacenter    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.
    The following state arguments are supported:
    CpuArchitectures List<Ionoscloud.DatacenterCpuArchitecture>
    Array of features and CPU families available in a location
    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
    Version int
    The version of that Data Center. Gets incremented with every change
    CpuArchitectures []DatacenterCpuArchitectureArgs
    Array of features and CPU families available in a location
    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
    Version int
    The version of that Data Center. Gets incremented with every change
    cpuArchitectures List<DatacenterCpuArchitecture>
    Array of features and CPU families available in a location
    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
    version Integer
    The version of that Data Center. Gets incremented with every change
    cpuArchitectures DatacenterCpuArchitecture[]
    Array of features and CPU families available in a location
    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
    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
    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
    version int
    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
    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
    version Number
    The version of that Data Center. Gets incremented with every change

    Supporting Types

    DatacenterCpuArchitecture, DatacenterCpuArchitectureArgs

    CpuFamily string
    A valid CPU family name
    MaxCores int
    The maximum number of cores available
    MaxRam int
    The maximum number of RAM in MB
    Vendor string
    A valid CPU vendor name
    CpuFamily string
    A valid CPU family name
    MaxCores int
    The maximum number of cores available
    MaxRam int
    The maximum number of RAM in MB
    Vendor string
    A valid CPU vendor name
    cpuFamily String
    A valid CPU family name
    maxCores Integer
    The maximum number of cores available
    maxRam Integer
    The maximum number of RAM in MB
    vendor String
    A valid CPU vendor name
    cpuFamily string
    A valid CPU family name
    maxCores number
    The maximum number of cores available
    maxRam number
    The maximum number of RAM in MB
    vendor string
    A valid CPU vendor name
    cpu_family str
    A valid CPU family name
    max_cores int
    The maximum number of cores available
    max_ram int
    The maximum number of RAM in MB
    vendor str
    A valid CPU vendor name
    cpuFamily String
    A valid CPU family name
    maxCores Number
    The maximum number of cores available
    maxRam Number
    The maximum number of RAM in MB
    vendor String
    A valid CPU vendor name

    Import

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

    $ pulumi import ionoscloud:compute/datacenter:Datacenter mydc datacenter uuid
    

    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.
    ionoscloud logo
    IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud