Route53Config¶
Bases: BaseModel
Configuration model for AWS Route53 hosted zone and domain management.
Defines the structure and validation rules for Route53 DNS configurations, ensuring proper hosted zone identification and domain name formatting for AWS DNS record management and domain resolution.
Attributes:
| Name | Type | Description |
|---|---|---|
hosted_zone_id |
str
|
AWS Route53 hosted zone identifier for DNS record management |
domain_name |
str
|
Fully qualified domain name associated with the hosted zone |
Source code in mare_aws_common_lib/models/route53_config.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 54 55 56 57 58 59 60 61 62 | |
validate_domain_name(value)
¶
Validate the domain name format and structure.
Applies RFC-compliant domain name validation to ensure the domain follows standard DNS naming conventions including proper label length, character restrictions, and overall domain structure requirements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Raw domain name from configuration |
required |
Returns:
| Type | Description |
|---|---|
str
|
Validated domain name |
Raises:
| Type | Description |
|---|---|
ValueError
|
If domain name doesn't conform to DNS naming standards |
Source code in mare_aws_common_lib/models/route53_config.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
validate_hosted_zone_id(value)
classmethod
¶
Validate the Route53 hosted zone ID format.
Ensures the hosted zone ID follows AWS Route53 conventions with the required 'Z' prefix followed by alphanumeric characters, preventing invalid zone references that would cause DNS resolution failures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Raw hosted zone ID from configuration |
required |
Returns:
| Type | Description |
|---|---|
str
|
Validated hosted zone ID |
Raises:
| Type | Description |
|---|---|
ValueError
|
If hosted zone ID doesn't match AWS format requirements |
Source code in mare_aws_common_lib/models/route53_config.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Example
from mare_aws_common_lib.models import Route53Config
# Basic domain configuration
config = Route53Config(
hosted_zone_id="Z1234567890ABC",
domain_name="example.com"
)