AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.route53.getZones
Explore with Pulumi AI
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:
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.