@mapbox/cloudfriend 7.2.0-2 → 7.2.0-3

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.
Files changed (27) hide show
  1. package/.nyc_output/11f7164b-7ffe-482b-97df-1421dd64f11d.json +1 -0
  2. package/.nyc_output/1fd23852-2043-434f-bb39-a9052f67b4a6.json +1 -0
  3. package/.nyc_output/processinfo/11f7164b-7ffe-482b-97df-1421dd64f11d.json +1 -0
  4. package/.nyc_output/processinfo/1fd23852-2043-434f-bb39-a9052f67b4a6.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -1
  6. package/lib/shortcuts/api.md +0 -33
  7. package/lib/shortcuts/event-lambda.js +0 -34
  8. package/lib/shortcuts/scheduled-lambda.js +1 -1
  9. package/package.json +1 -1
  10. package/test/fixtures/shortcuts/event-lambda-defaults.json +0 -1
  11. package/test/fixtures/shortcuts/event-lambda-full.json +0 -1
  12. package/test/fixtures/shortcuts/hookshot-github-secret-ref.json +2 -2
  13. package/test/fixtures/shortcuts/hookshot-github-secret-string.json +2 -2
  14. package/test/fixtures/shortcuts/hookshot-github.json +2 -2
  15. package/test/fixtures/shortcuts/hookshot-passthrough-access-log-format.json +2 -2
  16. package/test/fixtures/shortcuts/hookshot-passthrough-alarms.json +2 -2
  17. package/test/fixtures/shortcuts/hookshot-passthrough-enhanced-logging.json +2 -2
  18. package/test/fixtures/shortcuts/hookshot-passthrough-full-blown-logging.json +2 -2
  19. package/test/fixtures/shortcuts/hookshot-passthrough-logging.json +2 -2
  20. package/test/fixtures/shortcuts/hookshot-passthrough.json +2 -2
  21. package/test/fixtures/shortcuts/scheduled-lambda-defaults.json +1 -1
  22. package/test/fixtures/shortcuts/scheduled-lambda-full.json +1 -1
  23. package/test/shortcuts.test.js +1 -25
  24. package/.nyc_output/881a67e7-f7cd-472c-8f14-42b00abcec0b.json +0 -1
  25. package/.nyc_output/b6a6ce03-918d-4ce9-be37-e15395e32aa7.json +0 -1
  26. package/.nyc_output/processinfo/881a67e7-f7cd-472c-8f14-42b00abcec0b.json +0 -1
  27. package/.nyc_output/processinfo/b6a6ce03-918d-4ce9-be37-e15395e32aa7.json +0 -1
@@ -10,7 +10,6 @@ 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).
14
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).
15
14
  *
16
15
  * @example
@@ -34,37 +33,6 @@ const Lambda = require('./lambda');
34
33
  * });
35
34
  *
36
35
  * 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);
68
36
  */
69
37
  class EventLambda extends Lambda {
70
38
  constructor(options) {
@@ -73,7 +41,6 @@ class EventLambda extends Lambda {
73
41
 
74
42
  const {
75
43
  EventPattern,
76
- EventBusName = 'default',
77
44
  State = 'ENABLED'
78
45
  } = options;
79
46
 
@@ -93,7 +60,6 @@ class EventLambda extends Lambda {
93
60
  ]
94
61
  },
95
62
  State,
96
- EventBusName,
97
63
  EventPattern,
98
64
  Targets: [
99
65
  {
@@ -57,7 +57,7 @@ class ScheduledLambda extends Lambda {
57
57
  FlexibleTimeWindow: {
58
58
  Mode: 'OFF'
59
59
  },
60
- Targets: [
60
+ Target: [
61
61
  {
62
62
  Id: this.FunctionName,
63
63
  Arn: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/cloudfriend",
3
- "version": "7.2.0-2",
3
+ "version": "7.2.0-3",
4
4
  "description": "Helper functions for assembling CloudFormation templates in JavaScript",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -145,7 +145,6 @@
145
145
  ]
146
146
  },
147
147
  "State": "ENABLED",
148
- "EventBusName": "default",
149
148
  "EventPattern": {
150
149
  "source": [
151
150
  "aws.ec2"
@@ -145,7 +145,6 @@
145
145
  ]
146
146
  },
147
147
  "State": "DISABLED",
148
- "EventBusName": "default",
149
148
  "EventPattern": {
150
149
  "source": [
151
150
  "aws.ec2"
@@ -28,7 +28,7 @@
28
28
  "Type": "AWS::ApiGateway::Stage",
29
29
  "Properties": {
30
30
  "DeploymentId": {
31
- "Ref": "PassDeployment9a222625"
31
+ "Ref": "PassDeployment01229d54"
32
32
  },
33
33
  "StageName": "hookshot",
34
34
  "RestApiId": {
@@ -47,7 +47,7 @@
47
47
  ]
48
48
  }
49
49
  },
50
- "PassDeployment9a222625": {
50
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -52,7 +52,7 @@
52
52
  }
53
53
  }
54
54
  },
55
- "PassDeployment9a222625": {
55
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
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": "PassDeployment9a222625"
27
+ "Ref": "PassDeployment01229d54"
28
28
  },
29
29
  "StageName": "hookshot",
30
30
  "RestApiId": {
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  }
45
45
  },
46
- "PassDeployment9a222625": {
46
+ "PassDeployment01229d54": {
47
47
  "Type": "AWS::ApiGateway::Deployment",
48
48
  "DependsOn": "PassMethod",
49
49
  "Properties": {
@@ -149,7 +149,7 @@
149
149
  "FlexibleTimeWindow": {
150
150
  "Mode": "OFF"
151
151
  },
152
- "Targets": [
152
+ "Target": [
153
153
  {
154
154
  "Id": {
155
155
  "Fn::Sub": "${AWS::StackName}-MyLambda"
@@ -149,7 +149,7 @@
149
149
  "FlexibleTimeWindow": {
150
150
  "Mode": "OFF"
151
151
  },
152
- "Targets": [
152
+ "Target": [
153
153
  {
154
154
  "Id": {
155
155
  "Fn::Sub": "${AWS::StackName}-MyLambda"
@@ -345,6 +345,7 @@ test('[shortcuts] scheduled-lambda', (assert) => {
345
345
  fixtures.get('scheduled-lambda-full'),
346
346
  'expected resources generated without defaults'
347
347
  );
348
+
348
349
  assert.end();
349
350
  });
350
351
 
@@ -420,31 +421,6 @@ test('[shortcuts] event-lambda', (assert) => {
420
421
  'expected resources generated without defaults'
421
422
  );
422
423
 
423
- lambda = new cf.shortcuts.EventLambda({
424
- LogicalName: 'MyLambda',
425
- Code: {
426
- S3Bucket: 'my-code-bucket',
427
- S3Key: 'path/to/code.zip'
428
- },
429
- EventBusName: 'my-cool-eventbus',
430
- EventPattern: {
431
- source: ['aws.ec2'],
432
- 'detail-type': ['EC2 Instance State-change Notification'],
433
- detail: {
434
- state: ['running']
435
- }
436
- },
437
- State: 'DISABLED'
438
- });
439
-
440
- template = cf.merge(lambda);
441
- if (update) fixtures.update('event-lambda-custom-eventbus', template);
442
- assert.deepEqual(
443
- noUndefined(template),
444
- fixtures.get('event-lambda-custom-eventbus'),
445
- 'expected resources generated without defaults and a custom eventbus'
446
- );
447
-
448
424
  assert.end();
449
425
  });
450
426