Class HostedZone
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.route53.HostedZone
- All Implemented Interfaces:
IResource,IHostedZone,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
- Direct Known Subclasses:
PrivateHostedZone,PublicHostedZone
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:47.449Z")
@Stability(Stable)
public class HostedZone
extends Resource
implements IHostedZone
Container for records, and records contain information about how to route traffic for a specific domain, such as example.com and its subdomains (acme.example.com, zenith.example.com).
Example:
HostedZone exampleCom = HostedZone.Builder.create(this, "ExampleCom")
.zoneName("example.com")
.build();
HostedZone exampleNet = HostedZone.Builder.create(this, "ExampleNet")
.zoneName("example.net")
.build();
Certificate cert = Certificate.Builder.create(this, "Certificate")
.domainName("test.example.com")
.subjectAlternativeNames(List.of("cool.example.com", "test.example.net"))
.validation(CertificateValidation.fromDnsMultiZone(Map.of(
"test.example.com", exampleCom,
"cool.example.com", exampleCom,
"test.example.net", exampleNet)))
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.route53.IHostedZone
IHostedZone.Jsii$Default, IHostedZone.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHostedZone(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedHostedZone(software.amazon.jsii.JsiiObjectRef objRef) HostedZone(software.constructs.Construct scope, String id, HostedZoneProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd another VPC to this private hosted zone.enableDnssec(ZoneSigningOptions options) Enable DNSSEC for this hosted zone.static IHostedZonefromHostedZoneAttributes(software.constructs.Construct scope, String id, HostedZoneAttributes attrs) Imports a hosted zone from another stack.static IHostedZonefromHostedZoneId(software.constructs.Construct scope, String id, String hostedZoneId) Import a Route 53 hosted zone defined either outside the CDK, or in a different CDK stack.static IHostedZonefromLookup(software.constructs.Construct scope, String id, HostedZoneProviderProps query) Lookup a hosted zone in the current account/region based on query parameters.ARN of this hosted zone, such as arn:${Partition}:route53:::hostedzone/${Id}.ID of this hosted zone, such as "Z23ABC4XYZL05B".Returns the set of name servers for the specific hosted zone.protected List<CfnHostedZone.VPCProperty> getVpcs()VPCs to which this hosted zone will be added.FQDN of this hosted zone.grantDelegation(IGrantable grantee) Grant permissions to add delegation records to this zone.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
HostedZone
protected HostedZone(software.amazon.jsii.JsiiObjectRef objRef) -
HostedZone
protected HostedZone(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
HostedZone
@Stability(Stable) public HostedZone(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HostedZoneProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromHostedZoneAttributes
@Stability(Stable) @NotNull public static IHostedZone fromHostedZoneAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HostedZoneAttributes attrs) Imports a hosted zone from another stack.Use when both hosted zone ID and hosted zone name are known.
- Parameters:
scope- the parent Construct for this Construct. This parameter is required.id- the logical name of this Construct. This parameter is required.attrs- the HostedZoneAttributes (hosted zone ID and hosted zone name). This parameter is required.
-
fromHostedZoneId
@Stability(Stable) @NotNull public static IHostedZone fromHostedZoneId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String hostedZoneId) Import a Route 53 hosted zone defined either outside the CDK, or in a different CDK stack.Use when hosted zone ID is known. If a HostedZone is imported with this method the zoneName cannot be referenced. If the zoneName is needed then the HostedZone should be imported with
fromHostedZoneAttributes()orfromLookup()- Parameters:
scope- the parent Construct for this Construct. This parameter is required.id- the logical name of this Construct. This parameter is required.hostedZoneId- the ID of the hosted zone to import. This parameter is required.
-
fromLookup
@Stability(Stable) @NotNull public static IHostedZone fromLookup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HostedZoneProviderProps query) Lookup a hosted zone in the current account/region based on query parameters.Requires environment, you must specify env for the stack.
Use to easily query hosted zones.
- Parameters:
scope- This parameter is required.id- This parameter is required.query- This parameter is required.- See Also:
-
addVpc
Add another VPC to this private hosted zone.- Parameters:
vpc- the other VPC to add. This parameter is required.
-
enableDnssec
Enable DNSSEC for this hosted zone.This will create a key signing key with the given options and enable DNSSEC signing for the hosted zone.
- Parameters:
options- This parameter is required.
-
grantDelegation
Grant permissions to add delegation records to this zone.- Specified by:
grantDelegationin interfaceIHostedZone- Parameters:
grantee- This parameter is required.
-
getHostedZoneArn
ARN of this hosted zone, such as arn:${Partition}:route53:::hostedzone/${Id}.- Specified by:
getHostedZoneArnin interfaceIHostedZone
-
getHostedZoneId
ID of this hosted zone, such as "Z23ABC4XYZL05B".- Specified by:
getHostedZoneIdin interfaceIHostedZone
-
getVpcs
VPCs to which this hosted zone will be added. -
getZoneName
FQDN of this hosted zone.- Specified by:
getZoneNamein interfaceIHostedZone
-
getHostedZoneNameServers
Returns the set of name servers for the specific hosted zone. For example: ns1.example.com.This attribute will be undefined for private hosted zones or hosted zones imported from another stack.
- Specified by:
getHostedZoneNameServersin interfaceIHostedZone
-