Skip to content

Commit 69822c1

Browse files
author
Shreya
authored
chore: merge pull request #1280 from awslabs/release/v1.17.0
2 parents 27b5934 + cf6313f commit 69822c1

File tree

10 files changed

+13
-1
lines changed

10 files changed

+13
-1
lines changed

examples/2016-10-31/cloudwatch-event-to-msteams/template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Resources:
4545
Type: CloudWatchEvent
4646
Description: Detects EC2 Security Group Events to Send to Teams
4747
Properties:
48+
EventBusName: event-bus-name
4849
Pattern:
4950
source:
5051
- "aws.ec2"

samtranslator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.16.0'
1+
__version__ = '1.17.0'

samtranslator/model/events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class EventsRule(Resource):
77
resource_type = 'AWS::Events::Rule'
88
property_types = {
99
'Description': PropertyType(False, is_str()),
10+
'EventBusName': PropertyType(False, is_str()),
1011
'EventPattern': PropertyType(False, is_type(dict)),
1112
'Name': PropertyType(False, is_str()),
1213
'RoleArn': PropertyType(False, is_str()),

samtranslator/model/eventsources/push.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class CloudWatchEvent(PushEventSource):
143143
resource_type = 'CloudWatchEvent'
144144
principal = 'events.amazonaws.com'
145145
property_types = {
146+
'EventBusName': PropertyType(False, is_str()),
146147
'Pattern': PropertyType(False, is_type(dict)),
147148
'Input': PropertyType(False, is_str()),
148149
'InputPath': PropertyType(False, is_str())
@@ -164,6 +165,7 @@ def to_cloudformation(self, **kwargs):
164165
resources = []
165166

166167
events_rule = EventsRule(self.logical_id)
168+
events_rule.EventBusName = self.EventBusName
167169
events_rule.EventPattern = self.Pattern
168170
events_rule.Targets = [self._construct_target(function)]
169171
if CONDITION in function.resource_attributes:

samtranslator/validator/sam_schema/schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@
336336
"AWS::Serverless::Function.CloudWatchEventEvent": {
337337
"additionalProperties": false,
338338
"properties": {
339+
"EventBusName": {
340+
"type": "string"
341+
},
339342
"Input": {
340343
"type": "string"
341344
},

tests/translator/input/cloudwatchevent.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Resources:
2020
OnTerminate:
2121
Type: CloudWatchEvent
2222
Properties:
23+
EventBusName: ExternalEventBridge
2324
Pattern:
2425
detail:
2526
state:

tests/translator/output/aws-cn/cloudwatchevent.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
]
9191
}
9292
},
93+
"EventBusName": "ExternalEventBridge",
9394
"Targets": [
9495
{
9596
"Id": "TriggeredFunctionOnTerminateLambdaTarget",

tests/translator/output/aws-us-gov/cloudwatchevent.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
]
9191
}
9292
},
93+
"EventBusName": "ExternalEventBridge",
9394
"Targets": [
9495
{
9596
"Id": "TriggeredFunctionOnTerminateLambdaTarget",

tests/translator/output/cloudwatchevent.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
]
9191
}
9292
},
93+
"EventBusName": "ExternalEventBridge",
9394
"Targets": [
9495
{
9596
"Id": "TriggeredFunctionOnTerminateLambdaTarget",

versions/2016-10-31.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ The object describing an event source with type `CloudWatchEvent`.
627627
Property Name | Type | Description
628628
---|:---:|---
629629
Pattern | [Event Pattern Object](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html) | **Required.** Pattern describing which CloudWatch events trigger the function. Only matching events trigger the function.
630+
EventBusName | `string` | The event bus to associate with this rule. If you omit this, the default event bus is used.
630631
Input | `string` | JSON-formatted string to pass to the function as the event body. This value overrides the matched event.
631632
InputPath | `string` | JSONPath describing the part of the event to pass to the function.
632633

0 commit comments

Comments
 (0)