AWS Classic

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

getAvailabilityZone

aws.getAvailabilityZone provides details about a specific availability zone (AZ) in the current region.

This can be used both to validate an availability zone given in a variable and to split the AZ name into its component parts of an AWS region and an AZ identifier letter. The latter may be useful e.g., for implementing a consistent subnet numbering scheme across several regions by mapping both the region and the subnet letter to network numbers.

This is different from the aws.getAvailabilityZones (plural) data source, which provides a list of the available zones.

Using getAvailabilityZone

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 getAvailabilityZone(args: GetAvailabilityZoneArgs, opts?: InvokeOptions): Promise<GetAvailabilityZoneResult>
function getAvailabilityZoneOutput(args: GetAvailabilityZoneOutputArgs, opts?: InvokeOptions): Output<GetAvailabilityZoneResult>
def get_availability_zone(all_availability_zones: Optional[bool] = None,
                          filters: Optional[Sequence[GetAvailabilityZoneFilter]] = None,
                          name: Optional[str] = None,
                          state: Optional[str] = None,
                          zone_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAvailabilityZoneResult
def get_availability_zone_output(all_availability_zones: Optional[pulumi.Input[bool]] = None,
                          filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetAvailabilityZoneFilterArgs]]]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          state: Optional[pulumi.Input[str]] = None,
                          zone_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAvailabilityZoneResult]
func GetAvailabilityZone(ctx *Context, args *GetAvailabilityZoneArgs, opts ...InvokeOption) (*GetAvailabilityZoneResult, error)
func GetAvailabilityZoneOutput(ctx *Context, args *GetAvailabilityZoneOutputArgs, opts ...InvokeOption) GetAvailabilityZoneResultOutput

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

