CrossAccountZoneDelegationRecord
- class aws_cdk.aws_route53.CrossAccountZoneDelegationRecord(scope, id, *, delegated_zone, delegation_role, assume_role_region=None, parent_hosted_zone_id=None, parent_hosted_zone_name=None, removal_policy=None, ttl=None)
Bases:
ConstructA Cross Account Zone Delegation record.
This construct uses custom resource lambda that calls Route53 ChangeResourceRecordSets API to upsert a NS record into the
parentHostedZone.WARNING: The default removal policy of this resource is DESTROY, therefore, if this resource’s logical ID changes or if this resource is removed from the stack, the existing NS record will be removed.
- ExampleMetadata:
infused
Example:
sub_zone = route53.PublicHostedZone(self, "SubZone", zone_name="sub.someexample.com" ) # import the delegation role by constructing the roleArn delegation_role_arn = Stack.of(self).format_arn( region="", # IAM is global in each partition service="iam", account="parent-account-id", resource="role", resource_name="MyDelegationRole" ) delegation_role = iam.Role.from_role_arn(self, "DelegationRole", delegation_role_arn) # create the record route53.CrossAccountZoneDelegationRecord(self, "delegate", delegated_zone=sub_zone, parent_hosted_zone_name="someexample.com", # or you can use parentHostedZoneId delegation_role=delegation_role )
- Parameters:
scope (
Construct)id (
str)delegated_zone (
IHostedZone) – The zone to be delegated.delegation_role (
IRoleRef) – The delegation role in the parent account.assume_role_region (
Optional[str]) – Region from which to obtain temporary credentials. Default: - the Route53 signing region in the current partitionparent_hosted_zone_id (
Optional[str]) – The hosted zone id in the parent account. Default: - no zone idparent_hosted_zone_name (
Optional[str]) – The hosted zone name in the parent account. Default: - no zone nameremoval_policy (
Optional[RemovalPolicy]) – The removal policy to apply to the record set. Default: RemovalPolicy.DESTROYttl (
Optional[Duration]) – The resource record cache time to live (TTL). Default: Duration.days(2)
Methods
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- node
The tree node.
Static Methods
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.