Class PublicHostedZone
Create a Route53 public hosted zone.
Inherited Members
Namespace: Amazon.CDK.AWS.Route53
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PublicHostedZone : HostedZone, IPublicHostedZone, IHostedZone, IResource
Syntax (vb)
Public Class PublicHostedZone
Inherits HostedZone
Implements IPublicHostedZone, IHostedZone, IResource
Remarks
Resource: AWS::Route53::HostedZone
ExampleMetadata: infused
Examples
var stack1 = new Stack(app, "Stack1", new StackProps {
Env = new Environment {
Region = "us-east-1"
},
CrossRegionReferences = true
});
var cert = new Certificate(stack1, "Cert", new CertificateProps {
DomainName = "*.example.com",
Validation = CertificateValidation.FromDns(PublicHostedZone.FromHostedZoneId(stack1, "Zone", "Z0329774B51CGXTDQV3X"))
});
var stack2 = new Stack(app, "Stack2", new StackProps {
Env = new Environment {
Region = "us-east-2"
},
CrossRegionReferences = true
});
new Distribution(stack2, "Distribution", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new HttpOrigin("example.com")
},
DomainNames = new [] { "dev.example.com" },
Certificate = cert
});
Synopsis
Constructors
PublicHostedZone(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
PublicHostedZone(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
PublicHostedZone(Construct, String, IPublicHostedZoneProps) |
Properties
CrossAccountZoneDelegationRole | Role for cross account zone delegation. |
Methods
AddDelegation(IPublicHostedZone, IZoneDelegationOptions) | Adds a delegation from this zone to a designated zone. |
AddVpc(IVpc) | Add another VPC to this private hosted zone. |
FromPublicHostedZoneAttributes(Construct, String, IPublicHostedZoneAttributes) | Imports a public hosted zone from another stack. |
FromPublicHostedZoneId(Construct, String, String) | Import a Route 53 public hosted zone defined either outside the CDK, or in a different CDK stack. |
Constructors
PublicHostedZone(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected PublicHostedZone(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
PublicHostedZone(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected PublicHostedZone(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
PublicHostedZone(Construct, String, IPublicHostedZoneProps)
public PublicHostedZone(Construct scope, string id, IPublicHostedZoneProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IPublicHostedZoneProps
Properties
CrossAccountZoneDelegationRole
Role for cross account zone delegation.
public virtual Role CrossAccountZoneDelegationRole { get; }
Property Value
Methods
AddDelegation(IPublicHostedZone, IZoneDelegationOptions)
Adds a delegation from this zone to a designated zone.
public virtual void AddDelegation(IPublicHostedZone delegate, IZoneDelegationOptions opts = null)
Parameters
- delegate IPublicHostedZone
the zone being delegated to.
- opts IZoneDelegationOptions
options for creating the DNS record, if any.
AddVpc(IVpc)
Add another VPC to this private hosted zone.
public override void AddVpc(IVpc vpc)
Parameters
- vpc IVpc
Overrides
FromPublicHostedZoneAttributes(Construct, String, IPublicHostedZoneAttributes)
Imports a public hosted zone from another stack.
public static IPublicHostedZone FromPublicHostedZoneAttributes(Construct scope, string id, IPublicHostedZoneAttributes attrs)
Parameters
- scope Constructs.Construct
the parent Construct for this Construct.
- id System.String
the logical name of this Construct.
- attrs IPublicHostedZoneAttributes
the PublicHostedZoneAttributes (hosted zone ID and hosted zone name).
Returns
Remarks
Use when both hosted zone ID and hosted zone name are known.
FromPublicHostedZoneId(Construct, String, String)
Import a Route 53 public hosted zone defined either outside the CDK, or in a different CDK stack.
public static IPublicHostedZone FromPublicHostedZoneId(Construct scope, string id, string publicHostedZoneId)
Parameters
- scope Constructs.Construct
the parent Construct for this Construct.
- id System.String
the logical name of this Construct.
- publicHostedZoneId System.String
the ID of the public hosted zone to import.
Returns
Remarks
Use when hosted zone ID is known. If a PublicHostedZone is imported with this method the zoneName cannot be referenced.
If the zoneName is needed then the PublicHostedZone should be imported with fromPublicHostedZoneAttributes()
.