public static class GetAvailabilityZone 
{
    public static Task<GetAvailabilityZoneResult> InvokeAsync(GetAvailabilityZoneArgs args, InvokeOptions? opts = null)
    public static Output<GetAvailabilityZoneResult> Invoke(GetAvailabilityZoneInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

AllAvailabilityZones bool
Set to true to include all Availability Zones and Local Zones regardless of your opt in status.
Filters List<GetAvailabilityZoneFilter>
Configuration block(s) for filtering. Detailed below.
Name string
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
State string
A specific availability zone state to require. May be any of "available", "information" or "impaired".
ZoneId string
The zone ID of the availability zone to select.
AllAvailabilityZones bool
Set to true to include all Availability Zones and Local Zones regardless of your opt in status.
Filters []GetAvailabilityZoneFilter
Configuration block(s) for filtering. Detailed below.
Name string
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
State string
A specific availability zone state to require. May be any of "available", "information" or "impaired".
ZoneId string
The zone ID of the availability zone to select.
allAvailabilityZones boolean
Set to true to include all Availability Zones and Local Zones regardless of your opt in status.
filters GetAvailabilityZoneFilter[]
Configuration block(s) for filtering. Detailed below.
name string
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
state string
A specific availability zone state to require. May be any of "available", "information" or "impaired".
zoneId string
The zone ID of the availability zone to select.
all_availability_zones bool
Set to true to include all Availability Zones and Local Zones regardless of your opt in status.
filters Sequence[GetAvailabilityZoneFilter]
Configuration block(s) for filtering. Detailed below.
name str
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
state str
A specific availability zone state to require. May be any of "available", "information" or "impaired".
zone_id str
The zone ID of the availability zone to select.

getAvailabilityZone Result

The following output properties are available:

GroupName string
For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example us-west-2-lax-1.
Id string
The provider-assigned unique ID for this managed resource.
Name string
NameSuffix string
The part of the AZ name that appears after the region name, uniquely identifying the AZ within its region. For Availability Zones this is usually a single letter, for example a for the us-west-2a zone. For Local and Wavelength Zones this is a longer string, for example wl1-sfo-wlz-1 for the us-west-2-wl1-sfo-wlz-1 zone.
NetworkBorderGroup string
The name of the location from which the address is advertised.
OptInStatus string
For Availability Zones, this always has the value of opt-in-not-required. For Local Zones, this is the opt in status. The possible values are opted-in and not-opted-in.
ParentZoneId string
The ID of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
ParentZoneName string
The name of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
Region string
The region where the selected availability zone resides. This is always the region selected on the provider, since this data source searches only within that region.
State string
ZoneId string
ZoneType string
The type of zone. Values are availability-zone, local-zone, and wavelength-zone.
AllAvailabilityZones bool
Filters List<GetAvailabilityZoneFilter>
GroupName string
For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example us-west-2-lax-1.
Id string
The provider-assigned unique ID for this managed resource.
Name string
NameSuffix string
The part of the AZ name that appears after the region name, uniquely identifying the AZ within its region. For Availability Zones this is usually a single letter, for example a for the us-west-2a zone. For Local and Wavelength Zones this is a longer string, for example wl1-sfo-wlz-1 for the us-west-2-wl1-sfo-wlz-1 zone.
NetworkBorderGroup string
The name of the location from which the address is advertised.
OptInStatus string
For Availability Zones, this always has the value of opt-in-not-required. For Local Zones, this is the opt in status. The possible values are opted-in and not-opted-in.
ParentZoneId string
The ID of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
ParentZoneName string
The name of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
Region string
The region where the selected availability zone resides. This is always the region selected on the provider, since this data source searches only within that region.
State string
ZoneId string
ZoneType string
The type of zone. Values are availability-zone, local-zone, and wavelength-zone.
AllAvailabilityZones bool
Filters []GetAvailabilityZoneFilter
groupName string
For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example us-west-2-lax-1.
id string
The provider-assigned unique ID for this managed resource.
name string
nameSuffix string
The part of the AZ name that appears after the region name, uniquely identifying the AZ within its region. For Availability Zones this is usually a single letter, for example a for the us-west-2a zone. For Local and Wavelength Zones this is a longer string, for example wl1-sfo-wlz-1 for the us-west-2-wl1-sfo-wlz-1 zone.
networkBorderGroup string
The name of the location from which the address is advertised.
optInStatus string
For Availability Zones, this always has the value of opt-in-not-required. For Local Zones, this is the opt in status. The possible values are opted-in and not-opted-in.
parentZoneId string
The ID of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
parentZoneName string
The name of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
region string
The region where the selected availability zone resides. This is always the region selected on the provider, since this data source searches only within that region.
state string
zoneId string
zoneType string
The type of zone. Values are availability-zone, local-zone, and wavelength-zone.
allAvailabilityZones boolean
filters GetAvailabilityZoneFilter[]
group_name str
For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example us-west-2-lax-1.
id str
The provider-assigned unique ID for this managed resource.
name str
name_suffix str
The part of the AZ name that appears after the region name, uniquely identifying the AZ within its region. For Availability Zones this is usually a single letter, for example a for the us-west-2a zone. For Local and Wavelength Zones this is a longer string, for example wl1-sfo-wlz-1 for the us-west-2-wl1-sfo-wlz-1 zone.
network_border_group str
The name of the location from which the address is advertised.
opt_in_status str
For Availability Zones, this always has the value of opt-in-not-required. For Local Zones, this is the opt in status. The possible values are opted-in and not-opted-in.
parent_zone_id str
The ID of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
parent_zone_name str
The name of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls.
region str
The region where the selected availability zone resides. This is always the region selected on the provider, since this data source searches only within that region.
state str
zone_id str
zone_type str
The type of zone. Values are availability-zone, local-zone, and wavelength-zone.
all_availability_zones bool
filters Sequence[GetAvailabilityZoneFilter]

Supporting Types

GetAvailabilityZoneFilter

Name string
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
Values List<string>
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
Name string
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
Values []string
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
name string
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
values string[]
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
name str
The name of the filter field. Valid values can be found in the EC2 DescribeAvailabilityZones API Reference.
values Sequence[str]
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 aws Terraform Provider.