cloudandthings / terraform-aws-clickops-notifier

Get notified when actions are taken in the AWS Console.
https://registry.terraform.io/modules/cloudandthings/clickops-notifier/aws/latest
MIT License
208 stars 17 forks source link

feat: Allow using a topic from outside of the module #77

Closed atorrescogollo closed 9 months ago

atorrescogollo commented 10 months ago

Based on the AWS provider docs:

S3 Buckets only support a single notification configuration. Declaring multiple aws_s3_bucket_notification resources to the same S3 Bucket will cause a perpetual difference in configuration.

With the current code, since it creates both the topic and the notification, you can't listen to CloudTrail events through the bucket from another topic/sqs/lambda/... that is not the clickops-notifier.

With the new code, the module allows you to subscribe to a topic that is already created if you set the cloudtrail_bucket_notifications_sns_arn variable. That way, it doesn't block others from listening to S3 events.

atorrescogollo commented 9 months ago

@baolsen I just updated to PR to pass pre-commit checks

baolsen commented 9 months ago

@atorrescogollo thanks for the contribution. I'll get the tests to run, it is an unrelated issue

baolsen commented 9 months ago

@atorrescogollo I think it should work now, please push an empty commit.

git commit --allow-empty -m "empty"

baolsen commented 9 months ago

@atorrescogollo I'm not yet certain why the test step isn't working.

On another PR I merged a few min ago it ran through fine o_O

I've updated the aws-actions/configure-aws-credentials to v4, seems there were some related fixes a few months ago.

Please merge one more time [Merge branch 'cloudandthings:main' into main]

atorrescogollo commented 9 months ago

Hi @baolsen , I already merged from upstream main. Can you approve it to run the tests again?

baolsen commented 9 months ago

Thanks @atorrescogollo for your patience.

I'm not sure why it's still giving an issue. Definitely your changes have nothing to do with it.

I'm going to merge this and then I'll create a dummy PR to run the tests.

Once that's done I'll cut a release.

baolsen commented 9 months ago

@atorrescogollo

The tests ran through fine. Thanks again for the contribution! Released with v5.1.0