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

ionoscloud.getLocation

Explore with Pulumi AI

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

    The Location data source can be used to search for and return an existing location which can then be used elsewhere in the configuration. 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

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getLocation({
        feature: "SSD",
        name: "karlsruhe",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_location(feature="SSD",
        name="karlsruhe")
    
    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.GetLocation(ctx, &ionoscloud.GetLocationArgs{
    			Feature: pulumi.StringRef("SSD"),
    			Name:    pulumi.StringRef("karlsruhe"),
    		}, 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.GetLocation.Invoke(new()
        {
            Feature = "SSD",
            Name = "karlsruhe",
        });
    
    });
    
    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.GetLocationArgs;
    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.getLocation(GetLocationArgs.builder()
                .feature("SSD")
                .name("karlsruhe")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getLocation
          arguments:
            feature: SSD
            name: karlsruhe
    

    Using getLocation

    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 getLocation(args: GetLocationArgs, opts?: InvokeOptions): Promise<GetLocationResult>
    function getLocationOutput(args: GetLocationOutputArgs, opts?: InvokeOptions): Output<GetLocationResult>
    def get_location(feature: Optional[str] = None,
                     id: Optional[str] = None,
                     name: Optional[str] = None,
                     timeouts: Optional[GetLocationTimeouts] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLocationResult
    def get_location_output(feature: Optional[pulumi.Input[str]] = None,
                     id: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     timeouts: Optional[pulumi.Input[GetLocationTimeoutsArgs]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetLocationResult]
    func GetLocation(ctx *Context, args *GetLocationArgs, opts ...InvokeOption) (*GetLocationResult, error)
    func GetLocationOutput(ctx *Context, args *GetLocationOutputArgs, opts ...InvokeOption) GetLocationResultOutput

    > Note: This function is named GetLocation in the Go SDK.

    public static class GetLocation 
    {
        public static Task<GetLocationResult> InvokeAsync(GetLocationArgs args, InvokeOptions? opts = null)
        public static Output<GetLocationResult> Invoke(GetLocationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLocationResult> getLocation(GetLocationArgs args, InvokeOptions options)
    public static Output<GetLocationResult> getLocation(GetLocationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getLocation:getLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Feature string
    A desired feature that the location must be able to provide.
    Id string
    UUID of the location
    Name string
    Name of the location to search for.
    Timeouts GetLocationTimeouts
    Feature string
    A desired feature that the location must be able to provide.
    Id string
    UUID of the location
    Name string
    Name of the location to search for.
    Timeouts GetLocationTimeouts
    feature String
    A desired feature that the location must be able to provide.
    id String
    UUID of the location
    name String
    Name of the location to search for.
    timeouts GetLocationTimeouts
    feature string
    A desired feature that the location must be able to provide.
    id string
    UUID of the location
    name string
    Name of the location to search for.
    timeouts GetLocationTimeouts
    feature str
    A desired feature that the location must be able to provide.
    id str
    UUID of the location
    name str
    Name of the location to search for.
    timeouts GetLocationTimeouts
    feature String
    A desired feature that the location must be able to provide.
    id String
    UUID of the location
    name String
    Name of the location to search for.
    timeouts Property Map

    getLocation Result

    The following output properties are available:

    CpuArchitectures List<GetLocationCpuArchitecture>
    Array of features and CPU families available in a location
    Feature string
    Id string
    UUID of the location
    ImageAliases List<string>
    List of image aliases available for the location
    Name string
    Timeouts GetLocationTimeouts
    CpuArchitectures []GetLocationCpuArchitecture
    Array of features and CPU families available in a location
    Feature string
    Id string
    UUID of the location
    ImageAliases []string
    List of image aliases available for the location
    Name string
    Timeouts GetLocationTimeouts
    cpuArchitectures List<GetLocationCpuArchitecture>
    Array of features and CPU families available in a location
    feature String
    id String
    UUID of the location
    imageAliases List<String>
    List of image aliases available for the location
    name String
    timeouts GetLocationTimeouts
    cpuArchitectures GetLocationCpuArchitecture[]
    Array of features and CPU families available in a location
    feature string
    id string
    UUID of the location
    imageAliases string[]
    List of image aliases available for the location
    name string
    timeouts GetLocationTimeouts
    cpu_architectures Sequence[GetLocationCpuArchitecture]
    Array of features and CPU families available in a location
    feature str
    id str
    UUID of the location
    image_aliases Sequence[str]
    List of image aliases available for the location
    name str
    timeouts GetLocationTimeouts
    cpuArchitectures List<Property Map>
    Array of features and CPU families available in a location
    feature String
    id String
    UUID of the location
    imageAliases List<String>
    List of image aliases available for the location
    name String
    timeouts Property Map

    Supporting Types

    GetLocationCpuArchitecture

    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.

    GetLocationTimeouts

    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