diff --git a/README.md b/README.md index 815aa0c..7b3f2af 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ No modules. | [component\_tags](#input\_component\_tags) | Additional tags for Components (s3, kms, ddb) | `map(map(string))` |
{
"ddb": {},
"kms": {},
"s3": {}
} | no |
| [create](#input\_create) | Flag to indicate whether to create the resources or not (default: true) | `bool` | `true` | no |
| [dynamodb\_table\_name](#input\_dynamodb\_table\_name) | Different DynamoDB table name to override default of var.name) | `string` | `null` | no |
-| [lambda\_environment\_variables](#input\_lambda\_environment\_variables) | Map of lambda environment variables and values | `map(string)` | {
"DynamoDBName": null,
"SleepTime": 60,
"TagKeyCname": "boc:dns:cname",
"TagKeyHostName": "TBD",
"TagKeyZone": "boc:dns:zone"
} | no |
+| [lambda\_environment\_variables](#input\_lambda\_environment\_variables) | Map of lambda environment variables and values | `map(string)` | {
"DNS_RR_TimeToLive": 60,
"DynamoDBName": null,
"SleepTime": 60,
"TagKeyCname": "boc:dns:cname",
"TagKeyHostName": "TBD",
"TagKeyZone": "boc:dns:zone"
} | no |
| [lambda\_name](#input\_lambda\_name) | Different Lambda name to override default of var.name) | `string` | `null` | no |
| [name](#input\_name) | Name to use within all the created resources (default: inf-dynamic-route53) | `string` | `"inf-dynamic-route53"` | no |
| [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no |
diff --git a/code/ddns-lambda.py b/code/ddns-lambda.py
index a70cc45..491cc82 100755
--- a/code/ddns-lambda.py
+++ b/code/ddns-lambda.py
@@ -39,19 +39,19 @@
LOGGER = logging.getLogger()
ACCOUNT = None
REGION = None
-VERSION = '0.0.3'
+VERSION = '0.0.4'
# Adjust the logging level [logging.INFO, logging.DEBUG, logging.WARNING, etc]
LOGGER.setLevel(logging.DEBUG)
# SNS_CLIENT = None
# Read Env variables
-SLEEPTIME = int(os.environ['SleepTime'])
-DDBNAME = os.environ['DynamoDBName']
-TAGKEY_CNAME = os.environ['TagKeyCname']
-TAGKEY_ZONE = os.environ['TagKeyZone']
-TAGKEY_HOSTNAME = os.environ['TagKeyHostName']
-DNS_RR_TTL = int(os.environ['DNS_RR_TimeToLive'])
+SLEEPTIME = int(os.environ.get('SleepTime'],'60'))
+DDBNAME = os.environ.get('DynamoDBName','inf-dynamic-route53')
+TAGKEY_CNAME = os.environ.get('TagKeyCname','boc:dns:cname')
+TAGKEY_ZONE = os.environ.get('TagKeyZone','boc:dns:zone')
+TAGKEY_HOSTNAME = os.environ.get('TagKeyHostName','')
+DNS_RR_TTL = int(os.environ.get('DNS_RR_TimeToLive','60'))
DNS_RR_TTL = 60 if DNS_RR_TTL==0 else DNS_RR_TTL
print('Loading function v%s: %s'.format(VERSION,datetime.datetime.now().time().isoformat()))
diff --git a/code/ddns-lambda.zip b/code/ddns-lambda.zip
index 09d2410..107e128 100644
Binary files a/code/ddns-lambda.zip and b/code/ddns-lambda.zip differ
diff --git a/variables.tf b/variables.tf
index ee06181..fe23c08 100644
--- a/variables.tf
+++ b/variables.tf
@@ -20,10 +20,11 @@ variable "lambda_environment_variables" {
description = "Map of lambda environment variables and values"
type = map(string)
default = {
- SleepTime = 60
- DynamoDBName = null
- TagKeyCname = "boc:dns:cname"
- TagKeyZone = "boc:dns:zone"
- TagKeyHostName = "TBD"
+ SleepTime = 60
+ DynamoDBName = null
+ TagKeyCname = "boc:dns:cname"
+ TagKeyZone = "boc:dns:zone"
+ TagKeyHostName = "TBD"
+ DNS_RR_TimeToLive = 60
}
}
diff --git a/version.tf b/version.tf
index 8eb9976..382b328 100644
--- a/version.tf
+++ b/version.tf
@@ -1,3 +1,3 @@
locals {
- _module_version = "0.0.14"
+ _module_version = "0.0.15"
}