ionoscloud.getDatacenter
Explore with Pulumi AI
The Datacenter data source can be used to search for and return an existing Virtual Data Center. You can provide a string for the name and location parameters which will be compared with provisioned Virtual Data Centers. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getDatacenter({
id: "datacenter_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_datacenter(id="datacenter_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 {
_, err := ionoscloud.LookupDatacenter(ctx, &ionoscloud.LookupDatacenterArgs{
Id: pulumi.StringRef("datacenter_id"),
}, nil)
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 = Ionoscloud.GetDatacenter.Invoke(new()
{
Id = "datacenter_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetDatacenterArgs;
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) {
final var example = IonoscloudFunctions.getDatacenter(GetDatacenterArgs.builder()
.id("datacenter_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getDatacenter
arguments:
id: datacenter_id
By Name & Location
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getDatacenter({
location: "us/las",
name: "Datacenter Example",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_datacenter(location="us/las",
name="Datacenter Example")
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.LookupDatacenter(ctx, &ionoscloud.LookupDatacenterArgs{
Location: pulumi.StringRef("us/las"),
Name: pulumi.StringRef("Datacenter Example"),
}, nil)
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 = Ionoscloud.GetDatacenter.Invoke(new()
{
Location = "us/las",
Name = "Datacenter Example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetDatacenterArgs;
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) {
final var example = IonoscloudFunctions.getDatacenter(GetDatacenterArgs.builder()
.location("us/las")
.name("Datacenter Example")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getDatacenter
arguments:
location: us/las
name: Datacenter Example
Using getDatacenter
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDatacenter(args: GetDatacenterArgs, opts?: InvokeOptions): Promise<GetDatacenterResult>
function getDatacenterOutput(args: GetDatacenterOutputArgs, opts?: InvokeOptions): Output<GetDatacenterResult>
def get_datacenter(id: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[GetDatacenterTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetDatacenterResult
def get_datacenter_output(id: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetDatacenterTimeoutsArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatacenterResult]
func LookupDatacenter(ctx *Context, args *LookupDatacenterArgs, opts ...InvokeOption) (*LookupDatacenterResult, error)
func LookupDatacenterOutput(ctx *Context, args *LookupDatacenterOutputArgs, opts ...InvokeOption) LookupDatacenterResultOutput
> Note: This function is named LookupDatacenter
in the Go SDK.
public static class GetDatacenter
{
public static Task<GetDatacenterResult> InvokeAsync(GetDatacenterArgs args, InvokeOptions? opts = null)
public static Output<GetDatacenterResult> Invoke(GetDatacenterInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatacenterResult> getDatacenter(GetDatacenterArgs args, InvokeOptions options)
public static Output<GetDatacenterResult> getDatacenter(GetDatacenterArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getDatacenter:getDatacenter
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- Id of an existing Virtual Data Center that you want to search for.
- Location string
Id of the existing Virtual Data Center's location.
Either
name
,location
orid
must be provided. If none, the datasource will return an error.- Name string
- Name of an existing Virtual Data Center that you want to search for.
- Timeouts
Get
Datacenter Timeouts
- Id string
- Id of an existing Virtual Data Center that you want to search for.
- Location string
Id of the existing Virtual Data Center's location.
Either
name
,location
orid
must be provided. If none, the datasource will return an error.- Name string
- Name of an existing Virtual Data Center that you want to search for.
- Timeouts
Get
Datacenter Timeouts
- id String
- Id of an existing Virtual Data Center that you want to search for.
- location String
Id of the existing Virtual Data Center's location.
Either
name
,location
orid
must be provided. If none, the datasource will return an error.- name String
- Name of an existing Virtual Data Center that you want to search for.
- timeouts
Get
Datacenter Timeouts
- id string
- Id of an existing Virtual Data Center that you want to search for.
- location string
Id of the existing Virtual Data Center's location.
Either
name
,location
orid
must be provided. If none, the datasource will return an error.- name string
- Name of an existing Virtual Data Center that you want to search for.
- timeouts
Get
Datacenter Timeouts
- id str
- Id of an existing Virtual Data Center that you want to search for.
- location str
Id of the existing Virtual Data Center's location.
Either
name
,location
orid
must be provided. If none, the datasource will return an error.- name str
- Name of an existing Virtual Data Center that you want to search for.
- timeouts
Get
Datacenter Timeouts
- id String
- Id of an existing Virtual Data Center that you want to search for.
- location String
Id of the existing Virtual Data Center's location.
Either
name
,location
orid
must be provided. If none, the datasource will return an error.- name String
- Name of an existing Virtual Data Center that you want to search for.
- timeouts Property Map
getDatacenter Result
The following output properties are available:
- Cpu
Architectures List<GetDatacenter Cpu Architecture> - Array of features and CPU families available in a location
- Description string
- Description for the Virtual Data Center
- Features List<string>
- List of features supported by the location this data center is part of
- Id string
- UUID of the Virtual Data Center
- Ipv6Cidr
Block string - Name string
- The name of the Virtual Data Center
- Sec
Auth boolProtection - Boolean value representing if the data center requires extra protection e.g. two factor protection
- Version double
- The version of that Data Center. Gets incremented with every change
- Location string
- The regional location where the Virtual Data Center will be created
- Timeouts
Get
Datacenter Timeouts
- Cpu
Architectures []GetDatacenter Cpu Architecture - Array of features and CPU families available in a location
- Description string
- Description for the Virtual Data Center
- Features []string
- List of features supported by the location this data center is part of
- Id string
- UUID of the Virtual Data Center
- Ipv6Cidr
Block string - Name string
- The name of the Virtual Data Center
- Sec
Auth boolProtection - Boolean value representing if the data center requires extra protection e.g. two factor protection
- Version float64
- The version of that Data Center. Gets incremented with every change
- Location string
- The regional location where the Virtual Data Center will be created
- Timeouts
Get
Datacenter Timeouts
- cpu
Architectures List<GetDatacenter Cpu Architecture> - Array of features and CPU families available in a location
- description String
- Description for the Virtual Data Center
- features List<String>
- List of features supported by the location this data center is part of
- id String
- UUID of the Virtual Data Center
- ipv6Cidr
Block String - name String
- The name of the Virtual Data Center
- sec
Auth BooleanProtection - Boolean value representing if the data center requires extra protection e.g. two factor protection
- version Double
- The version of that Data Center. Gets incremented with every change
- location String
- The regional location where the Virtual Data Center will be created
- timeouts
Get
Datacenter Timeouts
- cpu
Architectures GetDatacenter Cpu Architecture[] - Array of features and CPU families available in a location
- description string
- Description for the Virtual Data Center
- features string[]
- List of features supported by the location this data center is part of
- id string
- UUID of the Virtual Data Center
- ipv6Cidr
Block string - name string
- The name of the Virtual Data Center
- sec
Auth booleanProtection - 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
- location string
- The regional location where the Virtual Data Center will be created
- timeouts
Get
Datacenter Timeouts
- cpu_
architectures Sequence[GetDatacenter Cpu Architecture] - Array of features and CPU families available in a location
- description str
- Description for the Virtual Data Center
- features Sequence[str]
- List of features supported by the location this data center is part of
- id str
- UUID of the Virtual Data Center
- ipv6_
cidr_ strblock - name str
- The name of the Virtual Data Center
- sec_
auth_ boolprotection - Boolean value representing if the data center requires extra protection e.g. two factor protection
- version float
- The version of that Data Center. Gets incremented with every change
- location str
- The regional location where the Virtual Data Center will be created
- timeouts
Get
Datacenter Timeouts
- cpu
Architectures List<Property Map> - Array of features and CPU families available in a location
- description String
- Description for the Virtual Data Center
- features List<String>
- List of features supported by the location this data center is part of
- id String
- UUID of the Virtual Data Center
- ipv6Cidr
Block String - name String
- The name of the Virtual Data Center
- sec
Auth BooleanProtection - 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
- location String
- The regional location where the Virtual Data Center will be created
- timeouts Property Map
Supporting Types
GetDatacenterCpuArchitecture
- 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
GetDatacenterTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.