Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 25, 2023
1 parent 8824410 commit df22b6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions code/ddns-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
LOGGER = logging.getLogger()
account_id = None
region = None
VERSION = '1.2.0b42'
VERSION = '1.2.0b43'

# Read Env variables
DEBUG_LOG_LEVEL = os.environ.get('DebugLogLevel', 'INFO')
Expand Down Expand Up @@ -494,21 +494,21 @@ def lambda_handler(
return caller_response

# These are collections of zones in Route 53.
hosted_zones = new_list_hosted_zones(route53, instance_id)
LOGGER.debug("hosted_zones for vpc_id %s: %s", vpc_id, str(hosted_zones) + lineno())
## hosted_zones = new_list_hosted_zones(route53, instance_id)
## LOGGER.debug("hosted_zones for vpc_id %s: %s", vpc_id, str(hosted_zones) + lineno())
hosted_zones_by_vpc = new_list_hosted_zones_by_vpc(
route53, instance_id, vpc_id, region)
LOGGER.debug("hosted_zones_by_vpc for vpc_id %s: %s",
vpc_id, str(hosted_zones_by_vpc) + lineno())
private_hosted_zones = get_private_hosted_zones(hosted_zones)
LOGGER.debug("private_hosted_zones: %s", str(list(private_hosted_zones)) + lineno())
## private_hosted_zones = get_private_hosted_zones(hosted_zones)
## LOGGER.debug("private_hosted_zones: %s", str(list(private_hosted_zones)) + lineno())
private_hosted_zones_by_vpc = get_private_hosted_zones_by_vpc(hosted_zones_by_vpc)
LOGGER.debug("private_hosted_zones_by_vpc: vpc_id: %s, %s",
vpc_id, str(list(private_hosted_zones)) + lineno())
private_hosted_zone_collection = get_private_hosted_zone_collection(
private_hosted_zones)
LOGGER.debug("private_hosted_zone_collection: %s",
str(list(private_hosted_zone_collection)) + lineno())
# private_hosted_zone_collection = get_private_hosted_zone_collection(
# private_hosted_zones)
# LOGGER.debug("private_hosted_zone_collection: %s",
# str(list(private_hosted_zone_collection)) + lineno())
private_hosted_zone_collection_by_vpc = get_private_hosted_zone_collection_by_vpc(
private_hosted_zones_by_vpc)
LOGGER.debug("private_hosted_zone_collection_by_vpc: %s",
Expand Down Expand Up @@ -1721,15 +1721,16 @@ def new_get_resource_record(oclient, instance_id, zone_id, host_name, hosted_zon
LOGGER.debug("Getting %s record type for %s",
record_type, host_name + lineno())

if host_name[-1] != '.':
host_name = host_name + '.'
# if host_name[-1] != '.':
# host_name = host_name + '.'

LOGGER.debug("list_resource_record_sets looking for record %s in zone %s",
str(host_name), str(hosted_zone_name) + lineno())

response = client.list_resource_record_sets(
HostedZoneId=zone_id,
StartRecordName=host_name + hosted_zone_name,
# StartRecordName=host_name + hosted_zone_name,
StartRecordName=create_fqdn(host_name, hosted_zone_name),
StartRecordType=record_type,
MaxItems='1')

Expand Down
Binary file modified code/ddns-lambda.zip
Binary file not shown.

0 comments on commit df22b6f

Please sign in to comment.