Skip to content

Commit

Permalink
Merge pull request #13 from c4e/feature/enhance-statementId
Browse files Browse the repository at this point in the history
Feature/enhance statement
  • Loading branch information
c4e authored Jun 26, 2020
2 parents 869eb1a + 53fe636 commit f340f6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ class ServerlessPlugin {

compileReceiver() {
const { organizationId, statementId } = this.eventBridgeCrossOrganization.receiveEvents;

const alphaNumericStatementId = statementId.replace(/[^a-z0-9+]+/gi, '');

const template = {
"EventBusPolicyCrossOrganization": {
"Type": "AWS::Events::EventBusPolicy",
"Properties": {
"Action": "events:PutEvents",
"Principal": "*",
"EventBusName": "default",
"StatementId": statementId,
"StatementId": alphaNumericStatementId,
"Condition": {
"Type": "StringEquals",
"Key": "aws:PrincipalOrgID",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-events-cross-organization",
"version": "v1.0.7-beta",
"version": "v1.0.8-beta",
"description": "Add roles, rules, policies to send and receive events cross organization",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit f340f6c

Please sign in to comment.