forked from fitzee/graphcmdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
58 lines (54 loc) · 1.69 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
AWS Config -> Amazon Neptune (GraphCMDB)
Globals:
Function:
Timeout: 10
Resources:
GraphCMDBPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt GraphCMDBFunction.Arn
Principal: config.amazonaws.com
DependsOn: GraphCMDBFunction
GraphCMDBFunction:
Type: AWS::Serverless::Function
Properties:
Description: 'Inserts AWS Config changes into Amazon Neptune'
CodeUri: graphcmdb/
Handler: app.lambda_handler
Runtime: python3.7
Policies:
- AWSLambdaVPCAccessExecutionRole
- AWSLambdaBasicExecutionRole
- AWSConfigRulesExecutionRole
VpcConfig:
SubnetIds:
- 'subnet-1a483346'
- 'subnet-e86be9d6'
- 'subnet-26353b6c'
- 'subnet-5c152553'
SecurityGroupIds:
- 'sg-08dd41fdb983dca49'
Environment:
Variables:
NEPTUNE_ENDPOINT: 'ws://graphdemo.ccfxddbosjfb.us-east-1.neptune.amazonaws.com:8182/gremlin'
CMDBConfigRule:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: cmdbconfigrule
Description: 'Catch all config events for the CMDB'
Source:
Owner: CUSTOM_LAMBDA
SourceIdentifier: !GetAtt GraphCMDBFunction.Arn
SourceDetails:
-
EventSource: aws.config
MessageType: ConfigurationItemChangeNotification
-
EventSource: aws.config
MessageType: OversizedConfigurationItemChangeNotification
InputParameters: "{}"
DependsOn: GraphCMDBPermission