AWS Classic

v4.30.0 published on Tuesday, Nov 30, 2021 by Pulumi

getRegion

aws.getRegion provides details about a specific AWS region.

As well as validating a given region name this resource can be used to discover the name of the region configured within the provider. The latter can be useful in a child module which is inheriting an AWS provider configuration from its parent module.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Aws.GetRegion.InvokeAsync());
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aws.GetRegion(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

current = aws.get_region()
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = pulumi.output(aws.getRegion());

Using getRegion

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 getRegion(args: GetRegionArgs, opts?: InvokeOptions): Promise<GetRegionResult>
function getRegionOutput(args: GetRegionOutputArgs, opts?: InvokeOptions): Output<GetRegionResult>
def get_region(endpoint: Optional[str] = None,
               name: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetRegionResult
def get_region_output(endpoint: Optional[pulumi.Input[str]] = None,
               name: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetRegionResult]
func GetRegion(ctx *Context, args *GetRegionArgs, opts ...InvokeOption) (*GetRegionResult, error)
func GetRegionOutput(ctx *Context, args *GetRegionOutputArgs, opts ...InvokeOption) GetRegionResultOutput

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

public static class GetRegion 
{
    public static Task<GetRegionResult> InvokeAsync(GetRegionArgs args, InvokeOptions? opts = null)
    public static Output<GetRegionResult> Invoke(GetRegionInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Endpoint string
The EC2 endpoint of the region to select.
Name string
The full name of the region to select.
Endpoint string
The EC2 endpoint of the region to select.
Name string
The full name of the region to select.
endpoint string
The EC2 endpoint of the region to select.
name string
The full name of the region to select.
endpoint str
The EC2 endpoint of the region to select.
name str
The full name of the region to select.

getRegion Result

The following output properties are available:

Description string
The region’s description in this format: “Location (Region name)”.
Endpoint string
The EC2 endpoint for the selected region.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the selected region.
Description string
The region’s description in this format: “Location (Region name)”.
Endpoint string
The EC2 endpoint for the selected region.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the selected region.
description string
The region’s description in this format: “Location (Region name)”.
endpoint string
The EC2 endpoint for the selected region.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the selected region.
description str
The region’s description in this format: “Location (Region name)”.
endpoint str
The EC2 endpoint for the selected region.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the selected region.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.