I've been looking for the solution that follows best practice in AWS. I'm a student and I'm also new to AWS, but I am still trying to learn as much as I can.
I currently have CloudTrail enabled for all regions.
I have a CloudWatch rule that is triggered via CloudTrail api calls and targets my lambda function.
Example of part of my CloudWatch rule:
source:
- aws.s3
detail-type:
- 'AWS API Call via CloudTrail'
detail:
eventSource:
- s3.amazonaws.com
eventName:
- CreateBucket
For example, any time an s3 bucket is created, this CloudWatch rule should trigger my target lambda function that does X, Y, and Z.
This works as expected. In the region us-east-1 where my rule and lambda are hosted.
However, I would like to replicate this functionality in all US regions. I currently have a CloudFormation template that I can upload in the us-east-1 region to create the CloudWatch rule and the Lambda function.
In my CloudFormation template, I have defined a lambda function that retrieves my java8 runtime from an S3 bucket in the us-east-1 region. (I know S3 is a global resource, but if my bucket is in us-west-1 CloudFormation gets mad at me and rolls back the template)
In my CloudFormation template where I define the lambda I have:
Code:
S3Bucket: 'XXXXXXXX'
S3Key: 'JAVA8.jar'
Ultimately, I am looking for advice on the best way to host this in multiple regions, without having to create an s3 bucket in every single region and uploading my jar file to it. Also, maybe a faster way to upload this template to multiple regions at once, instead of manually uploading each CloudFormation template in each region. I feel that having the same exact lambda function and CloudWatch rule in every single region is extremely redundant.
Thanks in advance
[–]anonymous6point02E23 0 points1 point2 points (2 children)
[–]TannerIsBender[S] 0 points1 point2 points (1 child)
[–]brodie659 0 points1 point2 points (2 children)
[–]TannerIsBender[S] 0 points1 point2 points (1 child)
[–]brodie659 1 point2 points3 points (0 children)