Comments (5)
CloudTrail as an event source is quite powerful, we trigger a lambda from the CreateLogGroup
event to ensure a log group has the right log subscriptions to forward to our central logging/auditing platform. If you need some code for it let me know and I'll dig out something I wrote :)
from cdk-seed.
@JakeHendy I'd definitely appreciate anything that could help kick off the DeleteStack
idea, if that's a nicer solution, it'd cut down the LogGroups we create explicitly and we could add it as a generic construct within cdk-seed
🎉
from cdk-seed.
LogGroupCreationEvent:
Type: AWS::Events::Rule
Properties:
Name: LogGroupCreationEvent
Description: Triggers when the CreateLogGroup API is called
EventPattern:
source:
- "aws.logs"
detail-type:
- "AWS API Call via CloudTrail"
detail:
eventSource:
- "logs.amazonaws.com"
eventName:
- CreateLogGroup
State: ENABLED
Targets:
- Arn: !GetAtt ALambda.Arn
Id: aLambdaArn
Can only find it in yucky yaml as opposed to CDK, but it's quite easy to port. We set the Target ID to A Lambda Arn because it was easy and we didn't need to inspect it in the console. Let me know if you want a CDK port of it and I can quickly whip one up
from cdk-seed.
I guess it's gonna use an event source like cloudformation.amazonaws.com
and an event name of DeleteStack
right?
from cdk-seed.
@ciaranevans yeah pretty much. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-api-logging-cloudtrail.html
from cdk-seed.
Related Issues (9)
- Add code linting and formatting HOT 2
- Setup CI
- Make docs website from automatically generated documentation HOT 2
- Provide start template for new packages
- Publish to respective package managers HOT 2
- Stepfunction Event logger TODO
- Permission Boundary HOT 3
- Gracefully handling non-handler failures in Custom Resources HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdk-seed.