Skip to content

Commit

Permalink
[ETL-575] Pass SkipDestinationValidation=True (#88)
Browse files Browse the repository at this point in the history
* Pass SkipDestinationValidation=True to the event notification configuration lambda function
  • Loading branch information
BryanFauble authored Oct 31, 2023
1 parent b52411b commit 0b73e55
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/lambda_function/s3_event_config/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,25 @@ def add_notification(
update_required = True

if update_required:
logger.info(
"Put request started to add a NotificationConfiguration for "
+ create_formatted_message(bucket, destination_type, destination_arn)
)
existing_bucket_notification_configuration[
f"{destination_type}Configurations"
] = existing_notification_configurations_for_type
s3_client.put_bucket_notification_configuration(
Bucket=bucket,
NotificationConfiguration=existing_bucket_notification_configuration,
SkipDestinationValidation=True,
)
logger.info(
f"Put request completed to add a NotificationConfiguration for"
"Put request completed to add a NotificationConfiguration for "
+ create_formatted_message(bucket, destination_type, destination_arn)
)
else:
logger.info(
f"Put not required as an existing NotificationConfiguration already exists for"
"Put not required as an existing NotificationConfiguration already exists for "
+ create_formatted_message(bucket, destination_type, destination_arn)
)

Expand Down Expand Up @@ -318,16 +323,21 @@ def delete_notification(
f"{destination_type}Configurations"
]

logger.info(
"Delete request started to remove a NotificationConfiguration for "
+ create_formatted_message(bucket, destination_type, destination_arn)
)
s3_client.put_bucket_notification_configuration(
Bucket=bucket,
NotificationConfiguration=existing_bucket_notification_configuration,
SkipDestinationValidation=True,
)
logger.info(
f"Delete request completed to remove a NotificationConfiguration for"
"Delete request completed to remove a NotificationConfiguration for "
+ create_formatted_message(bucket, destination_type, destination_arn)
)
else:
logger.info(
f"Delete not required as no NotificationConfiguration exists for"
"Delete not required as no NotificationConfiguration exists for "
+ create_formatted_message(bucket, destination_type, destination_arn)
)

0 comments on commit 0b73e55

Please sign in to comment.