TxtRecordProps

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

Bases: aws_cdk.aws_route53.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

Return type

Optional[str]

record_name

The domain name for this record.

Default

zone root

Return type

Optional[str]

ttl

The resource record cache time to live (TTL).

Default

Duration.minutes(30)

Return type

Optional[Duration]

values

The text values.

Return type

List[str]

zone

The hosted zone in which to define the new record.

Return type

IHostedZone