-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodepipeline-waiter.yaml
77 lines (66 loc) · 2.19 KB
/
codepipeline-waiter.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Description: Deploys the AWS CodePipeline waiter lambda into an AWS account
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
ExportPrefix:
Description: A optional unique prefix given to the export names
Type: String
Default: ""
Metadata:
AWS::ServerlessRepo::Application:
Author: Xavier Thomas
Description: An AWS lambda that can be called from a deployment AWS CodePipeline to monitor and wait for a target CodePipeline in the same or another AWS account.
HomePageUrl: https://github.com/xavier-thomas/aws-codepipeline-waiter
Labels:
- CodePipeline
- Waiter
- Monitoring
- DevOps
- Ochestration
LicenseUrl: LICENSE
Name: CodePipeline-Waiter
ReadmeUrl: README.md
SemanticVersion: 2.3.1
SourceCodeUrl: https://github.com/xavier-thomas/aws-codepipeline-waiter
SpdxLicenseId: BSD-3-Clause
Resources:
PipelineWaiterLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${ExportPrefix}PipelineWaiterLambda
Handler: index.handler
Runtime: nodejs18.x
CodeUri: ./dist
MemorySize: 128
Timeout: 30
Policies:
- AWSLambdaExecute
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- codepipeline:ListPipelines
- codepipeline:PutJobFailureResult
- codepipeline:PutJobSuccessResult
Resource: '*'
# Allow the lambda to assume role in other accounts.
# Replace the resource: '*' with a specific role arn if it's fixed.
- Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- sts:AssumeRole
Resource: '*'
Outputs:
PipelineWaiterLambdaArn:
Value: !GetAtt PipelineWaiterLambda.Arn
Export:
Name: !Sub ${ExportPrefix}PipelineWaiterLambdaArn
PipelineWaiterLambdaName:
Value: !Ref PipelineWaiterLambda
Export:
Name: !Sub ${ExportPrefix}PipelineWaiterLambdaName
PipelineWaiterLambdaRoleArn:
Value: !GetAtt PipelineWaiterLambdaRole.Arn
Export:
Name: !Sub ${ExportPrefix}PipelineWaiterLambdaRoleArn