├── 1-scalable-webhook ├── README.md ├── api.yaml ├── code │ └── consumer.js ├── event.json └── template.yaml ├── 2-responding-to-workflows ├── README.md ├── code │ └── consumer.js └── template.yaml ├── 3-cloudtrail-integration ├── README.md ├── code │ └── consumer.js └── template.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md └── images ├── 1-architecture.png ├── 2-outputs.png ├── 3-postman.png ├── 4-logs.png ├── 5-architecture2.png ├── 6-logs.png ├── 7-architecture3.png └── 7-logs.png /1-scalable-webhook/README.md: -------------------------------------------------------------------------------- 1 | # 1. Scalable webhook 2 | 3 | This example creates the following resources: 4 | 5 | ![Scalable webhook](../images/1-architecture.png) 6 | 7 | Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. 8 | 9 | In this folder: 10 | 11 | ```bash 12 | . 13 | ├── README.MD <-- This instructions file 14 | ├── code <-- AWS Lambda function code 15 | └── template.yaml <-- AWS SAM template 16 | ``` 17 | 18 | ## Requirements 19 | 20 | * AWS CLI already configured with Administrator permission 21 | * [AWS SAM CLI installed](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) 22 | * [NodeJS 12.x installed](https://nodejs.org/en/download/) 23 | 24 | ## Installation Instructions 25 | 26 | 1. [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and login. 27 | 28 | 2. Clone the main repo onto your local development machine using `git clone`. 29 | 30 | 3. From the command line: 31 | ``` 32 | cd ./1-scalable-webhook 33 | sam deploy --guided 34 | ``` 35 | Follow the prompts in the deploy process to set the stack name, AWS Region and other parameters. 36 | 37 | 4. Take a note of the API endpoint URL from the outputs: 38 | 39 | ![API endpoint](../images/2-outputs.png) 40 | 41 | 5. Using [Postman](https://www.postman.com/downloads/), send a POST request to the endpoint with a JSON payload as follows: 42 | 43 | ![Postman](../images/3-postman.png) 44 | 45 | 6. In the [AWS Lambda console](https://console.aws.amazon.com/lambda), open the deployed Lambda function matching the outputs. 46 | 47 | 7. Open the *Monitoring* tab and choose *View logs in CloudWatch*. The latest log stream shows the payload submitted to the API endpoint. 48 | 49 | ![Logs](../images/4-logs.png) 50 | 51 | ## How it works 52 | 53 | This pattern shows how to durably persist messages sent via an HTTP APIs webhook to an SQS via EventBridge, using a direct service integration. 54 | 55 | 1. AWS SAM deploys all the resources shows in the above architecture. 56 | 1. When you make the POST request to the HTTP API endpoint, the JSON payload is mapped to the Detail attribute in an event sent to EventBridge. 57 | 1. EventBridge sends the event to the SQS queue. 58 | 1. The consuming Lambda function receive this message from SQS and logs out the message. 59 | 60 | ============================================== 61 | 62 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 63 | 64 | SPDX-License-Identifier: MIT-0 -------------------------------------------------------------------------------- /1-scalable-webhook/api.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.1" 2 | info: 3 | title: "HTTP API to EventBridge integration" 4 | paths: 5 | /webhook: 6 | post: 7 | responses: 8 | default: 9 | description: "EventBridge response" 10 | x-amazon-apigateway-integration: 11 | integrationSubtype: "EventBridge-PutEvents" 12 | credentials: 13 | Fn::GetAtt: [MyHttpApiRole, Arn] 14 | requestParameters: 15 | Detail: "$request.body.Detail" 16 | DetailType: MyDetailType 17 | Source: myWebhook 18 | payloadFormatVersion: "1.0" 19 | type: "aws_proxy" 20 | connectionType: "INTERNET" 21 | 22 | x-amazon-apigateway-importexport-version: "1.0" -------------------------------------------------------------------------------- /1-scalable-webhook/code/consumer.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 9 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 10 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 11 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 12 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 13 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | */ 15 | 16 | 'use strict' 17 | 18 | // The Lambda handler 19 | exports.handler = async (event) => { 20 | console.log(JSON.stringify(event, 2, null)) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /1-scalable-webhook/event.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Sid": "Test", 6 | "Effect": "Allow", 7 | "Action": [ 8 | "schemas:*" 9 | ], 10 | "Principal": { 11 | "AWS": [ 12 | "109876543210" 13 | ] 14 | }, 15 | "Resource": [ 16 | "arn:aws:schemas:us-east-1:012345678901:registry/default", 17 | "arn:aws:schemas:us-east-1:012345678901:schema/default*" 18 | ] 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /1-scalable-webhook/template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: HTTP API webhook to SQS queue via EventBridge. 4 | 5 | Resources: 6 | MySqsQueue: 7 | Type: AWS::SQS::Queue 8 | 9 | QueueConsumerFunction: 10 | Type: AWS::Serverless::Function 11 | Properties: 12 | CodeUri: code/ 13 | Handler: consumer.handler 14 | Runtime: nodejs12.x 15 | Timeout: 3 16 | MemorySize: 128 17 | # Enable this line to have the Lambda function 18 | # run one event as a time: 19 | # ReservedConcurrentExecutions: 1 20 | Policies: 21 | - SQSPollerPolicy: 22 | QueueName: !GetAtt MySqsQueue.QueueName 23 | Events: 24 | MySQSEvent: 25 | Type: SQS 26 | Properties: 27 | Queue: !GetAtt MySqsQueue.Arn 28 | BatchSize: 10 29 | 30 | MyHttpApi: 31 | Type: AWS::Serverless::HttpApi 32 | Properties: 33 | DefinitionBody: 34 | 'Fn::Transform': 35 | Name: 'AWS::Include' 36 | Parameters: 37 | Location: './api.yaml' 38 | 39 | MyHttpApiRole: 40 | Type: "AWS::IAM::Role" 41 | Properties: 42 | AssumeRolePolicyDocument: 43 | Version: "2012-10-17" 44 | Statement: 45 | - Effect: "Allow" 46 | Principal: 47 | Service: "apigateway.amazonaws.com" 48 | Action: 49 | - "sts:AssumeRole" 50 | Policies: 51 | - PolicyName: ApiDirectWriteEventBridge 52 | PolicyDocument: 53 | Version: '2012-10-17' 54 | Statement: 55 | Action: 56 | - events:PutEvents 57 | Effect: Allow 58 | Resource: 59 | - !Sub arn:aws:events:${AWS::Region}:${AWS::AccountId}:event-bus/default 60 | 61 | EventRule: 62 | Type: AWS::Events::Rule 63 | Properties: 64 | Description: "Send webhook events to SQS queue." 65 | EventPattern: 66 | account: 67 | - !Sub '${AWS::AccountId}' 68 | source: 69 | - "myWebhook" 70 | Targets: 71 | - Arn: !GetAtt MySqsQueue.Arn 72 | Id: "SQSqueue" 73 | 74 | EventBridgeToToSqsPolicy: 75 | Type: AWS::SQS::QueuePolicy 76 | Properties: 77 | PolicyDocument: 78 | Statement: 79 | - Effect: Allow 80 | Principal: 81 | Service: events.amazonaws.com 82 | Action: SQS:SendMessage 83 | Resource: !GetAtt MySqsQueue.Arn 84 | Queues: 85 | - Ref: MySqsQueue 86 | 87 | Outputs: 88 | ApiEndpoint: 89 | Description: "HTTP API endpoint URL" 90 | Value: !Sub "https://${MyHttpApi}.execute-api.${AWS::Region}.amazonaws.com/webhook" 91 | 92 | QueueConsumerFunction: 93 | Description: QueueConsumerFunction function name 94 | Value: !Ref QueueConsumerFunction 95 | -------------------------------------------------------------------------------- /2-responding-to-workflows/README.md: -------------------------------------------------------------------------------- 1 | # 2. Responding to AWS Step Functions workflows 2 | 3 | This example creates the following resources: 4 | 5 | ![Workflow events](../images/5-architecture2.png) 6 | 7 | Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. 8 | 9 | In this folder: 10 | 11 | ```bash 12 | . 13 | ├── README.MD <-- This instructions file 14 | ├── code <-- AWS Lambda function code 15 | └── template.yaml <-- AWS SAM template 16 | ``` 17 | 18 | ## Requirements 19 | 20 | * AWS CLI already configured with Administrator permission 21 | * [AWS SAM CLI installed](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) 22 | * [NodeJS 12.x installed](https://nodejs.org/en/download/) 23 | 24 | ## Installation Instructions 25 | 26 | 1. [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and login. 27 | 28 | 2. You need an existing Step Functions workflow for testing. If you don't have one, go to the [Step Functions console](https://console.aws.amazon.com/states/home) and choose *Create state machine*. Deploy any one of the samples for testing. 29 | 30 | 3. Clone the main repo onto your local development machine using `git clone`. 31 | 32 | 4. From the command line: 33 | ``` 34 | cd ./2-responding-to-workflows 35 | sam deploy --guided 36 | ``` 37 | Follow the prompts in the deploy process to set the stack name, AWS Region and other parameters. 38 | 39 | 5. Run the existing state machine. 40 | 41 | 6. In the [AWS Lambda console](https://console.aws.amazon.com/lambda), open the deployed Lambda function matching the outputs. 42 | 43 | 7. Open the *Monitoring* tab and choose *View logs in CloudWatch*. The latest log stream shows the payload submitted to the API endpoint. 44 | 45 | ![Logs](../images/6-logs.png) 46 | 47 | ## How it works 48 | 49 | This pattern shows how to receive and respond to events emitted from Step Functions state machines. These are automatically published to EventBridge without any additional changes required. 50 | 51 | 1. AWS SAM deploys all the resources shows in the above architecture. 52 | 1. You run a Step Functions state machine execution. 53 | 1. The events are captured by EventBridge and routed to the sample Lambda function. 54 | 55 | ============================================== 56 | 57 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 58 | 59 | SPDX-License-Identifier: MIT-0 -------------------------------------------------------------------------------- /2-responding-to-workflows/code/consumer.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 9 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 10 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 11 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 12 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 13 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | */ 15 | 16 | 'use strict' 17 | 18 | // The Lambda handler 19 | exports.handler = async (event) => { 20 | console.log(JSON.stringify(event, 2, null)) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /2-responding-to-workflows/template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: Sending events from a Step Functions workflow to EventBridge 4 | 5 | Resources: 6 | ConsumerFunction: 7 | Type: AWS::Serverless::Function 8 | Properties: 9 | CodeUri: code/ 10 | Handler: consumer.handler 11 | Runtime: nodejs12.x 12 | Timeout: 3 13 | MemorySize: 128 14 | 15 | EventRule: 16 | Type: AWS::Events::Rule 17 | Properties: 18 | Description: "Send Step Functions transitions to EventBridge." 19 | EventPattern: 20 | source: 21 | - "aws.states" 22 | Targets: 23 | - Arn: !GetAtt ConsumerFunction.Arn 24 | Id: "ConsumerFunction" 25 | 26 | PermissionForEventsToInvokeLambda: 27 | Type: AWS::Lambda::Permission 28 | Properties: 29 | FunctionName: 30 | Ref: "ConsumerFunction" 31 | Action: "lambda:InvokeFunction" 32 | Principal: "events.amazonaws.com" 33 | SourceArn: 34 | Fn::GetAtt: 35 | - "EventRule" 36 | - "Arn" 37 | Outputs: 38 | ConsumerFunction: 39 | Description: ConsumerFunction function name 40 | Value: !Ref ConsumerFunction -------------------------------------------------------------------------------- /3-cloudtrail-integration/README.md: -------------------------------------------------------------------------------- 1 | # 3. Integrating EventBridge with AWS CloudTrail 2 | 3 | This example creates the following resources: 4 | 5 | ![CloudTrail integration](../images/7-architecture3.png) 6 | 7 | Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. 8 | 9 | In this folder: 10 | 11 | ```bash 12 | . 13 | ├── README.MD <-- This instructions file 14 | ├── code <-- AWS Lambda function code 15 | └── template.yaml <-- AWS SAM template 16 | ``` 17 | 18 | ## Requirements 19 | 20 | * AWS CLI already configured with Administrator permission 21 | * [AWS SAM CLI installed](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) 22 | * [NodeJS 12.x installed](https://nodejs.org/en/download/) 23 | 24 | ## Installation Instructions 25 | 26 | 1. [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and login. 27 | 28 | 2. Clone the main repo onto your local development machine using `git clone`. 29 | 30 | 3. From the command line: 31 | ``` 32 | cd ./3-cloudtrail-integration 33 | sam deploy --guided 34 | ``` 35 | Follow the prompts in the deploy process to set the stack name, AWS Region and other parameters. Enter names for the source S3 bucket and logging bucket. 36 | 37 | 4. Upload a new object to the source S3 bucket. 38 | 39 | 5. In the [AWS Lambda console](https://console.aws.amazon.com/lambda), open the deployed Lambda function matching the outputs. 40 | 41 | 6. Open the *Monitoring* tab and choose *View logs in CloudWatch*. The latest log stream shows the payload submitted to the API endpoint. 42 | 43 | ![Logs](../images/8-logs.png) 44 | 45 | ## How it works 46 | 47 | This pattern shows how to configure CloudTrail and EventBridge integration, using S3 as an example service for creating events. 48 | 49 | 1. AWS SAM deploys all the resources shows in the above architecture. 50 | 2. You upload an object to the source S3 bucket. 51 | 3. The event is captured by CloudTrail and routed to EventBridge, which then triggers the Lambda function. 52 | 53 | ============================================== 54 | 55 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 56 | 57 | SPDX-License-Identifier: MIT-0 -------------------------------------------------------------------------------- /3-cloudtrail-integration/code/consumer.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 9 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 10 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 11 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 12 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 13 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | */ 15 | 16 | 'use strict' 17 | 18 | // The Lambda handler 19 | exports.handler = async (event) => { 20 | console.log(JSON.stringify(event, 2, null)) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /3-cloudtrail-integration/template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: Capturing S3 events via AWS CloudTrail 4 | 5 | Parameters: 6 | SourceBucketName: 7 | Type: String 8 | Default: 'my-example-src-bucket' 9 | LoggingBucketName: 10 | Type: String 11 | Default: 'my-example-src-bucket-logs' 12 | 13 | Resources: 14 | # S3 Bucket - A source bucket and a logging bucket 15 | SourceBucket: 16 | Type: AWS::S3::Bucket 17 | Properties: 18 | BucketName: !Ref SourceBucketName 19 | 20 | LoggingBucket: 21 | Type: AWS::S3::Bucket 22 | Properties: 23 | BucketName: !Ref LoggingBucketName 24 | 25 | 26 | # Enforce HTTPS only access to S3 bucket # 27 | BucketPolicy: 28 | Type: AWS::S3::BucketPolicy 29 | Properties: 30 | Bucket: !Ref SourceBucket 31 | PolicyDocument: 32 | Statement: 33 | - Action: s3:* 34 | Effect: Deny 35 | Principal: "*" 36 | Resource: 37 | - !Sub "arn:aws:s3:::${SourceBucket}/*" 38 | - !Sub "arn:aws:s3:::${SourceBucket}" 39 | Condition: 40 | Bool: 41 | aws:SecureTransport: false 42 | 43 | # Bucket policy enables CloudTrail to write to the logging bucket 44 | BucketPolicy: 45 | Type: AWS::S3::BucketPolicy 46 | Properties: 47 | Bucket: 48 | Ref: LoggingBucket 49 | PolicyDocument: 50 | Version: "2012-10-17" 51 | Statement: 52 | - 53 | Sid: "AWSCloudTrailAclCheck" 54 | Effect: "Allow" 55 | Principal: 56 | Service: "cloudtrail.amazonaws.com" 57 | Action: "s3:GetBucketAcl" 58 | Resource: 59 | !Sub |- 60 | arn:aws:s3:::${LoggingBucket} 61 | - 62 | Sid: "AWSCloudTrailWrite" 63 | Effect: "Allow" 64 | Principal: 65 | Service: "cloudtrail.amazonaws.com" 66 | Action: "s3:PutObject" 67 | Resource: 68 | !Sub |- 69 | arn:aws:s3:::${LoggingBucket}/AWSLogs/${AWS::AccountId}/* 70 | Condition: 71 | StringEquals: 72 | s3:x-amz-acl: "bucket-owner-full-control" 73 | - Action: s3:* 74 | Effect: Deny 75 | Principal: "*" 76 | Resource: 77 | - !Sub "arn:aws:s3:::${LoggingBucket}/*" 78 | - !Sub "arn:aws:s3:::${LoggingBucket}" 79 | Condition: 80 | Bool: 81 | aws:SecureTransport: false 82 | 83 | # The CloudTrail trail - uses the LoggingBucketName as the trail name 84 | myTrail: 85 | Type: AWS::CloudTrail::Trail 86 | DependsOn: 87 | - BucketPolicy 88 | Properties: 89 | TrailName: !Ref LoggingBucketName 90 | S3BucketName: 91 | Ref: LoggingBucket 92 | IsLogging: true 93 | IsMultiRegionTrail: false 94 | EventSelectors: 95 | - DataResources: 96 | - Type: AWS::S3::Object 97 | Values: 98 | - !Sub |- 99 | arn:aws:s3:::${SourceBucket}/ 100 | IncludeGlobalServiceEvents: false 101 | 102 | ### This section configures the consuming Lambda function ### 103 | 104 | # Lambda function 105 | EventConsumerFunction: 106 | Type: AWS::Serverless::Function 107 | Properties: 108 | CodeUri: code/ 109 | Handler: consumer.handler 110 | Runtime: nodejs12.x 111 | 112 | # EventBridge rule - invokes EventConsumerFunction 113 | EventRule: 114 | Type: AWS::Events::Rule 115 | Properties: 116 | Description: "EventRule" 117 | State: "ENABLED" 118 | EventPattern: 119 | source: 120 | - "aws.s3" 121 | detail: 122 | eventName: 123 | - "PutObject" 124 | requestParameters: 125 | bucketName: 126 | - !Ref SourceBucketName 127 | 128 | Targets: 129 | - 130 | Arn: 131 | Fn::GetAtt: 132 | - "EventConsumerFunction" 133 | - "Arn" 134 | Id: "EventConsumerFunctionTarget" 135 | 136 | PermissionForEventsToInvokeLambda: 137 | Type: AWS::Lambda::Permission 138 | Properties: 139 | FunctionName: 140 | Ref: "EventConsumerFunction" 141 | Action: "lambda:InvokeFunction" 142 | Principal: "events.amazonaws.com" 143 | SourceArn: 144 | Fn::GetAtt: 145 | - "EventRule" 146 | - "Arn" -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps 18 | * The version of our code being used 19 | * Any modifications you've made relevant to the bug 20 | * Anything unusual about your environment or deployment 21 | 22 | 23 | ## Contributing via Pull Requests 24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 25 | 26 | 1. You are working against the latest source on the *master* branch. 27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 29 | 30 | To send us a pull request, please: 31 | 32 | 1. Fork the repository. 33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 34 | 3. Ensure local tests pass. 35 | 4. Commit to your fork using clear commit messages. 36 | 5. Send us a pull request, answering any default questions in the pull request interface. 37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 38 | 39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | 43 | ## Finding contributions to work on 44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. 45 | 46 | 47 | ## Code of Conduct 48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 50 | opensource-codeofconduct@amazon.com with any additional questions or comments. 51 | 52 | 53 | ## Security issue notifications 54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 55 | 56 | 57 | ## Licensing 58 | 59 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 60 | 61 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SVS402 - Decoupling serverless workloads with Amazon EventBridge 2 | 3 | The applications in this repo are examples from the AWS re:Invent 2020 session "SVS402 - Decoupling serverless workloads with Amazon EventBridge", presented by Developer Advocate, [James Beswick](https://www.twitter.com/jbesw). Each example has its own README.md file for additional instructions. 4 | 5 | Important: these applications use various AWS services and there are costs associated with these services after the Free Tier usage. Please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in these examples. 6 | 7 | Watch the replay of SVS402 on YouTube: https://www.youtube.com/watch?v=VI79XQW4dIM&feature=emb_logo. 8 | 9 | ============================================== 10 | 11 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 12 | 13 | SPDX-License-Identifier: MIT-0 14 | -------------------------------------------------------------------------------- /images/1-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/1-architecture.png -------------------------------------------------------------------------------- /images/2-outputs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/2-outputs.png -------------------------------------------------------------------------------- /images/3-postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/3-postman.png -------------------------------------------------------------------------------- /images/4-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/4-logs.png -------------------------------------------------------------------------------- /images/5-architecture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/5-architecture2.png -------------------------------------------------------------------------------- /images/6-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/6-logs.png -------------------------------------------------------------------------------- /images/7-architecture3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/7-architecture3.png -------------------------------------------------------------------------------- /images/7-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/decoupling-with-amazon-eventbridge/ce80d69698aa22caa3b4d23ce6458dc2d2f2befe/images/7-logs.png --------------------------------------------------------------------------------