-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlambda-cloudformation.yaml
More file actions
63 lines (62 loc) · 1.88 KB
/
lambda-cloudformation.yaml
File metadata and controls
63 lines (62 loc) · 1.88 KB
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
59
60
61
62
63
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
AWSTemplateFormatVersion: "2010-09-09"
Description: service-catalog-github-sync-lambda
Resources:
LAMBDA:
Type: AWS::Lambda::Function
Properties:
FunctionName: service-catalog-github-sync-lambda
Handler: sync-catalog.handler
Runtime: python2.7
Description: Function to sync service catalog with a configuration file
Code: ./
MemorySize: 128
Timeout: 300
Role: !GetAtt LAMBDAROLE.Arn
LAMBDAROLE:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub service-catalog-github-sync-lambda-role-${AWS::Region}
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action:
- sts:AssumeRole
Path: /
LAMBDAPOLICY:
Type: AWS::IAM::Policy
Properties:
PolicyName: !Sub service-catalog-github-sync-lambda-policy-${AWS::Region}
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- servicecatalog:*
- s3:*
- codepipeline:PutJobFailureResult
- codepipeline:PutJobSuccessResult
- cloudformation:ValidateTemplate
- iam:GetRole
- iam:GetUser
Resource:
- "*"
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: arn:aws:logs:*:*:*
Roles:
- !Ref LAMBDAROLE
Outputs:
LambdaArn:
Description: ARN of the Lambda Function, which syncs up configuration files with yaml file
Value: !GetAtt LAMBDA.Arn
Export:
Name: service-catalog-github-sync-lambda