1. Packages
  2. AWS Classic
  3. API Docs
  4. directconnect
  5. getLocations

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.directconnect.getLocations

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 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({});
    
    import pulumi
    import pulumi_aws as aws
    
    available = aws.directconnect.get_locations()
    
    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, nil, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var available = Aws.DirectConnect.GetLocations.Invoke();
    
    });
    
    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();
    
        }
    }
    
    variables:
      available:
        fn::invoke:
          Function: aws:directconnect:getLocations
          Arguments: {}
    

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

    > 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)
    }
    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
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi