getZones

This data source provides availability zones for KVStore that can be accessed by an Alibaba Cloud account within the region configured in the provider.

NOTE: Available in v1.73.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var zonesIds = Output.Create(AliCloud.KVStore.GetZones.InvokeAsync());
        // Create an KVStore instance with the first matched zone
        var kvstore = new AliCloud.KVStore.Instance("kvstore", new AliCloud.KVStore.InstanceArgs
        {
            AvailabilityZone = zonesIds.Apply(zonesIds => zonesIds.Zones[0].Id),
        });
        // Other properties...
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kvstore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		zonesIds, err := kvstore.GetZones(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = kvstore.NewInstance(ctx, "kvstore", &kvstore.InstanceArgs{
			AvailabilityZone: pulumi.String(zonesIds.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_alicloud as alicloud

zones_ids = alicloud.kvstore.get_zones()
# Create an KVStore instance with the first matched zone
kvstore = alicloud.kvstore.Instance("kvstore", availability_zone=zones_ids.zones[0].id)
# Other properties...
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const zonesIds = alicloud.kvstore.getZones({});
// Create an KVStore instance with the first matched zone
const kvstore = new alicloud.kvstore.Instance("kvstore", {availabilityZone: zonesIds.then(zonesIds => zonesIds.zones[0].id)});
// Other properties...

Using getZones

function getZones(args: GetZonesArgs, opts?: InvokeOptions): Promise<GetZonesResult>
def get_zones(engine: Optional[str] = None,
              instance_charge_type: Optional[str] = None,
              multi: Optional[bool] = None,
              output_file: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetZonesResult
func GetZones(ctx *Context, args *GetZonesArgs, opts ...InvokeOption) (*GetZonesResult, error)

Note: This function is named GetZones in the Go SDK.

public static class GetZones {
    public static Task<GetZonesResult> InvokeAsync(GetZonesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Engine string
InstanceChargeType string
Filter the results by a specific instance charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.
Multi bool
Indicate whether the zones can be used in a multi AZ configuration. Default to false. Multi AZ is usually used to launch KVStore instances.
OutputFile string
Engine string
InstanceChargeType string
Filter the results by a specific instance charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.
Multi bool
Indicate whether the zones can be used in a multi AZ configuration. Default to false. Multi AZ is usually used to launch KVStore instances.
OutputFile string
engine string
instanceChargeType string
Filter the results by a specific instance charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.
multi boolean
Indicate whether the zones can be used in a multi AZ configuration. Default to false. Multi AZ is usually used to launch KVStore instances.
outputFile string
engine str
instance_charge_type str
Filter the results by a specific instance charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.
multi bool
Indicate whether the zones can be used in a multi AZ configuration. Default to false. Multi AZ is usually used to launch KVStore instances.
output_file str

getZones Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
A list of zone IDs.
Zones List<Pulumi.AliCloud.KVStore.Outputs.GetZonesZone>
A list of availability zones. Each element contains the following attributes:
Engine string
InstanceChargeType string
Multi bool
OutputFile string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of zone IDs.
Zones []GetZonesZone
A list of availability zones. Each element contains the following attributes:
Engine string
InstanceChargeType string
Multi bool
OutputFile string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of zone IDs.
zones GetZonesZone[]
A list of availability zones. Each element contains the following attributes:
engine string
instanceChargeType string
multi boolean
outputFile string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of zone IDs.
zones Sequence[GetZonesZone]
A list of availability zones. Each element contains the following attributes:
engine str
instance_charge_type str
multi bool
output_file str

Supporting Types

GetZonesZone

Id string
ID of the zone.
MultiZoneIds List<string>
A list of zone ids in which the multi zone.
Id string
ID of the zone.
MultiZoneIds []string
A list of zone ids in which the multi zone.
id string
ID of the zone.
multiZoneIds string[]
A list of zone ids in which the multi zone.
id str
ID of the zone.
multi_zone_ids Sequence[str]
A list of zone ids in which the multi zone.

Package Details

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