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

ionoscloud.getDatacenter

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    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 or id 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 GetDatacenterTimeouts
    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 or id 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 GetDatacenterTimeouts
    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 or id 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 GetDatacenterTimeouts
    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 or id 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 GetDatacenterTimeouts
    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 or id 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 GetDatacenterTimeouts
    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 or id 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:

    CpuArchitectures List<GetDatacenterCpuArchitecture>
    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
    Ipv6CidrBlock string
    Name string
    The name of the Virtual Data Center
    SecAuthProtection bool
    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 GetDatacenterTimeouts
    CpuArchitectures []GetDatacenterCpuArchitecture
    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
    Ipv6CidrBlock string
    Name string
    The name of the Virtual Data Center
    SecAuthProtection bool
    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 GetDatacenterTimeouts
    cpuArchitectures List<GetDatacenterCpuArchitecture>
    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
    ipv6CidrBlock String
    name String
    The name of the Virtual Data Center
    secAuthProtection Boolean
    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 GetDatacenterTimeouts
    cpuArchitectures GetDatacenterCpuArchitecture[]
    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
    ipv6CidrBlock string
    name string
    The name of the Virtual Data Center
    secAuthProtection boolean
    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 GetDatacenterTimeouts
    cpu_architectures Sequence[GetDatacenterCpuArchitecture]
    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_block str
    name str
    The name of the Virtual Data Center
    sec_auth_protection bool
    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 GetDatacenterTimeouts
    cpuArchitectures 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
    ipv6CidrBlock String
    name String
    The name of the Virtual Data Center
    secAuthProtection Boolean
    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

    CpuFamily string
    A valid CPU family name
    MaxCores double
    The maximum number of cores available
    MaxRam double
    The maximum number of RAM in MB
    Vendor string
    A valid CPU vendor name
    CpuFamily string
    A valid CPU family name
    MaxCores float64
    The maximum number of cores available
    MaxRam float64
    The maximum number of RAM in MB
    Vendor string
    A valid CPU vendor name
    cpuFamily String
    A valid CPU family name
    maxCores Double
    The maximum number of cores available
    maxRam Double
    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 float
    The maximum number of cores available
    max_ram float
    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

    GetDatacenterTimeouts

    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

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud