aws-cdk-lib.aws_route53.CaaRecord

class CaaRecord (construct)

LanguageType name
.NETAmazon.CDK.AWS.Route53.CaaRecord
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsroute53#CaaRecord
Javasoftware.amazon.awscdk.services.route53.CaaRecord
Pythonaws_cdk.aws_route53.CaaRecord
TypeScript (source)aws-cdk-lib » aws_route53 » CaaRecord

Implements IConstruct, IDependable, IResource, IRecordSet

A DNS CAA record.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_route53 as route53 } from 'aws-cdk-lib';

declare const hostedZone: route53.HostedZone;
const caaRecord = new route53.CaaRecord(this, 'MyCaaRecord', {
  values: [{
    flag: 123,
    tag: route53.CaaTag.ISSUE,
    value: 'value',
  }],
  zone: hostedZone,

  // the properties below are optional
  comment: 'comment',
  deleteExisting: false,
  recordName: 'recordName',
  ttl: cdk.Duration.minutes(30),
});

Initializer

new CaaRecord(scope: Construct, id: string, props: CaaRecordProps)

Parameters

  • scope Construct
  • id string
  • props CaaRecordProps

Construct Props

NameTypeDescription
valuesCaaRecordValue[]The values.
zoneIHostedZoneThe hosted zone in which to define the new record.
comment?stringA comment to add on the record.
deleteExisting?booleanWhether to delete the same record set in the hosted zone if it already exists (dangerous!).
recordName?stringThe subdomain name for this record. This should be relative to the zone root name.
ttl?DurationThe resource record cache time to live (TTL).

values

Type: CaaRecordValue[]

The values.


zone

Type: IHostedZone

The hosted zone in which to define the new record.


comment?

Type: string (optional, default: no comment)

A comment to add on the record.


deleteExisting?

Type: boolean (optional, default: false)

Whether to delete the same record set in the hosted zone if it already exists (dangerous!).

This allows to deploy a new record set while minimizing the downtime because the new record set will be created immediately after the existing one is deleted. It also avoids "manual" actions to delete existing record sets.

N.B.: this feature is dangerous, use with caution! It can only be used safely when deleteExisting is set to true as soon as the resource is added to the stack. Changing an existing Record Set's deleteExisting property from false -> true after deployment will delete the record!


recordName?

Type: string (optional, default: zone root)

The subdomain name for this record. This should be relative to the zone root name.

For example, if you want to create a record for acme.example.com, specify "acme".

You can also specify the fully qualified domain name which terminates with a ".". For example, "acme.example.com.".


ttl?

Type: Duration (optional, default: Duration.minutes(30))

The resource record cache time to live (TTL).

Properties

NameTypeDescription
domainNamestringThe domain name of the record.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.

domainName

Type: string

The domain name of the record.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.