1. Packages
  2. Ionoscloud
  3. API Docs
  4. compute
  5. getLocation
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.compute.getLocation

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 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.compute.getLocation({
        name: "karlsruhe",
        feature: "SSD",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.compute.get_location(name="karlsruhe",
        feature="SSD")
    
    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.GetLocation(ctx, &compute.GetLocationArgs{
    			Name:    pulumi.StringRef("karlsruhe"),
    			Feature: pulumi.StringRef("SSD"),
    		}, 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.Compute.GetLocation.Invoke(new()
        {
            Name = "karlsruhe",
            Feature = "SSD",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.compute.ComputeFunctions;
    import com.pulumi.ionoscloud.compute.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 = ComputeFunctions.getLocation(GetLocationArgs.builder()
                .name("karlsruhe")
                .feature("SSD")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:compute:getLocation
          arguments:
            name: karlsruhe
            feature: SSD
    

    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,
                     name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLocationResult
    def get_location_output(feature: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = 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:compute/getLocation:getLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Feature string
    A desired feature that the location must be able to provide.
    Name string
    Name of the location to search for.
    Feature string
    A desired feature that the location must be able to provide.
    Name string
    Name of the location to search for.
    feature String
    A desired feature that the location must be able to provide.
    name String
    Name of the location to search for.
    feature string
    A desired feature that the location must be able to provide.
    name string
    Name of the location to search for.
    feature str
    A desired feature that the location must be able to provide.
    name str
    Name of the location to search for.
    feature String
    A desired feature that the location must be able to provide.
    name String
    Name of the location to search for.

    getLocation Result

    The following output properties are available:

    CpuArchitectures List<Ionoscloud.GetLocationCpuArchitecture>
    Array of features and CPU families available in a location
    Feature string
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageAliases List<string>
    List of image aliases available for the location
    Name string
    CpuArchitectures []GetLocationCpuArchitecture
    Array of features and CPU families available in a location
    Feature string
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageAliases []string
    List of image aliases available for the location
    Name string
    cpuArchitectures List<GetLocationCpuArchitecture>
    Array of features and CPU families available in a location
    feature String
    id String
    The provider-assigned unique ID for this managed resource.
    imageAliases List<String>
    List of image aliases available for the location
    name String
    cpuArchitectures GetLocationCpuArchitecture[]
    Array of features and CPU families available in a location
    feature string
    id string
    The provider-assigned unique ID for this managed resource.
    imageAliases string[]
    List of image aliases available for the location
    name string
    cpu_architectures Sequence[GetLocationCpuArchitecture]
    Array of features and CPU families available in a location
    feature str
    id str
    The provider-assigned unique ID for this managed resource.
    image_aliases Sequence[str]
    List of image aliases available for the location
    name str
    cpuArchitectures List<Property Map>
    Array of features and CPU families available in a location
    feature String
    id String
    The provider-assigned unique ID for this managed resource.
    imageAliases List<String>
    List of image aliases available for the location
    name String

    Supporting Types

    GetLocationCpuArchitecture

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

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud