Skip to content

Commit

Permalink
bug fixes, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Feb 24, 2022
1 parent d3ae81c commit d223181
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@
* 0.0.23 -- 2022-02-22
- code 0.1.0
- add heritage TXT record support

* 0.1.0 -- 2022-02-24
- code 0.1.11
- lots of bug fixes
- incorporate actual adding of heritage text records
23 changes: 16 additions & 7 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 = None
REGION = None
VERSION = '0.1.10'
VERSION = '0.1.11'

# Adjust the logging level [logging.INFO, logging.DEBUG, logging.WARNING, etc]
LOGGER.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -264,14 +264,23 @@ def lambda_handler(
instance['Reservations'][0]['Instances']) + lineno())
LOGGER.debug("reservations:"
" %s", str(instance['Reservations'][0]['Instances'][0]) + lineno())
elif instance is None:
caller_response.append(
'No instance {} found for event state {}. Exiting script.'.format(instance_id, state))
return caller_response

private_ip = instance['Reservations'][0]['Instances'][0]['PrivateIpAddress']
private_dns_name = instance['Reservations'][0]['Instances'][0]['PrivateDnsName']
private_host_name = private_dns_name.split('.')[0]
try:
private_ip = instance['Reservations'][0]['Instances'][0]['PrivateIpAddress']
private_dns_name = instance['Reservations'][0]['Instances'][0]['PrivateDnsName']
private_host_name = private_dns_name.split('.')[0]

LOGGER.debug("private ip: %s", str(private_ip) + lineno())
LOGGER.debug("private_dns_name: %s", str(private_dns_name) + lineno())
LOGGER.debug("private_host_name: %s", str(private_host_name) + lineno())
LOGGER.debug("private ip: %s", str(private_ip) + lineno())
LOGGER.debug("private_dns_name: %s", str(private_dns_name) + lineno())
LOGGER.debug("private_host_name: %s", str(private_host_name) + lineno())
except:
caller_response.append(
'Unable to extract IP Address or DNS name from instance {} for state {}. Exiting script.'.format(instance_id, state))
return caller_response

# Get the subnet mask of the instance
subnet_id = instance['Reservations'][0]['Instances'][0]['SubnetId']
Expand Down
Binary file modified code/ddns-lambda.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "0.0.23"
_module_version = "0.1.0"
}

0 comments on commit d223181

Please sign in to comment.