Skip to content

Commit 85884df

Browse files
committed
Allowed it to handle it gracefully when the event is from a failed volume creation.
1 parent 1a83d79 commit 85884df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Management-Utilities/auto_set_fsxn_auto_grow/set_fsxn_volume_auto_grow.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ def lambda_handler(event, context):
137137
logging.getLogger("boto3").setLevel(logging.WARNING)
138138
logging.getLogger("urllib3").setLevel(logging.WARNING)
139139
#
140+
# If this is an event from a failed call. Report that and return.
141+
if event['detail']['errorCode'] != None:
142+
logger.warning(f"This is reporting on a error event. Error Code: {event['detail']['errorCode']}. Error Message: {event['detail']['errorMessage']}.")
143+
return
144+
#
140145
# Create a Secrets Manager client.
141146
session = boto3.session.Session()
142147
secretsManagerClient = session.client(service_name='secretsmanager', region_name=secretsManagerRegion)

0 commit comments

Comments
 (0)