mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 03:07:50 +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
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def _get_fqdn(record, domain):
|
||||||
|
if record == ".":
|
||||||
|
return domain
|
||||||
|
return f"{record}.{domain}"
|
||||||
|
|
||||||
|
|
||||||
def _update_route53(
|
def _update_route53(
|
||||||
aws_access_key_id: str,
|
aws_access_key_id: str,
|
||||||
aws_secret_access_key: str,
|
aws_secret_access_key: str,
|
||||||
@ -98,7 +104,7 @@ def _update_route53(
|
|||||||
{
|
{
|
||||||
"Action": "UPSERT",
|
"Action": "UPSERT",
|
||||||
"ResourceRecordSet": {
|
"ResourceRecordSet": {
|
||||||
"Name": f"{record}.{domain}",
|
"Name": _get_fqdn(record, domain),
|
||||||
"Type": "A",
|
"Type": "A",
|
||||||
"TTL": ttl,
|
"TTL": ttl,
|
||||||
"ResourceRecords": [{"Value": ipaddress}],
|
"ResourceRecords": [{"Value": ipaddress}],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user