Class: AWSCDK::Route53::RecordSetProps

Inherits:
RecordSetOptions
  • Object
show all
Defined in:
route53/record_set_props.rb

Overview

Construction properties for a RecordSet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zone:, cidr_routing_config: nil, comment: nil, delete_existing: nil, failover: nil, geo_location: nil, health_check: nil, multi_value_answer: nil, record_name: nil, region: nil, set_identifier: nil, ttl: nil, weight: nil, record_type:, target:) ⇒ RecordSetProps

Returns a new instance of RecordSetProps.

Parameters:

  • zone (AWSCDK::Route53::IHostedZone)

    The hosted zone in which to define the new record.

  • cidr_routing_config (AWSCDK::Route53::CIDRRoutingConfig, nil) (defaults to: nil)

    The object that is specified in resource record set object when you are linking a resource record set to a CIDR location.

  • comment (String, nil) (defaults to: nil)

    A comment to add on the record.

  • delete_existing (Boolean, nil) (defaults to: nil)

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

  • failover (AWSCDK::Route53::Failover, nil) (defaults to: nil)

    Failover configuration for the record set.

  • geo_location (AWSCDK::Route53::GeoLocation, nil) (defaults to: nil)

    The geographical origin for this record to return DNS records based on the user's location.

  • health_check (AWSCDK::Route53::IHealthCheck, nil) (defaults to: nil)

    The health check to associate with the record set.

  • multi_value_answer (Boolean, nil) (defaults to: nil)

    Whether to return multiple values, such as IP addresses for your web servers, in response to DNS queries.

  • record_name (String, nil) (defaults to: nil)

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

  • region (String, nil) (defaults to: nil)

    The Amazon EC2 Region where you created the resource that this resource record set refers to.

  • set_identifier (String, nil) (defaults to: nil)

    A string used to distinguish between different records with the same combination of DNS name and type.

  • ttl (AWSCDK::Duration, nil) (defaults to: nil)

    The resource record cache time to live (TTL).

  • weight (Numeric, nil) (defaults to: nil)

    Among resource record sets that have the same combination of DNS name and type, a value that determines the proportion of DNS queries that Amazon Route 53 responds to using the current resource record set.

  • record_type (AWSCDK::Route53::RecordType)

    The record type.

  • target (AWSCDK::Route53::RecordTarget)

    The target for this record, either RecordTarget.fromValues() or RecordTarget.fromAlias().



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'route53/record_set_props.rb', line 22

