Skip to content

[Route53]: CrossAccountZoneDelegationRecord should support RemovalPolicy #15211

@epheat

Description

@epheat

CrossAccountZoneDelegationRecord currently does not support the application of a RemovalPolicy. When the resource is deleted, it will assume the DelegationRole and issue a ChangeResourceRecordSets call with action DELETE. In our case, we would rather leave the delegation intact (at least in production-like environments) so we don't risk tearing down our endpoints accidentally.

Use Case

We would like to apply a removal policy of RETAIN on the CrossAccountZoneDelegationRecord resource, in order to protect against accidental deletion of the resource.

Proposed Solution

let hostedZone = new HostedZone(this, 'HostedZone', {
  zoneName: 'my.cool.zone'
});

let delegation = new CrossAccountZoneDelegationRecord(this, 'CrossAccountDelegation', {
  delegatedZone: hostedZone,
  parentHostedZoneName: 'cool.zone',
  delegationRole: Role.fromRoleArn(this, 'DelegationRole', 'arn:aws:iam::000000000000:role/delegator')
});

// vvv NEW vvv
delegation.applyRemovalPolicy(RemovalPolicy.RETAIN);

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-route53Related to Amazon Route 53effort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions