Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni
Last active February 25, 2019 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexcasalboni/45839b537d564c09d53762d47f04158a to your computer and use it in GitHub Desktop.
Save alexcasalboni/45839b537d564c09d53762d47f04158a to your computer and use it in GitHub Desktop.
AWS Config - AWS Lambda Custom Rule example (YAML)
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MyFunction:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
# ...
# all the other properties here
# ...
MyCustomRule:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: MyCustomRule
Scope:
ComplianceResourceTypes:
- AWS::EC2::Instance # listen to all instances
InputParameters:
desiredInstanceType: t2.small
Source:
Owner: CUSTOM_LAMBDA
SourceIdentifier: !GetAtt MyFunction.Arn
SourceDetails:
-
EventSource: aws.config
MessageType: ConfigurationItemChangeNotification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment