aws.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
The following example shows how the resource might be used to obtain
using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetRegion.Invoke();
});
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 com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
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 current = 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 = 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
Region's description in this format: "Location (Region name)".
- Endpoint string
EC2 endpoint for the selected region.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
Name of the selected region.
- Description string
Region's description in this format: "Location (Region name)".
- Endpoint string
EC2 endpoint for the selected region.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
Name of the selected region.
- description String
Region's description in this format: "Location (Region name)".
- endpoint String
EC2 endpoint for the selected region.
- id String
The provider-assigned unique ID for this managed resource.
- name String
Name of the selected region.
- description string
Region's description in this format: "Location (Region name)".
- endpoint string
EC2 endpoint for the selected region.
- id string
The provider-assigned unique ID for this managed resource.
- name string
Name of the selected region.
- description str
Region's description in this format: "Location (Region name)".
- endpoint str
EC2 endpoint for the selected region.
- id str
The provider-assigned unique ID for this managed resource.
- name str
Name of the selected region.
- description String
Region's description in this format: "Location (Region name)".
- endpoint String
EC2 endpoint for the selected region.
- id String
The provider-assigned unique ID for this managed resource.
- name String
Name of the selected region.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.