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.103.1 (build bef2dea)",
date="2024-10-25T14:21:22.700Z")
@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:
Key kmsKey = Key.Builder.create(this, "KmsCMK") .keySpec(KeySpec.ECC_NIST_P256) .keyUsage(KeyUsage.SIGN_VERIFY) .build(); HostedZone hostedZone = HostedZone.Builder.create(this, "HostedZone") .zoneName("example.com") .build(); // Enable DNSSEC signing for the zone hostedZone.enableDnssec(ZoneSigningOptions.builder().kmsKey(kmsKey).build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.route53.IHostedZone
IHostedZone.Jsii$Default, IHostedZone.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
HostedZone
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
HostedZone
(software.amazon.jsii.JsiiObjectRef objRef) HostedZone
(software.constructs.Construct scope, String id, HostedZoneProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add another VPC to this private hosted zone.enableDnssec
(ZoneSigningOptions options) Enable DNSSEC for this hosted zone.static IHostedZone
fromHostedZoneAttributes
(software.constructs.Construct scope, String id, HostedZoneAttributes attrs) Imports a hosted zone from another stack.static IHostedZone
fromHostedZoneId
(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 IHostedZone
fromLookup
(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, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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:
grantDelegation
in interfaceIHostedZone
- Parameters:
grantee
- This parameter is required.
-
getHostedZoneArn
ARN of this hosted zone, such as arn:${Partition}:route53:::hostedzone/${Id}.- Specified by:
getHostedZoneArn
in interfaceIHostedZone
-
getHostedZoneId
ID of this hosted zone, such as "Z23ABC4XYZL05B".- Specified by:
getHostedZoneId
in interfaceIHostedZone
-
getVpcs
VPCs to which this hosted zone will be added. -
getZoneName
FQDN of this hosted zone.- Specified by:
getZoneName
in 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:
getHostedZoneNameServers
in interfaceIHostedZone
-