Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## 3.0.3

### Fixed

- `EventbridgeClient.putEvents`: send the entry `Time` as a `Date` rather than an
ISO string. Under AWS SDK v3, `PutEventsCommand` rejects a string timestamp
with `SerializationException: STRING_VALUE can not be converted to milliseconds
since epoch`, so any event carrying a `time` failed since the v3 upgrade.

## 3.0.0

### Changed
Expand Down
3 changes: 2 additions & 1 deletion lib/clients/eventbridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const formatEventInput = (eventBusName) =>
filter(reject(isNil)),
evolve({
detail: toJson,
time: compose(toIso, fromIsoUtc)
// SDK v3 PutEvents needs a real Date; an ISO string throws SerializationException.
time: compose((iso) => new Date(iso), toIso, fromIsoUtc)
}),
keysToPascalCase
)
Expand Down
2 changes: 1 addition & 1 deletion lib/clients/eventbridge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const eventInput = [
]

const eventEntry = {
Time: '2020-01-01T00:00:00.000Z',
Time: new Date('2020-01-01T00:00:00.000Z'),
Source: 'mock-source',
Resources: ['mock-resource'],
DetailType: 'mock-detail-type',
Expand Down