Skip to content

Latest commit

 

History

History
451 lines (270 loc) · 13.7 KB

API.md

File metadata and controls

451 lines (270 loc) · 13.7 KB

API Reference

Constructs

Domain

Initializers

import { Domain } from '@alma-cdk/domain'

new Domain(scope: Construct, id: string, props: DomainProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props DomainProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
addTarget Assign an alias as record target with the fully-qualified domain name.
configureCloudFront Helper method to configure CloudFront distribution with the domain, certificate and IPv6 support.

toString
public toString(): string

Returns a string representation of this construct.

addTarget
public addTarget(alias: IAliasRecordTarget): void

Assign an alias as record target with the fully-qualified domain name.

This will create both A & AAAA DNS records, unless disableIpV6 was set to true during initialization of Domain construct (resulting in only A record being created).

Example

domain.addTarget(new targets.CloudFrontTarget(distribution))
aliasRequired
  • Type: aws-cdk-lib.aws_route53.IAliasRecordTarget

Route53 alias record target used to assign as A/AAAA record value.


configureCloudFront
public configureCloudFront(): ICloudFrontConfiguration

Helper method to configure CloudFront distribution with the domain, certificate and IPv6 support.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Domain } from '@alma-cdk/domain'

Domain.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
certificate aws-cdk-lib.aws_certificatemanager.ICertificate Certificate Manager certificate.
enableIpv6 boolean Has IPv6 AAAA records been created.
fqdn string Fully-qualified domain name.
zone aws-cdk-lib.aws_route53.IHostedZone Route53 hosted zone used to assign the domain into.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


certificateRequired
public readonly certificate: ICertificate;
  • Type: aws-cdk-lib.aws_certificatemanager.ICertificate

Certificate Manager certificate.


enableIpv6Required
public readonly enableIpv6: boolean;
  • Type: boolean

Has IPv6 AAAA records been created.

Can be used to conditionally configure IPv6 support to CloudFront distribution.


fqdnRequired
public readonly fqdn: string;
  • Type: string

Fully-qualified domain name.


zoneRequired
public readonly zone: IHostedZone;
  • Type: aws-cdk-lib.aws_route53.IHostedZone

Route53 hosted zone used to assign the domain into.


Structs

DomainProps

Properties to configure the domain (zone and certificate).

Initializer

import { DomainProps } from '@alma-cdk/domain'

const domainProps: DomainProps = { ... }

Properties

Name Type Description
zone string | aws-cdk-lib.aws_route53.IHostedZone Provide either a fully-qualified domain name as string to perform a hosted zone lookup or a previously defined hosted zone as route53.IHostedZone.
certificate aws-cdk-lib.aws_certificatemanager.ICertificate Provide your own pre-existing certificate.
enableIpv6 boolean Set to false to disable IPv6 AAAA record creation.
region string AWS Region to deploy the certificate into.
subdomain string Provide subdomain or leave undefined to use the zone apex domain.

zoneRequired
public readonly zone: string | IHostedZone;
  • Type: string | aws-cdk-lib.aws_route53.IHostedZone

Provide either a fully-qualified domain name as string to perform a hosted zone lookup or a previously defined hosted zone as route53.IHostedZone.


certificateOptional
public readonly certificate: ICertificate;
  • Type: aws-cdk-lib.aws_certificatemanager.ICertificate

Provide your own pre-existing certificate.

If not provided, a new certificate will be created by default.


enableIpv6Optional
public readonly enableIpv6: boolean;
  • Type: boolean
  • Default: true

Set to false to disable IPv6 AAAA record creation.


regionOptional
public readonly region: string;
  • Type: string
  • Default: "us-east-1"

AWS Region to deploy the certificate into.

Defaults to us-east-1 which is the only region where ACM certificates can be deployed to CloudFront.


subdomainOptional
public readonly subdomain: string;
  • Type: string

Provide subdomain or leave undefined to use the zone apex domain.

If subdomain provided, the resulting FQDN will be subdomain.zone.


Protocols

ICloudFrontConfiguration

Properties

Name Type Description
certificate aws-cdk-lib.aws_certificatemanager.ICertificate Certificate Manager certificate.
domainNames string[] Alternative domain names for this distribution.
enableIpv6 boolean Has IPv6 AAAA records been created.

certificateRequired
public readonly certificate: ICertificate;
  • Type: aws-cdk-lib.aws_certificatemanager.ICertificate

Certificate Manager certificate.


domainNamesRequired
public readonly domainNames: string[];
  • Type: string[]

Alternative domain names for this distribution.


enableIpv6Required
public readonly enableIpv6: boolean;
  • Type: boolean

Has IPv6 AAAA records been created.

Can be used to conditionally configure IPv6 support to CloudFront distribution.


IDomain

Interface contract implemented by Domain construct.

Methods

Name Description
addTarget Assign an alias as record target with the fully-qualified domain name.

addTarget
public addTarget(alias: IAliasRecordTarget): void

Assign an alias as record target with the fully-qualified domain name.

This will create both A & AAAA DNS records, unless disableIpV6 was set to true during initialization of Domain construct (resulting in only A record being created).

Example

domain.addTarget(new targets.CloudFrontTarget(distribution))
aliasRequired
  • Type: aws-cdk-lib.aws_route53.IAliasRecordTarget

Route53 alias record target used to assign as A/AAAA record value.


Properties

Name Type Description
certificate aws-cdk-lib.aws_certificatemanager.ICertificate Certificate Manager certificate.
enableIpv6 boolean Has IPv6 AAAA records been created.
fqdn string Fully-qualified domain name.
zone aws-cdk-lib.aws_route53.IHostedZone Route53 hosted zone used to assign the domain into.

certificateRequired
public readonly certificate: ICertificate;
  • Type: aws-cdk-lib.aws_certificatemanager.ICertificate

Certificate Manager certificate.


enableIpv6Required
public readonly enableIpv6: boolean;
  • Type: boolean

Has IPv6 AAAA records been created.

Can be used to conditionally configure IPv6 support to CloudFront distribution.


fqdnRequired
public readonly fqdn: string;
  • Type: string

Fully-qualified domain name.


zoneRequired
public readonly zone: IHostedZone;
  • Type: aws-cdk-lib.aws_route53.IHostedZone

Route53 hosted zone used to assign the domain into.