Git Product home page Git Product logo

Comments (5)

JakeHendy avatar JakeHendy commented on August 18, 2024

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.

ciaransweet avatar ciaransweet commented on August 18, 2024

@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.

JakeHendy avatar JakeHendy commented on August 18, 2024
  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.

ciaransweet avatar ciaransweet commented on August 18, 2024

I guess it's gonna use an event source like cloudformation.amazonaws.com and an event name of DeleteStack right?

from cdk-seed.

JakeHendy avatar JakeHendy commented on August 18, 2024

@ciaranevans yeah pretty much. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-api-logging-cloudtrail.html

from cdk-seed.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.