Skip to main content


Alma CDK Domain

npm i -D @alma-cdk/domain

Simplifies creation of subdomain with a TLS certificate and configuration with services like AWS CloudFront.



🚧   Project Stability

experimental

This construct is still versioned with v0 major version and breaking changes might be introduced if necessary (without a major version bump), though we aim to keep the API as stable as possible (even within v0 development). We aim to publish v1.0.0 soon and after that breaking changes will be introduced via major version bumps.


Getting Started

import { Domain } from '@alma-cdk/domain';
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
const domain = new Domain(this, 'Domain', {
  zone: 'example.com', // retrieve the zone via lookup, or provide IHostedZone
  subdomain: 'foobar', // optional subdomain
});

const distribution = new cloudfront.Distribution(this, 'Distribution', {
  /* other cloudfront configuration values removed for brevity */

  certificate: domain.certificate, // reference to created ICertificate
  domainNames: [domain.fqdn], // foobar.example.com
  enableIpv6: domain.enableIpv6, // true by default – set enableIpv6 prop to false during new Domain()
})

// assign CloudFront distribution to given fqdn with A + AAAA records
domain.addTarget(new targets.CloudFrontTarget(distribution))

CloudFront helper

Instead of assigning certificate, domainNames and enableIpv6 properties individually, you may choose to use the one-liner helper utility method configureCloudFront() to set all three values at once – don't forget to use ... object spread syntax:

const distribution = new cloudfront.Distribution(this, 'Distribution', {
  /* other cloudfront configuration values removed for brevity */

  // one-liner to configure certificate, domainNames and IPv6 support
  ...domain.configureCloudFront(),
})

// assign CloudFront distribution to given fqdn with A + AAAA records
domain.addTarget(new targets.CloudFrontTarget(distribution))

Note: The returned domain names configuration is domainNames: [domain.fqdn], meaning this only works in scenarios where your CloudFront distribution has only single domain name.

Release files for alma-cdk.domain 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alma-cdk.domain 0.0.14
File Size Uploaded
alma-cdk.domain-0.0.14.tar.gz 70.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alma-cdk.domain 0.0.14
File Interpreter ABI Platform
alma_cdk.domain-0.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 139.6 kB

Release files / alma-cdk.domain-0.0.14.tar.gz

Download URL alma-cdk.domain-0.0.14.tar.gz
Size 70.7 kB
Tags Source
SHA-256 checksum
How to use checksums
33b1df41537961abf2e95461ff5aa426767de1ebe88c40644af36310747c9841
BLAKE2b-256 checksum
How to use checksums
cfd8702ce56fcac1516d704a45a3e9208e2f54491eb02b41066970d08a51b1c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / alma_cdk.domain-0.0.14-py3-none-any.whl

Download URL alma_cdk.domain-0.0.14-py3-none-any.whl
Size 68.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3aad429af683668633618adfce0202be8091399d959f9e6a978a43d5faacf35
BLAKE2b-256 checksum
How to use checksums
6c7e4fcc2d8198a6cc8ff3d0fcab5d66b4e634d650cd2d8e5c089f996ce9775c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page