getZone

suspend fun getZone(argument: GetZonePlainArgs): GetZoneResult

aws.route53.Zone provides details about a specific Route 53 Hosted Zone. This data source allows to find a Hosted Zone ID given Hosted Zone name and certain search criteria.

Example Usage

The following example shows how to get a Hosted Zone from its name and from this data how to create a Record Set.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.Route53Functions;
import com.pulumi.aws.route53.inputs.GetZoneArgs;
import com.pulumi.aws.route53.Record;
import com.pulumi.aws.route53.RecordArgs;
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 selected = Route53Functions.getZone(GetZoneArgs.builder()
.name("test.com.")
.privateZone(true)
.build());
var www = new Record("www", RecordArgs.builder()
.zoneId(selected.applyValue(getZoneResult -> getZoneResult.zoneId()))
.name(String.format("www.%s", selected.applyValue(getZoneResult -> getZoneResult.name())))
.type("A")
.ttl("300")
.records("10.0.0.1")
.build());
}
}

Return

A collection of values returned by getZone.

Parameters

argument

A collection of arguments for invoking getZone.


suspend fun getZone(name: String? = null, privateZone: Boolean? = null, resourceRecordSetCount: Int? = null, tags: Map<String, String>? = null, vpcId: String? = null, zoneId: String? = null): GetZoneResult

Return

A collection of values returned by getZone.

Parameters

name

Hosted Zone name of the desired Hosted Zone.

privateZone

Used with name field to get a private Hosted Zone.

resourceRecordSetCount

The number of Record Set in the Hosted Zone.

tags

Used with name field. A map of tags, each pair of which must exactly match a pair on the desired Hosted Zone.

vpcId

Used with name field to get a private Hosted Zone associated with the vpc_id (in this case, private_zone is not mandatory).

zoneId

Hosted Zone id of the desired Hosted Zone.

See also


suspend fun getZone(argument: suspend GetZonePlainArgsBuilder.() -> Unit): GetZoneResult

Return

A collection of values returned by getZone.

Parameters

argument

Builder for com.pulumi.aws.route53.kotlin.inputs.GetZonePlainArgs.

See also