TxtRecordProps

class aws_cdk.aws_route53.TxtRecordProps(*, zone, comment=None, record_name=None, ttl=None, values)

Bases: RecordSetOptions

Construction properties for a TxtRecord.

Parameters:
  • zone (IHostedZone) – The hosted zone in which to define the new record.

  • comment (Optional[str]) – A comment to add on the record. Default: no comment

  • record_name (Optional[str]) – The domain name for this record. Default: zone root

  • ttl (Optional[Duration]) – The resource record cache time to live (TTL). Default: Duration.minutes(30)

  • values (Sequence[str]) – The text values.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_route53 as route53

# zone: route53.HostedZone


verify_domain_identity = cr.AwsCustomResource(self, "VerifyDomainIdentity",
    on_create=cr.AwsSdkCall(
        service="SES",
        action="verifyDomainIdentity",
        parameters={
            "Domain": "example.com"
        },
        physical_resource_id=cr.PhysicalResourceId.from_response("VerificationToken")
    ),
    policy=cr.AwsCustomResourcePolicy.from_sdk_calls(
        resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
    )
)
route53.TxtRecord(self, "SESVerificationRecord",
    zone=zone,
    record_name="_amazonses.example.com",
    values=[verify_domain_identity.get_response_field("VerificationToken")]
)

Attributes

comment

A comment to add on the record.

Default:

no comment

record_name

The domain name for this record.

Default:

zone root

ttl

The resource record cache time to live (TTL).

Default:

Duration.minutes(30)

values

The text values.

zone

The hosted zone in which to define the new record.