AWS Classic

v5.21.1 published on Thursday, Nov 17, 2022 by Pulumi

getLocations

Retrieve information about the AWS Direct Connect locations in the current AWS Region. These are the locations that can be specified when configuring aws.directconnect.Connection or aws.directconnect.LinkAggregationGroup resources.

Note: This data source is different from the aws.directconnect.getLocation data source which retrieves information about a specific AWS Direct Connect location in the current AWS Region.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var available = Aws.DirectConnect.GetLocations.Invoke();

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/directconnect"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := directconnect.GetLocations(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.directconnect.DirectconnectFunctions;
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 available = DirectconnectFunctions.getLocations();

    }
}
import pulumi
import pulumi_aws as aws

available = aws.directconnect.get_locations()
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const available = pulumi.output(aws.directconnect.getLocations());
variables:
  available:
    Fn::Invoke:
      Function: aws:directconnect:getLocations
      Arguments: {}

Using getLocations

function getLocations(opts?: InvokeOptions): Promise<GetLocationsResult>
def get_locations(opts: Optional[InvokeOptions] = None) -> GetLocationsResult
func GetLocations(ctx *Context, opts ...InvokeOption) (*GetLocationsResult, error)

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

public static class GetLocations 
{
    public static Task<GetLocationsResult> InvokeAsync(InvokeOptions? opts = null)
}
public static CompletableFuture<GetLocationsResult> getLocations(InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: aws:directconnect/getLocations:getLocations
  arguments:
    # arguments dictionary

getLocations Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

LocationCodes List<string>

Code for the locations.

Id string

The provider-assigned unique ID for this managed resource.

LocationCodes []string

Code for the locations.

id String

The provider-assigned unique ID for this managed resource.

locationCodes List<String>

Code for the locations.

id string

The provider-assigned unique ID for this managed resource.

locationCodes string[]

Code for the locations.

id str

The provider-assigned unique ID for this managed resource.

location_codes Sequence[str]

Code for the locations.

id String

The provider-assigned unique ID for this managed resource.

locationCodes List<String>

Code for the locations.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.