/
getAvailabilityZones.ts
68 lines (64 loc) · 2.32 KB
/
getAvailabilityZones.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
/**
* The Availability Zones data source allows access to the list of AWS
* Availability Zones which can be accessed by an AWS account within the region
* configured in the provider.
*
* This is different from the `aws_availability_zone` (singular) data source,
* which provides some details about a specific availability zone.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* // Declare the data source
* const available = pulumi.output(aws.getAvailabilityZones({}));
* const primary = new aws.ec2.Subnet("primary", {
* availabilityZone: available.apply(available => available.names[0]),
* });
* const secondary = new aws.ec2.Subnet("secondary", {
* availabilityZone: available.apply(available => available.names[1]),
* });
* ```
*/
export function getAvailabilityZones(args?: GetAvailabilityZonesArgs, opts?: pulumi.InvokeOptions): Promise<GetAvailabilityZonesResult> {
args = args || {};
return pulumi.runtime.invoke("aws:index/getAvailabilityZones:getAvailabilityZones", {
"state": args.state,
}, opts);
}
/**
* A collection of arguments for invoking getAvailabilityZones.
*/
export interface GetAvailabilityZonesArgs {
/**
* Allows to filter list of Availability Zones based on their
* current state. Can be either `"available"`, `"information"`, `"impaired"` or
* `"unavailable"`. By default the list includes a complete set of Availability Zones
* to which the underlying AWS account has access, regardless of their state.
*/
readonly state?: string;
}
/**
* A collection of values returned by getAvailabilityZones.
*/
export interface GetAvailabilityZonesResult {
/**
* A list of the Availability Zone names available to the account.
*/
readonly names: string[];
readonly state?: string;
/**
* A list of the Availability Zone IDs available to the account.
*/
readonly zoneIds: string[];
/**
* id is the provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}