AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.1 published on Tuesday, Jun 21, 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 Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var available = Output.Create(Aws.DirectConnect.GetLocations.InvokeAsync());
    }

}
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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var available = Output.of(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>

The code for the locations.

Id string

The provider-assigned unique ID for this managed resource.

LocationCodes []string

The code for the locations.

id String

The provider-assigned unique ID for this managed resource.

locationCodes List<String>

The code for the locations.

id string

The provider-assigned unique ID for this managed resource.

locationCodes string[]

The code for the locations.

id str

The provider-assigned unique ID for this managed resource.

location_codes Sequence[str]

The code for the locations.

id String

The provider-assigned unique ID for this managed resource.

locationCodes List<String>

The 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.