CrossAccountZoneDelegationRecordProps

class aws_cdk.aws_route53.CrossAccountZoneDelegationRecordProps(*, delegated_zone, delegation_role, parent_hosted_zone_id=None, parent_hosted_zone_name=None, removal_policy=None, ttl=None)

Bases: object

Construction properties for a CrossAccountZoneDelegationRecord.

Parameters
  • delegated_zone (IHostedZone) – The zone to be delegated.

  • delegation_role (IRole) – The delegation role in the parent account.

  • parent_hosted_zone_id (Optional[str]) – The hosted zone id in the parent account. Default: - no zone id

  • parent_hosted_zone_name (Optional[str]) – The hosted zone name in the parent account. Default: - no zone name

  • removal_policy (Optional[RemovalPolicy]) – The removal policy to apply to the record set. Default: RemovalPolicy.DESTROY

  • ttl (Optional[Duration]) – The resource record cache time to live (TTL). Default: Duration.days(2)

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
)

Attributes

delegated_zone

The zone to be delegated.

Return type

IHostedZone

delegation_role

The delegation role in the parent account.

Return type

IRole

parent_hosted_zone_id

The hosted zone id in the parent account.

Default
  • no zone id

Return type

Optional[str]

parent_hosted_zone_name

The hosted zone name in the parent account.

Default
  • no zone name

Return type

Optional[str]

removal_policy

The removal policy to apply to the record set.

Default

RemovalPolicy.DESTROY

Return type

Optional[RemovalPolicy]

ttl

The resource record cache time to live (TTL).

Default

Duration.days(2)

Return type

Optional[Duration]