ionoscloud.compute.Datacenter
Explore with Pulumi AI
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
A single Network Security Group can be attached at any time to a Datacenter. To do this, use the ionoscloud.nsg.DatacenterNsgSelection
and provide the IDs of the NSG and Datacenter to link them.
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.
- Sec
Auth boolProtection - [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.
- Sec
Auth boolProtection - [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.
- sec
Auth BooleanProtection - [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.
- sec
Auth booleanProtection - [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_ boolprotection - [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.
- sec
Auth BooleanProtection - [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:
- Cpu
Architectures List<Ionoscloud.Datacenter Cpu Architecture> - 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.
- Ipv6Cidr
Block 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
- Cpu
Architectures []DatacenterCpu Architecture - 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.
- Ipv6Cidr
Block 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
- cpu
Architectures List<DatacenterCpu Architecture> - 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.
- ipv6Cidr
Block 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
- cpu
Architectures DatacenterCpu Architecture[] - 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.
- ipv6Cidr
Block 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[DatacenterCpu Architecture] - 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_ strblock - 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
- cpu
Architectures 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.
- ipv6Cidr
Block 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.
- Cpu
Architectures List<Ionoscloud.Datacenter Cpu Architecture> - 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
- Ipv6Cidr
Block 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.
- Sec
Auth boolProtection - [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
- Cpu
Architectures []DatacenterCpu Architecture Args - 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
- Ipv6Cidr
Block 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.
- Sec
Auth boolProtection - [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
- cpu
Architectures List<DatacenterCpu Architecture> - 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
- ipv6Cidr
Block 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.
- sec
Auth BooleanProtection - [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
- cpu
Architectures DatacenterCpu Architecture[] - 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
- ipv6Cidr
Block 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.
- sec
Auth booleanProtection - [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[DatacenterCpu Architecture Args] - 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_ strblock - 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_ boolprotection - [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
- cpu
Architectures 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
- ipv6Cidr
Block 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.
- sec
Auth BooleanProtection - [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
- 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
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.