AWS Classic
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/v5/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
})
}
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 current = Output.of(AwsFunctions.getRegion());
}
}
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());
variables:
current:
Fn::Invoke:
Function: aws:getRegion
Arguments: {}
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)
}
public static CompletableFuture<GetRegionResult> getRegion(GetRegionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: aws:index/getRegion:getRegion
Arguments:
# Arguments dictionary
The following arguments are supported:
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 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.
- 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.