1. Packages
  2. Openstack Provider
  3. API Docs
  4. compute
  5. getAvailabilityZones
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

openstack.compute.getAvailabilityZones

Explore with Pulumi AI

openstack logo
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

    Use this data source to get a list of availability zones from OpenStack

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const zones = openstack.compute.getAvailabilityZones({});
    
    import pulumi
    import pulumi_openstack as openstack
    
    zones = openstack.compute.get_availability_zones()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.GetAvailabilityZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var zones = OpenStack.Compute.GetAvailabilityZones.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.compute.ComputeFunctions;
    import com.pulumi.openstack.compute.inputs.GetAvailabilityZonesArgs;
    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 zones = ComputeFunctions.getAvailabilityZones();
    
        }
    }
    
    variables:
      zones:
        fn::invoke:
          Function: openstack:compute:getAvailabilityZones
          Arguments: {}
    

    Using getAvailabilityZones

    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 getAvailabilityZones(args: GetAvailabilityZonesArgs, opts?: InvokeOptions): Promise<GetAvailabilityZonesResult>
    function getAvailabilityZonesOutput(args: GetAvailabilityZonesOutputArgs, opts?: InvokeOptions): Output<GetAvailabilityZonesResult>
    def get_availability_zones(region: Optional[str] = None,
                               state: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetAvailabilityZonesResult
    def get_availability_zones_output(region: Optional[pulumi.Input[str]] = None,
                               state: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetAvailabilityZonesResult]
    func GetAvailabilityZones(ctx *Context, args *GetAvailabilityZonesArgs, opts ...InvokeOption) (*GetAvailabilityZonesResult, error)
    func GetAvailabilityZonesOutput(ctx *Context, args *GetAvailabilityZonesOutputArgs, opts ...InvokeOption) GetAvailabilityZonesResultOutput

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

    public static class GetAvailabilityZones 
    {
        public static Task<GetAvailabilityZonesResult> InvokeAsync(GetAvailabilityZonesArgs args, InvokeOptions? opts = null)
        public static Output<GetAvailabilityZonesResult> Invoke(GetAvailabilityZonesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAvailabilityZonesResult> getAvailabilityZones(GetAvailabilityZonesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:compute/getAvailabilityZones:getAvailabilityZones
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Region string
    The region to fetch availability zones from, defaults to the provider's region
    State string
    The state of the availability zones to match, default ("available").
    Region string
    The region to fetch availability zones from, defaults to the provider's region
    State string
    The state of the availability zones to match, default ("available").
    region String
    The region to fetch availability zones from, defaults to the provider's region
    state String
    The state of the availability zones to match, default ("available").
    region string
    The region to fetch availability zones from, defaults to the provider's region
    state string
    The state of the availability zones to match, default ("available").
    region str
    The region to fetch availability zones from, defaults to the provider's region
    state str
    The state of the availability zones to match, default ("available").
    region String
    The region to fetch availability zones from, defaults to the provider's region
    state String
    The state of the availability zones to match, default ("available").

    getAvailabilityZones Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Names List<string>
    The names of the availability zones, ordered alphanumerically, that match the queried state
    Region string
    State string
    Id string
    The provider-assigned unique ID for this managed resource.
    Names []string
    The names of the availability zones, ordered alphanumerically, that match the queried state
    Region string
    State string
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    The names of the availability zones, ordered alphanumerically, that match the queried state
    region String
    state String
    id string
    The provider-assigned unique ID for this managed resource.
    names string[]
    The names of the availability zones, ordered alphanumerically, that match the queried state
    region string
    state string
    id str
    The provider-assigned unique ID for this managed resource.
    names Sequence[str]
    The names of the availability zones, ordered alphanumerically, that match the queried state
    region str
    state str
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    The names of the availability zones, ordered alphanumerically, that match the queried state
    region String
    state String

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi