# @fallobst22/cdk-cross-account-route53

> CDK Construct to allow creation of Route 53 records in a different account

Latest version **0.0.137** (published 2026-10-31) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @fallobst22/cdk-cross-account-route53
pnpm add @fallobst22/cdk-cross-account-route53
yarn add @fallobst22/cdk-cross-account-route53
bun add @fallobst22/cdk-cross-account-route53
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.137 |
| Published | 2026-10-31 |
| First published | 2023-12-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 351.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Sven Kirschbaum |
| Maintainers | fallobst22 |
| Keywords | aws, aws-cdk, awscdk, cdk, cross-account, records, role, route53 |

## Links

- npm: https://www.npmjs.com/package/@fallobst22/cdk-cross-account-route53
- Repository: https://github.com/SvenKirschbaum/cdk-cross-account-route53
- Homepage: https://github.com/SvenKirschbaum/cdk-cross-account-route53#readme
- Issues: https://github.com/SvenKirschbaum/cdk-cross-account-route53/issues
- npm.io page: https://npm.io/package/@fallobst22/cdk-cross-account-route53

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.137 (latest) — 2026-10-31
- 0.0.136 — 2026-10-24
- 0.0.135 — 2026-10-17
- 0.0.134 — 2026-10-10
- 0.0.133 — 2026-10-03
- 0.0.132 — 2026-09-26
- 0.0.131 — 2026-09-19
- 0.0.130 — 2026-09-12
- 0.0.129 — 2026-09-05
- 0.0.128 — 2026-08-29
- 0.0.127 — 2026-08-22
- 0.0.126 — 2026-08-15
- 0.0.125 — 2026-08-08
- 0.0.124 — 2026-08-01
- 0.0.123 — 2026-07-25
- … 122 more at https://npm.io/package/@fallobst22/cdk-cross-account-route53/versions

## README

# AWS CDK Cross Account Route53

AWS [CDK](https://aws.amazon.com/cdk/) Constructs that define:
- IAM role that can be used to allow discrete Route53 Record changes
- Cross Account Record construct to create Route53 cross account Route53 records

These constructs allow you to create Route53 records where the zone exists in a separate AWS account to the Cloudformation Stack.

## Getting started

```shell
yarn add @fallobst22/cdk-cross-account-route53
```

First create the role in the stack for the AWS account which contains the hosted zone.

```typescript
// DNS Stack
const zone = new route53.PublicHostedZone(this, 'HostedZone', {
  zoneName: 'example.com',
});

new CrossAccountRoute53Role(this, 'WebRoute53Role', {
  roleName: 'WebRoute53Role',
  assumedBy: new iam.AccountPrincipal('22222222'), // Web Stack Account
  zone,
  records: [{ domains: ['www.example.com'] }],
 });
```

Then in the child stack create the records

```typescript
const hostedZoneId = 'Z12345'; // ID of the zone in the other account

const distribution = new cloudfront.Distribution(this, 'Distribution', {
  domainNames: ['example.com'],
});

new CrossAccountRoute53RecordSet(this, 'ARecord', {
  delegationRoleName: 'WebRoute53Role',
  delegationRoleAccount: '111111111', // The account that contains the zone and role
  hostedZoneId,
  resourceRecordSets: [{
    Name: `example.com`,
    Type: 'A',
    AliasTarget: {
      DNSName: distribution.distributionDomainName,
      HostedZoneId: 'Z2FDTNDATAQYW2', // Cloudfront Hosted Zone Id
      EvaluateTargetHealth: false,
    },
  }],
});
```

## CrossAccountRoute53Role

### Initializer
```typescript
new CrossAccountRoute53Role(scope: Construct, id: string, props: CrossAccountRoute53RoleProps)
```

*Parameters*

* **scope** Construct
* **id** string
* **props** CrossAccountRoute53RoleProps

### Construct Props

| Name        | Type                                   | Description |
| ----        | ----                                   | ----------- |
| roleName    | `string`                               | The role name |
| assumedBy   | `iam.IPrincipal`                       | The principals that are allowed to assume the role |
| zone        | `route53.IHostedZone`                  | The hosted zone. |
| records     | `CrossAccountRoute53RolePropsRecord[]` | The records that can be created by this role |

### CrossAccountRoute53RolePropsRecords

| Name        | Type                               | Description |
| ----        | ----                               | ----------- |
| domainNames | `string \| string[]`               | The names of the records that can be created or changed |
| types       | `route53.RecordType[]`             | The typepsof records that can be created. Default `['A', 'AAAA']` |
| actions     | `'CREATE' \| 'UPSERT' \| 'DELETE'` | The allowed actions. Default `['CREATE', 'UPSERT', 'DELETE']` |

## CrossAccountRoute53RecordSet

### Initializer
```typescript
new CrossAccountRoute53RecordSet(scope: Construct, id: string, props: CrossAccountRoute53RecordSetProps)
```

*Parameters*

* **scope** Construct
* **id** string
* **props** CrossAccountRoute53RecordSet

### Construct Props

| Name        | Type                                   | Description |
| ----        | ----                                   | ----------- |
| delegationRoleName    | `string`                     | The role name created in the account with the hosted zone |
| delegationRoleAccount | `string`                     | The account identfier of the account with the hosted zone |
| hostedZoneId          | `string`                     | The hosted zoned id |
| resourceRecordSets    | `Route53.ResourceRecordSets` | The changes to be applied. These are in the same format as taken by [ChangeResourceRecordSets Action](https://docs.aws.amazon.com/Route53/latest/APIReference/API_ResourceRecordSet.html) |

## Development Status

These constructs will stay in `v0.x.x` for a while, to allow easier bug fixing & breaking changes _if absolutely needed_.
Once bugs are fixed (if any), the constructs will be published with `v1` major version and will be marked as stable.

Only typescript has been tested.

## Development

* `npm run build`   compile typescript to js
* `npm run watch`   watch for changes and compile
* `npm run test`    perform the jest unit tests

---
_Source: https://npm.io/package/@fallobst22/cdk-cross-account-route53 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
