GetRegions
Provides information about AWS Regions. Can be used to filter regions i.e. by Opt-In status or only regions enabled for current account. To get details like endpoint and description of each region the data source can be combined with the aws.getRegion data source.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var current = Output.Create(Aws.GetRegions.InvokeAsync());
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aws.GetRegions(ctx, nil, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
current = aws.get_regions()import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = pulumi.output(aws.getRegions({ async: true }));Using GetRegions
function getRegions(args: GetRegionsArgs, opts?: InvokeOptions): Promise<GetRegionsResult>function get_regions(all_regions=None, filters=None, opts=None)func GetRegions(ctx *Context, args *GetRegionsArgs, opts ...InvokeOption) (*GetRegionsResult, error)public static class GetRegions {
public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- All
Regions bool If true the source will query all regions regardless of availability.
- Filters
List<Get
Regions Filter Args> Configuration block(s) to use as filters. Detailed below.
- All
Regions bool If true the source will query all regions regardless of availability.
- Filters
[]Get
Regions Filter Configuration block(s) to use as filters. Detailed below.
- all
Regions boolean If true the source will query all regions regardless of availability.
- filters
Get
Regions Filter[] Configuration block(s) to use as filters. Detailed below.
- all_
regions bool If true the source will query all regions regardless of availability.
- filters
List[Get
Regions Filter] Configuration block(s) to use as filters. Detailed below.
GetRegions Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Names List<string>
Names of regions that meets the criteria.
- All
Regions bool - Filters
List<Get
Regions Filter>
- Id string
The provider-assigned unique ID for this managed resource.
- Names []string
Names of regions that meets the criteria.
- All
Regions bool - Filters
[]Get
Regions Filter
- id string
The provider-assigned unique ID for this managed resource.
- names string[]
Names of regions that meets the criteria.
- all
Regions boolean - filters
Get
Regions Filter[]
- id str
The provider-assigned unique ID for this managed resource.
- names List[str]
Names of regions that meets the criteria.
- all_
regions bool - filters
List[Get
Regions Filter]
Supporting Types
GetRegionsFilter
- Name string
The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].
- Values List<string>
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.