Skip to content

Commit

Permalink
Better handling of missing behavior or origin config
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Keeble committed Jun 9, 2023
1 parent f59bd8b commit 79742e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.0.3
8 changes: 6 additions & 2 deletions cdk_cloudfront_update/update_cf/update_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ def lambda_handler(event, context):
)
config_req = dict(config_res["DistributionConfig"])
e_tag = config_res["ETag"]
origin_config = json.loads(event["ResourceProperties"].get("OriginConfig"))
behavior_config = json.loads(event["ResourceProperties"].get("BehaviorConfig"))
origin_config = json.loads(
event["ResourceProperties"].get("OriginConfig", "{}")
)
behavior_config = json.loads(
event["ResourceProperties"].get("BehaviorConfig", "{}")
)

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

0 comments on commit 79742e8

Please sign in to comment.