@mapbox/cloudfriend 7.1.0 → 7.2.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/c85e6e5a-f842-4bd6-ad20-6f04ab728aac.json +1 -0
- package/.nyc_output/f52017b2-43bd-4f2e-a740-f75421866b4a.json +1 -0
- package/.nyc_output/processinfo/c85e6e5a-f842-4bd6-ad20-6f04ab728aac.json +1 -0
- package/.nyc_output/processinfo/f52017b2-43bd-4f2e-a740-f75421866b4a.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/lib/shortcuts/api.md +60 -0
- package/lib/shortcuts/event-lambda.js +37 -0
- package/lib/shortcuts/scheduled-lambda.js +32 -0
- package/package.json +3 -1
- package/test/fixtures/shortcuts/event-lambda-custom-eventbus.json +200 -0
- package/test/fixtures/shortcuts/hookshot-github-secret-ref.json +2 -2
- package/test/fixtures/shortcuts/hookshot-github-secret-string.json +2 -2
- package/test/fixtures/shortcuts/hookshot-github.json +2 -2
- package/test/fixtures/shortcuts/hookshot-passthrough-access-log-format.json +2 -2
- package/test/fixtures/shortcuts/hookshot-passthrough-alarms.json +2 -2
- package/test/fixtures/shortcuts/hookshot-passthrough-enhanced-logging.json +2 -2
- package/test/fixtures/shortcuts/hookshot-passthrough-full-blown-logging.json +2 -2
- package/test/fixtures/shortcuts/hookshot-passthrough-logging.json +2 -2
- package/test/fixtures/shortcuts/hookshot-passthrough.json +2 -2
- package/test/fixtures/shortcuts/scheduled-lambda-custom-eventbus.json +188 -0
- package/test/shortcuts.test.js +42 -0
- package/.nyc_output/222315fd-a3a2-4bed-8a08-850c3a05d3af.json +0 -1
- package/.nyc_output/73f67d80-cf5b-4c49-aa3f-4783ae74471b.json +0 -1
- package/.nyc_output/processinfo/222315fd-a3a2-4bed-8a08-850c3a05d3af.json +0 -1
- package/.nyc_output/processinfo/73f67d80-cf5b-4c49-aa3f-4783ae74471b.json +0 -1
package/lib/shortcuts/api.md
CHANGED
|
@@ -142,6 +142,7 @@ a Lambda permission.
|
|
|
142
142
|
| --- | --- | --- | --- |
|
|
143
143
|
| options | <code>Object</code> | | Extends the options for [`Lambda`](#lambda) with the following additional attributes: |
|
|
144
144
|
| options.EventPattern | <code>String</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern). |
|
|
145
|
+
| [options.EventBusName] | <code>String</code> | <code>'default'</code> | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname). |
|
|
145
146
|
| [options.State] | <code>String</code> | <code>'ENABLED'</code> | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state). |
|
|
146
147
|
|
|
147
148
|
**Example**
|
|
@@ -165,6 +166,38 @@ const lambda = new cf.shortcuts.EventLambda({
|
|
|
165
166
|
}
|
|
166
167
|
});
|
|
167
168
|
|
|
169
|
+
module.exports = cf.merge(myTemplate, lambda);
|
|
170
|
+
```
|
|
171
|
+
**Example**
|
|
172
|
+
```js
|
|
173
|
+
const cf = require('@mapbox/cloudfriend');
|
|
174
|
+
|
|
175
|
+
const myTemplate = {
|
|
176
|
+
...
|
|
177
|
+
Resources: {
|
|
178
|
+
MyEventBus: {
|
|
179
|
+
Type: 'AWS::Events::EventBus',
|
|
180
|
+
Properties: { ... }
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const lambda = new cf.shortcuts.EventLambda({
|
|
186
|
+
LogicalName: 'MyLambda',
|
|
187
|
+
Code: {
|
|
188
|
+
S3Bucket: 'my-code-bucket',
|
|
189
|
+
S3Key: 'path/to/code.zip'
|
|
190
|
+
},
|
|
191
|
+
EventBusName: cf.ref('MyEventBus'),
|
|
192
|
+
EventPattern: {
|
|
193
|
+
'detail-type': ['AWS Console Sign In via CloudTrail'],
|
|
194
|
+
detail: {
|
|
195
|
+
eventSource: ['signin.amazonaws.com'],
|
|
196
|
+
eventName: ['ConsoleLogin']
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
168
201
|
module.exports = cf.merge(myTemplate, lambda);
|
|
169
202
|
```
|
|
170
203
|
<a name="GlueDatabase"></a>
|
|
@@ -674,6 +707,7 @@ a Lambda permission.
|
|
|
674
707
|
| --- | --- | --- | --- |
|
|
675
708
|
| options | <code>Object</code> | | Extends the options for [`Lambda`](#lambda) with the following additional attributes: |
|
|
676
709
|
| options.ScheduleExpression | <code>String</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-scheduleexpression). |
|
|
710
|
+
| [options.EventBusName] | <code>String</code> | <code>'default'</code> | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname). |
|
|
677
711
|
| [options.State] | <code>String</code> | <code>'ENABLED'</code> | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state). |
|
|
678
712
|
|
|
679
713
|
**Example**
|
|
@@ -691,6 +725,32 @@ const lambda = new cf.shortcuts.ScheduledLambda({
|
|
|
691
725
|
ScheduleExpression: 'cron(45 * * * ? *)',
|
|
692
726
|
});
|
|
693
727
|
|
|
728
|
+
module.exports = cf.merge(myTemplate, lambda);
|
|
729
|
+
```
|
|
730
|
+
**Example**
|
|
731
|
+
```js
|
|
732
|
+
const cf = require('@mapbox/cloudfriend');
|
|
733
|
+
|
|
734
|
+
const myTemplate = {
|
|
735
|
+
...
|
|
736
|
+
Resources: {
|
|
737
|
+
MyEventBus: {
|
|
738
|
+
Type: 'AWS::Events::EventBus',
|
|
739
|
+
Properties: { ... }
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
const lambda = new cf.shortcuts.ScheduledLambda({
|
|
745
|
+
LogicalName: 'MyLambda',
|
|
746
|
+
Code: {
|
|
747
|
+
S3Bucket: 'my-code-bucket',
|
|
748
|
+
S3Key: 'path/to/code.zip'
|
|
749
|
+
},
|
|
750
|
+
EventBusName: cf.ref('MyEventBus'),
|
|
751
|
+
ScheduleExpression: 'cron(45 * * * ? *)',
|
|
752
|
+
});
|
|
753
|
+
|
|
694
754
|
module.exports = cf.merge(myTemplate, lambda);
|
|
695
755
|
```
|
|
696
756
|
<a name="ServiceRole"></a>
|
|
@@ -10,6 +10,7 @@ const Lambda = require('./lambda');
|
|
|
10
10
|
* @param {Object} options - Extends the options for [`Lambda`](#lambda)
|
|
11
11
|
* with the following additional attributes:
|
|
12
12
|
* @param {String} options.EventPattern - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern).
|
|
13
|
+
* @param {String} [options.EventBusName='default'] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname).
|
|
13
14
|
* @param {String} [options.State='ENABLED'] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state).
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
@@ -33,6 +34,37 @@ const Lambda = require('./lambda');
|
|
|
33
34
|
* });
|
|
34
35
|
*
|
|
35
36
|
* module.exports = cf.merge(myTemplate, lambda);
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const cf = require('@mapbox/cloudfriend');
|
|
40
|
+
*
|
|
41
|
+
* const myTemplate = {
|
|
42
|
+
* ...
|
|
43
|
+
* Resources: {
|
|
44
|
+
* MyEventBus: {
|
|
45
|
+
* Type: 'AWS::Events::EventBus',
|
|
46
|
+
* Properties: { ... }
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* };
|
|
50
|
+
*
|
|
51
|
+
* const lambda = new cf.shortcuts.EventLambda({
|
|
52
|
+
* LogicalName: 'MyLambda',
|
|
53
|
+
* Code: {
|
|
54
|
+
* S3Bucket: 'my-code-bucket',
|
|
55
|
+
* S3Key: 'path/to/code.zip'
|
|
56
|
+
* },
|
|
57
|
+
* EventBusName: cf.ref('MyEventBus'),
|
|
58
|
+
* EventPattern: {
|
|
59
|
+
* 'detail-type': ['AWS Console Sign In via CloudTrail'],
|
|
60
|
+
* detail: {
|
|
61
|
+
* eventSource: ['signin.amazonaws.com'],
|
|
62
|
+
* eventName: ['ConsoleLogin']
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* module.exports = cf.merge(myTemplate, lambda);
|
|
36
68
|
*/
|
|
37
69
|
class EventLambda extends Lambda {
|
|
38
70
|
constructor(options) {
|
|
@@ -41,6 +73,7 @@ class EventLambda extends Lambda {
|
|
|
41
73
|
|
|
42
74
|
const {
|
|
43
75
|
EventPattern,
|
|
76
|
+
EventBusName,
|
|
44
77
|
State = 'ENABLED'
|
|
45
78
|
} = options;
|
|
46
79
|
|
|
@@ -72,6 +105,10 @@ class EventLambda extends Lambda {
|
|
|
72
105
|
}
|
|
73
106
|
};
|
|
74
107
|
|
|
108
|
+
if (EventBusName) {
|
|
109
|
+
this.Resources[`${this.LogicalName}Trigger`].Properties.EventBusName = EventBusName;
|
|
110
|
+
}
|
|
111
|
+
|
|
75
112
|
this.Resources[`${this.LogicalName}Permission`] = {
|
|
76
113
|
Type: 'AWS::Lambda::Permission',
|
|
77
114
|
Condition: this.Condition,
|
|
@@ -9,6 +9,7 @@ const Lambda = require('./lambda');
|
|
|
9
9
|
*
|
|
10
10
|
* @param {Object} options - Extends the options for [`Lambda`](#lambda) with the following additional attributes:
|
|
11
11
|
* @param {String} options.ScheduleExpression - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-scheduleexpression).
|
|
12
|
+
* @param {String} [options.EventBusName='default'] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname).
|
|
12
13
|
* @param {String} [options.State='ENABLED'] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state).
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
@@ -26,6 +27,32 @@ const Lambda = require('./lambda');
|
|
|
26
27
|
* });
|
|
27
28
|
*
|
|
28
29
|
* module.exports = cf.merge(myTemplate, lambda);
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const cf = require('@mapbox/cloudfriend');
|
|
33
|
+
*
|
|
34
|
+
* const myTemplate = {
|
|
35
|
+
* ...
|
|
36
|
+
* Resources: {
|
|
37
|
+
* MyEventBus: {
|
|
38
|
+
* Type: 'AWS::Events::EventBus',
|
|
39
|
+
* Properties: { ... }
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* };
|
|
43
|
+
*
|
|
44
|
+
* const lambda = new cf.shortcuts.ScheduledLambda({
|
|
45
|
+
* LogicalName: 'MyLambda',
|
|
46
|
+
* Code: {
|
|
47
|
+
* S3Bucket: 'my-code-bucket',
|
|
48
|
+
* S3Key: 'path/to/code.zip'
|
|
49
|
+
* },
|
|
50
|
+
* EventBusName: cf.ref('MyEventBus'),
|
|
51
|
+
* ScheduleExpression: 'cron(45 * * * ? *)',
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* module.exports = cf.merge(myTemplate, lambda);
|
|
55
|
+
*
|
|
29
56
|
*/
|
|
30
57
|
class ScheduledLambda extends Lambda {
|
|
31
58
|
constructor(options) {
|
|
@@ -33,6 +60,7 @@ class ScheduledLambda extends Lambda {
|
|
|
33
60
|
super(options);
|
|
34
61
|
|
|
35
62
|
const {
|
|
63
|
+
EventBusName,
|
|
36
64
|
ScheduleExpression,
|
|
37
65
|
State = 'ENABLED'
|
|
38
66
|
} = options;
|
|
@@ -65,6 +93,10 @@ class ScheduledLambda extends Lambda {
|
|
|
65
93
|
}
|
|
66
94
|
};
|
|
67
95
|
|
|
96
|
+
if (EventBusName) {
|
|
97
|
+
this.Resources[`${this.LogicalName}Schedule`].Properties.EventBusName = EventBusName;
|
|
98
|
+
}
|
|
99
|
+
|
|
68
100
|
this.Resources[`${this.LogicalName}Permission`] = {
|
|
69
101
|
Type: 'AWS::Lambda::Permission',
|
|
70
102
|
Condition: this.Condition,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapbox/cloudfriend",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-0",
|
|
4
4
|
"description": "Helper functions for assembling CloudFormation templates in JavaScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"pretest": "eslint index.js test lib bin cloudformation && npm run shortcuts-api-doc",
|
|
11
|
+
"lint": "eslint index.js test lib bin cloudformation",
|
|
12
|
+
"lint:fix": "npm run lint -- --fix",
|
|
11
13
|
"test": "nyc tape test/*.test.js | tap-spec",
|
|
12
14
|
"coverage": "nyc --reporter html tape test/*.test.js && opener coverage/index.html",
|
|
13
15
|
"build-ci-template": "bin/build-template.js cloudformation/ci.template.js > cloudformation/ci.template.json",
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"AWSTemplateFormatVersion": "2010-09-09",
|
|
3
|
+
"Metadata": {},
|
|
4
|
+
"Parameters": {},
|
|
5
|
+
"Rules": {},
|
|
6
|
+
"Mappings": {},
|
|
7
|
+
"Conditions": {},
|
|
8
|
+
"Resources": {
|
|
9
|
+
"MyLambdaLogs": {
|
|
10
|
+
"Type": "AWS::Logs::LogGroup",
|
|
11
|
+
"Properties": {
|
|
12
|
+
"LogGroupName": {
|
|
13
|
+
"Fn::Sub": [
|
|
14
|
+
"/aws/lambda/${name}",
|
|
15
|
+
{
|
|
16
|
+
"name": {
|
|
17
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"RetentionInDays": 14
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"MyLambda": {
|
|
26
|
+
"Type": "AWS::Lambda::Function",
|
|
27
|
+
"Properties": {
|
|
28
|
+
"Code": {
|
|
29
|
+
"S3Bucket": "my-code-bucket",
|
|
30
|
+
"S3Key": "path/to/code.zip"
|
|
31
|
+
},
|
|
32
|
+
"Description": {
|
|
33
|
+
"Fn::Sub": "MyLambda in the ${AWS::StackName} stack"
|
|
34
|
+
},
|
|
35
|
+
"FunctionName": {
|
|
36
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda"
|
|
37
|
+
},
|
|
38
|
+
"Handler": "index.handler",
|
|
39
|
+
"MemorySize": 128,
|
|
40
|
+
"Runtime": "nodejs18.x",
|
|
41
|
+
"Timeout": 300,
|
|
42
|
+
"Role": {
|
|
43
|
+
"Fn::GetAtt": [
|
|
44
|
+
"MyLambdaRole",
|
|
45
|
+
"Arn"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"MyLambdaErrorAlarm": {
|
|
51
|
+
"Type": "AWS::CloudWatch::Alarm",
|
|
52
|
+
"Properties": {
|
|
53
|
+
"AlarmName": {
|
|
54
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda-Errors-${AWS::Region}"
|
|
55
|
+
},
|
|
56
|
+
"AlarmDescription": {
|
|
57
|
+
"Fn::Sub": [
|
|
58
|
+
"Error alarm for ${name} lambda function in ${AWS::StackName} stack",
|
|
59
|
+
{
|
|
60
|
+
"name": {
|
|
61
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"AlarmActions": [],
|
|
67
|
+
"Period": 60,
|
|
68
|
+
"EvaluationPeriods": 5,
|
|
69
|
+
"DatapointsToAlarm": 1,
|
|
70
|
+
"Statistic": "Sum",
|
|
71
|
+
"Threshold": 0,
|
|
72
|
+
"ComparisonOperator": "GreaterThanThreshold",
|
|
73
|
+
"TreatMissingData": "notBreaching",
|
|
74
|
+
"Namespace": "AWS/Lambda",
|
|
75
|
+
"Dimensions": [
|
|
76
|
+
{
|
|
77
|
+
"Name": "FunctionName",
|
|
78
|
+
"Value": {
|
|
79
|
+
"Ref": "MyLambda"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"MetricName": "Errors"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"MyLambdaLogPolicy": {
|
|
87
|
+
"Type": "AWS::IAM::Policy",
|
|
88
|
+
"DependsOn": "MyLambdaRole",
|
|
89
|
+
"Properties": {
|
|
90
|
+
"PolicyName": "lambda-log-access",
|
|
91
|
+
"Roles": [
|
|
92
|
+
{
|
|
93
|
+
"Ref": "MyLambdaRole"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"PolicyDocument": {
|
|
97
|
+
"Version": "2012-10-17",
|
|
98
|
+
"Statement": [
|
|
99
|
+
{
|
|
100
|
+
"Effect": "Allow",
|
|
101
|
+
"Action": "logs:*",
|
|
102
|
+
"Resource": {
|
|
103
|
+
"Fn::GetAtt": [
|
|
104
|
+
"MyLambdaLogs",
|
|
105
|
+
"Arn"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"MyLambdaRole": {
|
|
114
|
+
"Type": "AWS::IAM::Role",
|
|
115
|
+
"Properties": {
|
|
116
|
+
"AssumeRolePolicyDocument": {
|
|
117
|
+
"Statement": [
|
|
118
|
+
{
|
|
119
|
+
"Effect": "Allow",
|
|
120
|
+
"Action": "sts:AssumeRole",
|
|
121
|
+
"Principal": {
|
|
122
|
+
"Service": {
|
|
123
|
+
"Fn::Sub": "lambda.amazonaws.com"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"MyLambdaTrigger": {
|
|
132
|
+
"Type": "AWS::Events::Rule",
|
|
133
|
+
"Properties": {
|
|
134
|
+
"Name": {
|
|
135
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda"
|
|
136
|
+
},
|
|
137
|
+
"Description": {
|
|
138
|
+
"Fn::Sub": [
|
|
139
|
+
"Event trigger for ${function} in ${AWS::StackName} stack",
|
|
140
|
+
{
|
|
141
|
+
"function": {
|
|
142
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"State": "DISABLED",
|
|
148
|
+
"EventPattern": {
|
|
149
|
+
"source": [
|
|
150
|
+
"aws.ec2"
|
|
151
|
+
],
|
|
152
|
+
"detail-type": [
|
|
153
|
+
"EC2 Instance State-change Notification"
|
|
154
|
+
],
|
|
155
|
+
"detail": {
|
|
156
|
+
"state": [
|
|
157
|
+
"running"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"Targets": [
|
|
162
|
+
{
|
|
163
|
+
"Id": {
|
|
164
|
+
"Fn::Sub": "${AWS::StackName}-MyLambda"
|
|
165
|
+
},
|
|
166
|
+
"Arn": {
|
|
167
|
+
"Fn::GetAtt": [
|
|
168
|
+
"MyLambda",
|
|
169
|
+
"Arn"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"EventBusName": "my-cool-eventbus"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"MyLambdaPermission": {
|
|
178
|
+
"Type": "AWS::Lambda::Permission",
|
|
179
|
+
"Properties": {
|
|
180
|
+
"Action": "lambda:InvokeFunction",
|
|
181
|
+
"FunctionName": {
|
|
182
|
+
"Fn::GetAtt": [
|
|
183
|
+
"MyLambda",
|
|
184
|
+
"Arn"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"Principal": {
|
|
188
|
+
"Fn::Sub": "events.${AWS::URLSuffix}"
|
|
189
|
+
},
|
|
190
|
+
"SourceArn": {
|
|
191
|
+
"Fn::GetAtt": [
|
|
192
|
+
"MyLambdaTrigger",
|
|
193
|
+
"Arn"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"Outputs": {}
|
|
200
|
+
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"Type": "AWS::ApiGateway::Stage",
|
|
29
29
|
"Properties": {
|
|
30
30
|
"DeploymentId": {
|
|
31
|
-
"Ref": "
|
|
31
|
+
"Ref": "PassDeployment41d722f6"
|
|
32
32
|
},
|
|
33
33
|
"StageName": "hookshot",
|
|
34
34
|
"RestApiId": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
"
|
|
50
|
+
"PassDeployment41d722f6": {
|
|
51
51
|
"Type": "AWS::ApiGateway::Deployment",
|
|
52
52
|
"DependsOn": "PassMethod",
|
|
53
53
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"
|
|
55
|
+
"PassDeployment41d722f6": {
|
|
56
56
|
"Type": "AWS::ApiGateway::Deployment",
|
|
57
57
|
"DependsOn": "PassMethod",
|
|
58
58
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"Type": "AWS::ApiGateway::Stage",
|
|
25
25
|
"Properties": {
|
|
26
26
|
"DeploymentId": {
|
|
27
|
-
"Ref": "
|
|
27
|
+
"Ref": "PassDeployment41d722f6"
|
|
28
28
|
},
|
|
29
29
|
"StageName": "hookshot",
|
|
30
30
|
"RestApiId": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"PassDeployment41d722f6": {
|
|
47
47
|
"Type": "AWS::ApiGateway::Deployment",
|
|
48
48
|
"DependsOn": "PassMethod",
|
|
49
49
|
"Properties": {
|