def initialize(zone:, cidr_routing_config: nil, comment: nil, delete_existing: nil, failover: nil, geo_location: nil, health_check: nil, multi_value_answer: nil, record_name: nil, region: nil, set_identifier: nil, ttl: nil, weight: nil, record_type:, target:)
  @zone = zone
  Jsii::Type.check_type(@zone, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5JSG9zdGVkWm9uZSJ9")), "zone")
  @cidr_routing_config = cidr_routing_config
  Jsii::Type.check_type(@cidr_routing_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5DaWRyUm91dGluZ0NvbmZpZyJ9")), "cidrRoutingConfig") unless @cidr_routing_config.nil?
  @comment = comment
  Jsii::Type.check_type(@comment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comment") unless @comment.nil?
  @delete_existing = delete_existing
  Jsii::Type.check_type(@delete_existing, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deleteExisting") unless @delete_existing.nil?
  @failover = failover
  Jsii::Type.check_type(@failover, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5GYWlsb3ZlciJ9")), "failover") unless @failover.nil?
  @geo_location = geo_location
  Jsii::Type.check_type(@geo_location, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5HZW9Mb2NhdGlvbiJ9")), "geoLocation") unless @geo_location.nil?
  @health_check = health_check
  Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5JSGVhbHRoQ2hlY2sifQ==")), "healthCheck") unless @health_check.nil?
  @multi_value_answer = multi_value_answer
  Jsii::Type.check_type(@multi_value_answer, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "multiValueAnswer") unless @multi_value_answer.nil?
  @record_name = record_name
  Jsii::Type.check_type(@record_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "recordName") unless @record_name.nil?
  @region = region
  Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil?
  @set_identifier = set_identifier
  Jsii::Type.check_type(@set_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "setIdentifier") unless @set_identifier.nil?
  @ttl = ttl
  Jsii::Type.check_type(@ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "ttl") unless @ttl.nil?
  @weight = weight
  Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") unless @weight.nil?
  @record_type = record_type
  Jsii::Type.check_type(@record_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5SZWNvcmRUeXBlIn0=")), "recordType")
  @target = target
  Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5SZWNvcmRUYXJnZXQifQ==")), "target")
end

Instance Attribute Details

#cidr_routing_configAWSCDK::Route53::CIDRRoutingConfig? (readonly)

Note:

Default: - No CIDR routing configured

The object that is specified in resource record set object when you are linking a resource record set to a CIDR location.

A LocationName with an asterisk “*” can be used to create a default CIDR record. CollectionId is still required for default record.



66
67
68
# File 'route53/record_set_props.rb', line 66

def cidr_routing_config
  @cidr_routing_config
end

#commentString? (readonly)

Note:

Default: no comment

A comment to add on the record.

Returns:

  • (String, nil)


71
72
73
# File 'route53/record_set_props.rb', line 71

def comment
  @comment
end

#delete_existingBoolean? (readonly)

Deprecated.

This property is dangerous and can lead to unintended record deletion in case of deployment failure.

Note:

Default: false

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

This allows you 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 delete_existing is set to true as soon as the resource is added to the stack. Changing an existing Record Set's delete_existing property from false -> true after deployment will delete the record!

Returns:

  • (Boolean, nil)


86
87
88
# File 'route53/record_set_props.rb', line 86

def delete_existing
  @delete_existing
end

#failoverAWSCDK::Route53::Failover? (readonly)

Note:

Default: - No failover configuration

Failover configuration for the record set.

To configure failover, you add the Failover element to two resource record sets. For one resource record set, you specify PRIMARY as the value for Failover; for the other resource record set, you specify SECONDARY.

You must also include the HealthCheckId element for PRIMARY configurations.



98
99
100
# File 'route53/record_set_props.rb', line 98

def failover
  @failover
end

#geo_locationAWSCDK::Route53::GeoLocation? (readonly)

The geographical origin for this record to return DNS records based on the user's location.



102
103
104
# File 'route53/record_set_props.rb', line 102

def geo_location
  @geo_location
end

#health_checkAWSCDK::Route53::IHealthCheck? (readonly)

Note:

Default: - No health check configured

The health check to associate with the record set.

Route53 will return this record set in response to DNS queries only if the health check is passing.



109
110
111
# File 'route53/record_set_props.rb', line 109

def health_check
  @health_check
end

#multi_value_answerBoolean? (readonly)

Note:

Default: false

Whether to return multiple values, such as IP addresses for your web servers, in response to DNS queries.

Returns:

  • (Boolean, nil)


114
115
116
# File 'route53/record_set_props.rb', line 114

def multi_value_answer
  @multi_value_answer
end

#record_nameString? (readonly)

Note:

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.".

Returns:

  • (String, nil)


125
126
127
# File 'route53/record_set_props.rb', line 125

def record_name
  @record_name
end

#record_typeAWSCDK::Route53::RecordType (readonly)

The record type.



167
168
169
# File 'route53/record_set_props.rb', line 167

def record_type
  @record_type
end

#regionString? (readonly)

Note:

Default: - Do not set latency based routing

The Amazon EC2 Region where you created the resource that this resource record set refers to.

The resource typically is an AWS resource, such as an EC2 instance or an ELB load balancer, and is referred to by an IP address or a DNS domain name, depending on the record type.

When Amazon Route 53 receives a DNS query for a domain name and type for which you have created latency resource record sets, Route 53 selects the latency resource record set that has the lowest latency between the end user and the associated Amazon EC2 Region. Route 53 then returns the value that is associated with the selected resource record set.



138
139
140
# File 'route53/record_set_props.rb', line 138

def region
  @region
end

#set_identifierString? (readonly)

Note:

Default: - Auto generated string

A string used to distinguish between different records with the same combination of DNS name and type.

It can only be set when either weight or geoLocation is defined.

This parameter must be between 1 and 128 characters in length.

Returns:

  • (String, nil)


147
148
149
# File 'route53/record_set_props.rb', line 147

def set_identifier
  @set_identifier
end

#targetAWSCDK::Route53::RecordTarget (readonly)

The target for this record, either RecordTarget.fromValues() or RecordTarget.fromAlias().



171
172
173
# File 'route53/record_set_props.rb', line 171

def target
  @target
end

#ttlAWSCDK::Duration? (readonly)

Note:

Default: Duration.minutes(30)

The resource record cache time to live (TTL).

Returns:



152
153
154
# File 'route53/record_set_props.rb', line 152

def ttl
  @ttl
end

#weightNumeric? (readonly)

Note:

Default: - Do not set weighted routing

Among resource record sets that have the same combination of DNS name and type, a value that determines the proportion of DNS queries that Amazon Route 53 responds to using the current resource record set.

Route 53 calculates the sum of the weights for the resource record sets that have the same combination of DNS name and type. Route 53 then responds to queries based on the ratio of a resource's weight to the total.

This value can be a number between 0 and 255.



163
164
165
# File 'route53/record_set_props.rb', line 163

def weight
  @weight
end

#zoneAWSCDK::Route53::IHostedZone (readonly)

The hosted zone in which to define the new record.



58
59
60
# File 'route53/record_set_props.rb', line 58

def zone
  @zone
end

Class Method Details

.jsii_propertiesObject



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'route53/record_set_props.rb', line 173

def self.jsii_properties
  {
    :zone => "zone",
    :cidr_routing_config => "cidrRoutingConfig",
    :comment => "comment",
    :delete_existing => "deleteExisting",
    :failover => "failover",
    :geo_location => "geoLocation",
    :health_check => "healthCheck",
    :multi_value_answer => "multiValueAnswer",
    :record_name => "recordName",
    :region => "region",
    :set_identifier => "setIdentifier",
    :ttl => "ttl",
    :weight => "weight",
    :record_type => "recordType",
    :target => "target",
  }
end

Instance Method Details

#to_jsiiObject



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'route53/record_set_props.rb', line 193

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "zone" => @zone,
    "cidrRoutingConfig" => @cidr_routing_config,
    "comment" => @comment,
    "deleteExisting" => @delete_existing,
    "failover" => @failover,
    "geoLocation" => @geo_location,
    "healthCheck" => @health_check,
    "multiValueAnswer" => @multi_value_answer,
    "recordName" => @record_name,
    "region" => @region,
    "setIdentifier" => @set_identifier,
    "ttl" => @ttl,
    "weight" => @weight,
    "recordType" => @record_type,
    "target" => @target,
  })
  result.compact
end