1. Packages
  2. AWS
  3. API Docs
  4. directconnect
  5. getLocations
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.directconnect.getLocations

Explore with Pulumi AI

AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const available = aws.directconnect.getLocations({});
Copy
import pulumi
import pulumi_aws as aws

available = aws.directconnect.get_locations()
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := directconnect.GetLocations(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

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

});
Copy
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();

    }
}
Copy
variables:
  available:
    fn::invoke:
      function: aws:directconnect:getLocations
      arguments: {}
Copy

Using getLocations

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 getLocations(opts?: InvokeOptions): Promise<GetLocationsResult>
function getLocationsOutput(opts?: InvokeOptions): Output<GetLocationsResult>
Copy
def get_locations(opts: Optional[InvokeOptions] = None) -> GetLocationsResult
def get_locations_output(opts: Optional[InvokeOptions] = None) -> Output[GetLocationsResult]
Copy
func GetLocations(ctx *Context, opts ...InvokeOption) (*GetLocationsResult, error)
func GetLocationsOutput(ctx *Context, opts ...InvokeOption) GetLocationsResultOutput
Copy

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

public static class GetLocations 
{
    public static Task<GetLocationsResult> InvokeAsync(InvokeOptions? opts = null)
    public static Output<GetLocationsResult> Invoke(InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLocationsResult> getLocations(InvokeOptions options)
public static Output<GetLocationsResult> getLocations(InvokeOptions options)
Copy
fn::invoke:
  function: aws:directconnect/getLocations:getLocations
  arguments:
    # arguments dictionary
Copy

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
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi