ionoscloud.compute.getLocation
Explore with Pulumi AI
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:
getLocation Result
The following output properties are available:
- Cpu
Architectures List<Ionoscloud.Get Location Cpu Architecture> - Array of features and CPU families available in a location
- Feature string
- Id string
- The provider-assigned unique ID for this managed resource.
- Image
Aliases List<string> - List of image aliases available for the location
- Name string
- Cpu
Architectures []GetLocation Cpu Architecture - Array of features and CPU families available in a location
- Feature string
- Id string
- The provider-assigned unique ID for this managed resource.
- Image
Aliases []string - List of image aliases available for the location
- Name string
- cpu
Architectures List<GetLocation Cpu Architecture> - Array of features and CPU families available in a location
- feature String
- id String
- The provider-assigned unique ID for this managed resource.
- image
Aliases List<String> - List of image aliases available for the location
- name String
- cpu
Architectures GetLocation Cpu Architecture[] - Array of features and CPU families available in a location
- feature string
- id string
- The provider-assigned unique ID for this managed resource.
- image
Aliases string[] - List of image aliases available for the location
- name string
- cpu_
architectures Sequence[GetLocation Cpu Architecture] - 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
- cpu
Architectures 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.
- image
Aliases List<String> - List of image aliases available for the location
- name String
Supporting Types
GetLocationCpuArchitecture
- 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.
Package Details
- Repository
- ionoscloud ionos-cloud/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.