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,
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.Datacenter("example",
description="datacenter description",
location="us/las",
sec_auth_protection=False)
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
})
}
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,
});
});
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());
}
}
resources:
example:
type: ionoscloud:Datacenter
properties:
description: datacenter description
location: us/las
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.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 "@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,
});
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)
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
})
}
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,
});
});
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());
}
}
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}
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 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.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",
},
});
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"),
},
})
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());
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",
})
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",
},
});
type: ionoscloud:Datacenter
properties:
datacenterId: string
description: string
location: string
name: string
secAuthProtection: false
timeouts:
create: string
default: string
delete: string
update: string
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.
- Datacenter
Id string - 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
- Timeouts
Datacenter
Timeouts
- Location string
- [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
- Datacenter
Id string - 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
- Timeouts
Datacenter
Timeouts Args
- location String
- [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
- datacenter
Id String - 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
- timeouts
Datacenter
Timeouts
- location string
- [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
- datacenter
Id string - 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
- timeouts
Datacenter
Timeouts
- location 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_ boolprotection - [bool] Boolean value representing if the data center requires extra protection e.g. two factor protection
- timeouts
Datacenter
Timeouts Args
- location String
- [string] The regional location where the Virtual Data Center will be created. This argument is immutable.
- datacenter
Id String - 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
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Datacenter resource produces the following output properties:
- 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 double
- 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 float64
- 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 Double
- 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 float
- 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,
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
- 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<DatacenterCpu Architecture> - Array of features and CPU families available in a location
- Datacenter
Id 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
- 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
- Timeouts
Datacenter
Timeouts - Version double
- 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
- Datacenter
Id 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
- 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
- Timeouts
Datacenter
Timeouts Args - Version float64
- 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
- datacenter
Id 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
- 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
- timeouts
Datacenter
Timeouts - version Double
- 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
- datacenter
Id 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
- 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
- timeouts
Datacenter
Timeouts - 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
- 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_ 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
- timeouts
Datacenter
Timeouts Args - version float
- 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
- datacenter
Id 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
- 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
- timeouts Property Map
- 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 float - The maximum number of cores available
- max_
ram float - The maximum number of RAM in MB
- vendor str
- A valid CPU vendor name
DatacenterTimeouts, DatacenterTimeoutsArgs
Import
Resource Datacenter can be imported using the resource id
, e.g.
$ pulumi import ionoscloud:index/datacenter:Datacenter mydc datacenter uuid
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.