1. Packages
  2. AWS
  3. API Docs
  4. route53
  5. getZones
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.route53.getZones

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    This resource can be useful for getting back a list of Route53 Hosted Zone IDs for a Region.

    Example Usage

    The following example retrieves a list of all Hosted Zone IDs.

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const all = aws.route53.getZones({});
    export const example = all.then(all => all.ids);
    
    import pulumi
    import pulumi_aws as aws
    
    all = aws.route53.get_zones()
    pulumi.export("example", all.ids)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := route53.GetZones(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("example", all.Ids)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Aws.Route53.GetZones.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["example"] = all.Apply(getZonesResult => getZonesResult.Ids),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.route53.Route53Functions;
    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 all = Route53Functions.getZones();
    
            ctx.export("example", all.applyValue(getZonesResult -> getZonesResult.ids()));
        }
    }
    
    variables:
      all:
        fn::invoke:
          Function: aws:route53:getZones
          Arguments: {}
    outputs:
      example: ${all.ids}
    

    Using getZones

    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 getZones(opts?: InvokeOptions): Promise<GetZonesResult>
    function getZonesOutput(opts?: InvokeOptions): Output<GetZonesResult>
    def get_zones(opts: Optional[InvokeOptions] = None) -> GetZonesResult
    def get_zones_output(opts: Optional[InvokeOptions] = None) -> Output[GetZonesResult]
    func GetZones(ctx *Context, opts ...InvokeOption) (*GetZonesResult, error)
    func GetZonesOutput(ctx *Context, opts ...InvokeOption) GetZonesResultOutput

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

    public static class GetZones 
    {
        public static Task<GetZonesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetZonesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetZonesResult> getZones(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:route53/getZones:getZones
      arguments:
        # arguments dictionary

    getZones Result

    The following output properties are available:

    Id string
    Ids List<string>
    A list of all the Route53 Hosted Zone IDs found.
    Id string
    Ids []string
    A list of all the Route53 Hosted Zone IDs found.
    id String
    ids List<String>
    A list of all the Route53 Hosted Zone IDs found.
    id string
    ids string[]
    A list of all the Route53 Hosted Zone IDs found.
    id str
    ids Sequence[str]
    A list of all the Route53 Hosted Zone IDs found.
    id String
    ids List<String>
    A list of all the Route53 Hosted Zone IDs found.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi