Skip to content

Implemented ConfigureBucketNotifications class - #242

Merged
akhil-sumologic merged 2 commits into
non_sam_finalfrom
s3_sns_int
Aug 1, 2026
Merged

Implemented ConfigureBucketNotifications class#242
akhil-sumologic merged 2 commits into
non_sam_finalfrom
s3_sns_int

Conversation

@akhil-sumologic

Copy link
Copy Markdown
Contributor

ConfigureBucketNotifications ?

For each unique bucket in the Sources list:

  1. SNS Topic — named sumo-s3-notif-{stack_suffix}-{bucket_hash}. One per unique bucket, shared across all sources pointing to that bucket.
  2. SNS Topic Policy — allows s3.amazonaws.com to call sns:Publish on that topic, scoped to the specific bucket ARN via ArnLike.
  3. S3 Bucket Notification — adds a TopicConfiguration on the existing bucket pointing to the SNS topic for s3:ObjectCreated:Put events.
  4. SNS HTTPS Subscriptions — one per Sumo endpoint sharing that bucket. If ALB and ELB both point to the same bucket, the single topic gets two
    subscriptions — one to the ALB Sumo source endpoint, one to the ELB Sumo source endpoint. Both get every S3 event.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new CloudFormation custom resource implementation (Custom::ConfigureBucketNotifications) to manage S3 bucket event notifications and SNS topics/subscriptions for multiple “sources”, grouping by bucket so a single SNS topic is shared per bucket.

Changes:

  • Introduces ConfigureBucketNotifications resource to create/update/delete SNS topics + topic policies per bucket.
  • Configures S3 bucket notification TopicConfigurations for s3:ObjectCreated:Put events.
  • Creates HTTPS SNS subscriptions per bucket for each configured Sumo endpoint and performs cleanup on update/delete.
Suppressed comments (1)

sumologic-app-utils/src/awsresource.py:1547

  • _cleanup has the same issue as _configure: it indexes src['SumoEndpoint'] without checking it exists and can duplicate endpoints while grouping. This can raise KeyError during delete/update flows and makes the grouping inconsistent with _configure.
 active = [s for s in sources if s.get('BucketName')]
buckets = {}
for src in active:
buckets.setdefault(src['BucketName'], []).append(src['SumoEndpoint'])

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsumologic-app-utils/src/awsresource.py
Comment threadsumologic-app-utils/src/awsresource.py Outdated

@npandenpande left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akhil-sumologic
akhil-sumologic merged commit 9838a27 into non_sam_finalAug 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@akhil-sumologic@npande