mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
route53 - support updating base domain (#39264)
This commit is contained in:
parent
bba8b8e759
commit
84205a9a57
@ -66,6 +66,12 @@ def setup(hass, config):
|
||||
return True
|
||||
|
||||
|
||||
def _get_fqdn(record, domain):
|
||||
if record == ".":
|
||||
return domain
|
||||
return f"{record}.{domain}"
|
||||
|
||||
|
||||
def _update_route53(
|
||||
aws_access_key_id: str,
|
||||
aws_secret_access_key: str,
|
||||
@ -98,7 +104,7 @@ def _update_route53(
|
||||
{
|
||||
"Action": "UPSERT",
|
||||
"ResourceRecordSet": {
|
||||
"Name": f"{record}.{domain}",
|
||||
"Name": _get_fqdn(record, domain),
|
||||
"Type": "A",
|
||||
"TTL": ttl,
|
||||
"ResourceRecords": [{"Value": ipaddress}],
|
||||
|
Loading…
x
Reference in New Issue
Block a user