Skip to content

Commit 79742e8

Browse files
author
Edward Keeble
committed
Better handling of missing behavior or origin config
1 parent f59bd8b commit 79742e8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.0.3

cdk_cloudfront_update/update_cf/update_distribution.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ def lambda_handler(event, context):
2020
)
2121
config_req = dict(config_res["DistributionConfig"])
2222
e_tag = config_res["ETag"]
23-
origin_config = json.loads(event["ResourceProperties"].get("OriginConfig"))
24-
behavior_config = json.loads(event["ResourceProperties"].get("BehaviorConfig"))
23+
origin_config = json.loads(
24+
event["ResourceProperties"].get("OriginConfig", "{}")
25+
)
26+
behavior_config = json.loads(
27+
event["ResourceProperties"].get("BehaviorConfig", "{}")
28+
)
2529

2630
origins_by_id = {
2731
origin["Id"]: origin for origin in config_req["Origins"].get("Items", [])

0 commit comments

Comments
 (0)