Class HostedZone
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).
Inherited Members
Namespace: Amazon.CDK.AWS.Route53
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HostedZone : Resource, IHostedZone, IResource
Syntax (vb)
Public Class HostedZone
Inherits Resource
Implements IHostedZone, IResource
Remarks
ExampleMetadata: infused
Examples
var kmsKey = new Key(this, "KmsCMK", new KeyProps {
KeySpec = KeySpec.ECC_NIST_P256,
KeyUsage = KeyUsage.SIGN_VERIFY
});
var hostedZone = new HostedZone(this, "HostedZone", new HostedZoneProps {
ZoneName = "example.com"
});
// Enable DNSSEC signing for the zone
hostedZone.EnableDnssec(new ZoneSigningOptions { KmsKey = kmsKey });
Synopsis
Constructors
Hosted |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Hosted |
Used by jsii to construct an instance of this class from DeputyProps |
Hosted |
Properties
Hosted |
ARN of this hosted zone, such as arn:${Partition}:route53:::hostedzone/${Id}. |
Hosted |
ID of this hosted zone, such as "Z23ABC4XYZL05B". |
Hosted |
Returns the set of name servers for the specific hosted zone. For example: ns1.example.com. |
Vpcs | VPCs to which this hosted zone will be added. |
Zone |
FQDN of this hosted zone. |
Methods
Add |
Add another VPC to this private hosted zone. |
Enable |
Enable DNSSEC for this hosted zone. |
From |
Imports a hosted zone from another stack. |
From |
Import a Route 53 hosted zone defined either outside the CDK, or in a different CDK stack. |
From |
Lookup a hosted zone in the current account/region based on query parameters. |
Grant |
Grant permissions to add delegation records to this zone. |
Constructors
HostedZone(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected HostedZone(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
HostedZone(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected HostedZone(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
HostedZone(Construct, String, IHostedZoneProps)
public HostedZone(Construct scope, string id, IHostedZoneProps props)
Parameters
- scope Constructs.
Construct - id System.
String - props IHosted
Zone Props
Properties
HostedZoneArn
ARN of this hosted zone, such as arn:${Partition}:route53:::hostedzone/${Id}.
public virtual string HostedZoneArn { get; }
Property Value
System.
HostedZoneId
ID of this hosted zone, such as "Z23ABC4XYZL05B".
public virtual string HostedZoneId { get; }
Property Value
System.
HostedZoneNameServers
Returns the set of name servers for the specific hosted zone. For example: ns1.example.com.
public virtual string[] HostedZoneNameServers { get; }
Property Value
System.
Remarks
This attribute will be undefined for private hosted zones or hosted zones imported from another stack.
Vpcs
VPCs to which this hosted zone will be added.
protected virtual CfnHostedZone.IVPCProperty[] Vpcs { get; }
Property Value
ZoneName
FQDN of this hosted zone.
public virtual string ZoneName { get; }
Property Value
System.
Methods
AddVpc(IVpc)
Add another VPC to this private hosted zone.
public virtual void AddVpc(IVpc vpc)
Parameters
- vpc IVpc
the other VPC to add.
EnableDnssec(IZoneSigningOptions)
Enable DNSSEC for this hosted zone.
public virtual IKeySigningKey EnableDnssec(IZoneSigningOptions options)
Parameters
- options IZone
Signing Options
Returns
Remarks
This will create a key signing key with the given options and enable DNSSEC signing for the hosted zone.
FromHostedZoneAttributes(Construct, String, IHostedZoneAttributes)
Imports a hosted zone from another stack.
public static IHostedZone FromHostedZoneAttributes(Construct scope, string id, IHostedZoneAttributes attrs)
Parameters
- scope Constructs.
Construct the parent Construct for this Construct.
- id System.
String the logical name of this Construct.
- attrs IHosted
Zone Attributes the HostedZoneAttributes (hosted zone ID and hosted zone name).
Returns
Remarks
Use when both hosted zone ID and hosted zone name are known.
FromHostedZoneId(Construct, String, String)
Import a Route 53 hosted zone defined either outside the CDK, or in a different CDK stack.
public static IHostedZone FromHostedZoneId(Construct scope, string id, string hostedZoneId)
Parameters
- scope Constructs.
Construct the parent Construct for this Construct.
- id System.
String the logical name of this Construct.
- hostedZoneId System.
String the ID of the hosted zone to import.
Returns
Remarks
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()
or fromLookup()
FromLookup(Construct, String, IHostedZoneProviderProps)
Lookup a hosted zone in the current account/region based on query parameters.
public static IHostedZone FromLookup(Construct scope, string id, IHostedZoneProviderProps query)
Parameters
- scope Constructs.
Construct - id System.
String - query IHosted
Zone Provider Props
Returns
Remarks
Requires environment, you must specify env for the stack.
Use to easily query hosted zones.
See: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
GrantDelegation(IGrantable)
Grant permissions to add delegation records to this zone.
public virtual Grant GrantDelegation(IGrantable grantee)
Parameters
- grantee IGrantable
Returns