RecordTarget

class aws_cdk.aws_route53.RecordTarget(values=None, alias_target=None)

Bases: object

Type union for a record that accepts multiple types of target.

ExampleMetadata

infused

Example:

import aws_cdk.aws_cloudfront as cloudfront

# my_zone: route53.HostedZone
# distribution: cloudfront.CloudFrontWebDistribution

route53.AaaaRecord(self, "Alias",
    zone=my_zone,
    target=route53.RecordTarget.from_alias(targets.CloudFrontTarget(distribution))
)
Parameters
  • values (Optional[Sequence[str]]) – correspond with the chosen record type (e.g. for ‘A’ Type, specify one or more IP addresses).

  • alias_target (Optional[IAliasRecordTarget]) – alias for targets such as CloudFront distribution to route traffic to.

Attributes

alias_target

alias for targets such as CloudFront distribution to route traffic to.

values

correspond with the chosen record type (e.g. for ‘A’ Type, specify one or more IP addresses).

Static Methods

classmethod from_alias(alias_target)

Use an alias as target.

Parameters

alias_target (IAliasRecordTarget) –

Return type

RecordTarget

classmethod from_ip_addresses(*ip_addresses)

Use ip addresses as target.

Parameters

ip_addresses (str) –

Return type

RecordTarget

classmethod from_values(*values)

Use string values as target.

Parameters

values (str) –

Return type

RecordTarget