├── .github └── PULL_REQUEST_TEMPLATE.md ├── CDCCloudformation.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── consumekinesis.zip ├── consumekinesis ├── .classpath ├── .project ├── .settings │ ├── com.amazonaws.eclipse.lambda.project.json │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── README.html ├── pom.xml ├── src │ └── main │ │ └── java │ │ └── com │ │ └── amazonaws │ │ └── lambda │ │ └── demo │ │ └── LambdaFunctionHandler.java └── target │ ├── classes │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ │ └── com.amazonaws.lambda │ │ │ └── demo │ │ │ ├── pom.properties │ │ │ └── pom.xml │ └── com │ │ └── amazonaws │ │ └── lambda │ │ └── demo │ │ └── LambdaFunctionHandler.class │ └── test-classes │ ├── com │ └── amazonaws │ │ └── lambda │ │ └── demo │ │ ├── LambdaFunctionHandlerTest.class │ │ ├── TestContext$TestLogger.class │ │ ├── TestContext.class │ │ ├── TestUtils$DateTimeDeserializer.class │ │ ├── TestUtils$DateTimeSerializer.class │ │ ├── TestUtils$DynamodbEventMixin$AttributeValueMixIn.class │ │ ├── TestUtils$DynamodbEventMixin$RecordMixin.class │ │ ├── TestUtils$DynamodbEventMixin$StreamRecordMixin.class │ │ ├── TestUtils$DynamodbEventMixin.class │ │ ├── TestUtils$TestJacksonMapperModule.class │ │ ├── TestUtils$UpperCaseRecordsPropertyNamingStrategy.class │ │ └── TestUtils.class │ └── kinesis-event.json ├── s32kinesis.zip └── s32kinesis ├── .classpath ├── .project ├── .settings ├── com.amazonaws.eclipse.lambda.project.json ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs └── org.eclipse.m2e.core.prefs ├── README.html ├── pom.xml ├── src └── main │ └── java │ └── com │ └── amazonaws │ └── lambda │ └── demo │ └── LambdaFunctionHandler.java └── target ├── classes ├── META-INF │ ├── MANIFEST.MF │ └── maven │ │ └── com.amazonaws.lambda │ │ └── demo │ │ ├── pom.properties │ │ └── pom.xml └── com │ └── amazonaws │ └── lambda │ └── demo │ └── LambdaFunctionHandler.class └── test-classes ├── com └── amazonaws │ └── lambda │ └── demo │ ├── LambdaFunctionHandlerTest.class │ ├── TestContext$TestLogger.class │ ├── TestContext.class │ ├── TestUtils$DateTimeDeserializer.class │ ├── TestUtils$DateTimeSerializer.class │ ├── TestUtils$DynamodbEventMixin$AttributeValueMixIn.class │ ├── TestUtils$DynamodbEventMixin$RecordMixin.class │ ├── TestUtils$DynamodbEventMixin$StreamRecordMixin.class │ ├── TestUtils$DynamodbEventMixin.class │ ├── TestUtils$TestJacksonMapperModule.class │ ├── TestUtils$UpperCaseRecordsPropertyNamingStrategy.class │ └── TestUtils.class └── s3-event.put.json /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Issue #, if available:* 2 | 3 | *Description of changes:* 4 | 5 | 6 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 7 | -------------------------------------------------------------------------------- /CDCCloudformation.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | Description: 'AWS CloudFormation to set up CDC with DMS, Lambda and Kinesis' 3 | Parameters: 4 | DatabaseInstanceType: 5 | Default: db.r3.8xlarge 6 | AllowedValues: 7 | - db.m4.2xlarge 8 | - db.r3.4xlarge 9 | - db.r3.8xlarge 10 | Description: The instance type to use for this test iteration. 11 | Type: String 12 | TargetS3BucketName: 13 | Description: The S3 bucket name for DMS target 14 | Type: String 15 | LambdaRuntime: 16 | Description: The Lambda runtime to use 17 | Type: String 18 | Default: java8 19 | HandlerName: 20 | Description: The name of the lambda handler 21 | Type: String 22 | Default: com.amazonaws.lambda.demo.LambdaFunctionHandler 23 | CodeS3Bucket: 24 | Description: The name of the bucket that contains your Lambda ZIP code 25 | Type: String 26 | S3Keys32kinesis: 27 | Description: The name of the first Lambda ZIP package 28 | Type: String 29 | Default: s32kinesis.zip 30 | MasterUserPassword: 31 | NoEcho: true 32 | Description: The master password for the DB instance. 33 | Type: String 34 | S3Keyconsumekinesis: 35 | Description: The name of the second Lambda ZIP package 36 | Type: String 37 | Default: consumekinesis.zip 38 | ReplicationInstance: 39 | Default: dms.c4.large 40 | AllowedValues: 41 | - dms.t2.micro 42 | - dms.t2.small 43 | - dms.t2.medium 44 | - dms.t2.large 45 | - dms.c4.large 46 | - dms.c4.xlarge 47 | - dms.c4.2xlarge 48 | - dms.c4.4xlarge 49 | Description: The instance type to use for the replication instance. 50 | Type: String 51 | Resources: 52 | SQLDatabase: 53 | Type: 'AWS::RDS::DBInstance' 54 | Properties: 55 | AutoMinorVersionUpgrade: false 56 | BackupRetentionPeriod: 1 57 | CharacterSetName: String 58 | DBInstanceClass: !Ref DatabaseInstanceType 59 | MasterUserPassword: !Ref MasterUserPassword 60 | DBSnapshotIdentifier: 'arn:aws:rds:us-east-1:638426169984:snapshot:sqlcustomer-snapshot-may28' 61 | DBSubnetGroupName: default 62 | s32kinesis: 63 | Type: 'AWS::Lambda::Function' 64 | Properties: 65 | Code: 66 | S3Bucket: !Ref CodeS3Bucket 67 | S3Key: !Ref S3Keys32kinesis 68 | Handler: !Ref HandlerName 69 | FunctionName: s32kinesis 70 | Role: !GetAtt 71 | - LambdaExecutionRole 72 | - Arn 73 | Runtime: !Ref LambdaRuntime 74 | Timeout: '300' 75 | MemorySize: '1024' 76 | Environment: 77 | Variables: 78 | KinesisStream: testkinesisstream 79 | consumekinesis: 80 | Type: 'AWS::Lambda::Function' 81 | Properties: 82 | Handler: !Ref HandlerName 83 | FunctionName: consumekinesis 84 | Role: !GetAtt 85 | - LambdaExecutionRole 86 | - Arn 87 | Code: 88 | S3Bucket: !Ref CodeS3Bucket 89 | S3Key: !Ref S3Keyconsumekinesis 90 | Runtime: !Ref LambdaRuntime 91 | Timeout: '300' 92 | MemorySize: '1024' 93 | LambdaExecutionRole: 94 | Type: 'AWS::IAM::Role' 95 | Properties: 96 | AssumeRolePolicyDocument: 97 | Version: 2012-10-17 98 | Statement: 99 | - Effect: Allow 100 | Principal: 101 | Service: 102 | - lambda.amazonaws.com 103 | Action: 104 | - 'sts:AssumeRole' 105 | Path: / 106 | Policies: 107 | - PolicyName: root 108 | PolicyDocument: 109 | Version: 2012-10-17 110 | Statement: 111 | - Effect: Allow 112 | Action: 113 | - 'logs:CreateLogGroup' 114 | - 'logs:CreateLogStream' 115 | - 'logs:PutLogEvents' 116 | Resource: 'arn:aws:logs:*:*:*' 117 | - Effect: Allow 118 | Action: 119 | - 's3:GetObject' 120 | - 's3:PutObject' 121 | Resource: !Join 122 | - '' 123 | - - 'arn:aws:s3:::' 124 | - !Ref TargetS3BucketName 125 | - Effect: Allow 126 | Action: 'kinesis:*' 127 | Resource: !GetAtt 128 | - testkinesisstream 129 | - Arn 130 | testkinesisstream: 131 | Type: 'AWS::Kinesis::Stream' 132 | Properties: 133 | Name: testkinesisstream 134 | ShardCount: 1 135 | testkinesisstreamEventSource: 136 | Type: 'AWS::Lambda::EventSourceMapping' 137 | Properties: 138 | FunctionName: !Ref consumekinesis 139 | Enabled: true 140 | EventSourceArn: !GetAtt 141 | - testkinesisstream 142 | - Arn 143 | StartingPosition: LATEST 144 | LambdaInvokePermission: 145 | Type: 'AWS::Lambda::Permission' 146 | DependsOn: 147 | - s32kinesis 148 | Properties: 149 | Action: 'lambda:InvokeFunction' 150 | FunctionName: !GetAtt 151 | - s32kinesis 152 | - Arn 153 | Principal: s3.amazonaws.com 154 | SourceArn: !Join 155 | - '' 156 | - - 'arn:aws:s3:::' 157 | - !Ref TargetS3BucketName 158 | s3buketaskinesis: 159 | Type: 'AWS::S3::Bucket' 160 | DependsOn: 161 | - s32kinesis 162 | - LambdaInvokePermission 163 | Properties: 164 | AccessControl: BucketOwnerFullControl 165 | BucketName: !Ref TargetS3BucketName 166 | NotificationConfiguration: 167 | LambdaConfigurations: 168 | - Function: !GetAtt 169 | - s32kinesis 170 | - Arn 171 | Event: 's3:ObjectCreated:*' 172 | Filter: 173 | S3Key: 174 | Rules: 175 | - Name: prefix 176 | Value: dbo/CustomerInformation 177 | DMSReplicationInstance: 178 | Type: 'AWS::DMS::ReplicationInstance' 179 | Properties: 180 | AllocatedStorage: 100 181 | MultiAZ: false 182 | PubliclyAccessible: false 183 | ReplicationInstanceClass: !Ref ReplicationInstance 184 | DMSExecutionRole: 185 | Type: 'AWS::IAM::Role' 186 | Properties: 187 | AssumeRolePolicyDocument: 188 | Version: 2012-10-17 189 | Statement: 190 | - Effect: Allow 191 | Principal: 192 | Service: 193 | - dms.amazonaws.com 194 | Action: 195 | - 'sts:AssumeRole' 196 | Path: / 197 | Policies: 198 | - PolicyName: DMSservicerole 199 | PolicyDocument: 200 | Version: 2012-10-17 201 | Statement: 202 | - Effect: Allow 203 | Action: 's3:*' 204 | Resource: !Join 205 | - '' 206 | - - 'arn:aws:s3:::' 207 | - !Ref TargetS3BucketName 208 | DMSEndpoint: 209 | Type: 'AWS::DMS::Endpoint' 210 | Properties: 211 | EngineName: sqlserver 212 | EndpointType: source 213 | Username: AWSUser 214 | Password: !Ref MasterUserPassword 215 | ServerName: !Sub '${SQLDatabase.Endpoint.Address}' 216 | Port: 1433 217 | DatabaseName: CustomerDB 218 | DependsOn: 219 | - SQLDatabase 220 | DMSEndpointS3: 221 | Type: 'AWS::DMS::Endpoint' 222 | Properties: 223 | EndpointType: target 224 | EngineName: S3 225 | ExtraConnectionAttributes: 'maxfilesize=102400' 226 | S3Settings: 227 | BucketName: !Ref TargetS3BucketName 228 | ServiceAccessRoleArn: !GetAtt 229 | - DMSExecutionRole 230 | - Arn 231 | DependsOn: 232 | - s3buketaskinesis 233 | DMSTaskMigration: 234 | Type: 'AWS::DMS::ReplicationTask' 235 | Properties: 236 | MigrationType: full-load-and-cdc 237 | ReplicationInstanceArn: !Ref DMSReplicationInstance 238 | SourceEndpointArn: !Ref DMSEndpoint 239 | TableMappings: >- 240 | {"rules": [{"rule-type": "selection", "rule-id": "1", "rule-action": 241 | "include", "object-locator": {"schema-name": "%", "table-name": "%"}, 242 | "rule-name": "1"}]} 243 | TargetEndpointArn: !Ref DMSEndpointS3 244 | Outputs: 245 | SQLDatabaseEndpoint: 246 | Description: Database endpoint 247 | Value: !Sub '${SQLDatabase.Endpoint.Address}:${SQLDatabase.Endpoint.Port}' 248 | -------------------------------------------------------------------------------- /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](https://github.com/aws-samples/aws-dms-cdc-sample/issues), or [recently closed](https://github.com/aws-samples/aws-dms-cdc-sample/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), 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'](https://github.com/aws-samples/aws-dms-cdc-sample/labels/help%20wanted) 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](https://github.com/aws-samples/aws-dms-cdc-sample/blob/master/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 2018 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 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 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 10 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 11 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 12 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 13 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## AWS Dms Cdc Sample 2 | 3 | AWS Lambda and CloudFormation code for loading CDC data from Relational databases to Amazon Kinesis using Database Migration Service. 4 | 5 | ## License Summary 6 | 7 | This sample code is made available under a modified MIT license. See the LICENSE file. 8 | -------------------------------------------------------------------------------- /consumekinesis.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis.zip -------------------------------------------------------------------------------- /consumekinesis/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /consumekinesis/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | consumekinesis 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.fusesource.ide.project.RiderProjectBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | 25 | org.fusesource.ide.project.RiderProjectNature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.m2e.core.maven2Nature 28 | 29 | 30 | -------------------------------------------------------------------------------- /consumekinesis/.settings/com.amazonaws.eclipse.lambda.project.json: -------------------------------------------------------------------------------- 1 | {"lastDeploymentHandler":"com.amazonaws.lambda.demo.LambdaFunctionHandler","lastInvokeHandler":null,"handlerMetadata":{"com.amazonaws.lambda.demo.LambdaFunctionHandler":{"deployment":{"regionId":"us-east-1","awsLambdaFunctionName":"consumekinesis","awsIamRoleName":"s32kinesis-LambdaExecutionRole-UDQUSJ3S82EQ","awsS3BucketName":"awslambdafunctions","memory":0,"timeout":0},"invoke":null}},"lastInvokedHandlerDeployed":false} -------------------------------------------------------------------------------- /consumekinesis/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | -------------------------------------------------------------------------------- /consumekinesis/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 3 | org.eclipse.jdt.core.compiler.compliance=1.8 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.8 6 | -------------------------------------------------------------------------------- /consumekinesis/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /consumekinesis/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 108 | 109 |
110 |
111 | 112 |
113 | 114 |

Welcome to AWS Lambda Eclipse Plugin

115 | 116 |

Congratulations! You have created your first AWS Lambda project. So what's next?

117 | 118 |
119 | 120 |
121 | 122 |
123 | 124 |

Step 1: Implement your function

125 | 126 |

Open up LambdaFunctionHandler.java and implement the handleRequest method. This method is the entry point for your Lambda function, and it will be invoked by Lambda in response to input from the event sources of your function.

127 | 128 |
129 |

Note: You can add new classes and additional external dependencies in your project if needed.

130 |
131 | 132 |
133 | 134 |
135 | 136 |
137 | 138 |

Step 2: Test your function

139 | 140 |

Open up LambdaFunctionHandlerTest.java. Fill in your test logic to validate the input and output of your function handler, and then run it locally as a normal JUnit test.

141 | 142 |
143 |

Note: The unit test provides a sample JSON input file if you have chosen a predefined event type as your function input. You can modify the JSON file, or create new ones based on it.

144 |
145 | 146 |
147 | 148 |
149 | 150 |
151 | 152 |

Step 3: Upload your function

153 | 154 |

155 | Under Project or Package Explorer View, right-click on your project and select Amazon Web Services -> Upload Function to AWS Lambda. 156 | Then follow the steps to create a new Lambda function or upload your code to an existing function. 157 |

158 | 159 | 160 |
161 | 162 |
163 | 164 |
165 | 166 |

Step 4: Invoke your function

167 | 168 |

Now we are ready to run the function in the cloud. Right-click on your project again and select Amazon Web Services -> Run on AWS Lambda.
169 | In the input dialog, enter the JSON input for your function, or select one of the JSON files in your project.

170 | 171 |
172 |

Tip: You can add new JSON input files in your project, and they will show up in this dialog as long as the file name ends with ".json".

173 |
174 | 175 |

Click Invoke and check the output of your function in the Eclipse Console View.

176 | 177 |
178 | 179 |
180 | 181 |
182 | 183 |

What's next?

184 | 185 |

If you want to know more about AWS Lambda, check out the following links:

186 | 187 | 191 | 192 |

Contact us to send bug reports and feedbacks.

193 | 194 |

AWS SDK for Java team

195 | 196 |
197 | 198 |
199 | 200 |
201 | -------------------------------------------------------------------------------- /consumekinesis/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.amazonaws.lambda 6 | demo 7 | 1.0.0 8 | jar 9 | 10 | 11 | 12 | 13 | org.apache.maven.plugins 14 | maven-compiler-plugin 15 | 3.6.0 16 | 17 | 1.8 18 | 1.8 19 | UTF-8 20 | true 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 3.0.0 27 | 28 | 29 | package 30 | 31 | shade 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | com.amazonaws 43 | aws-java-sdk-bom 44 | 1.11.320 45 | pom 46 | import 47 | 48 | 49 | 50 | 51 | 52 | 53 | junit 54 | junit 55 | 4.13.1 56 | test 57 | 58 | 59 | 60 | com.amazonaws 61 | aws-lambda-java-events 62 | 1.3.0 63 | 64 | 65 | com.amazonaws 66 | aws-lambda-java-core 67 | 1.1.0 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /consumekinesis/src/main/java/com/amazonaws/lambda/demo/LambdaFunctionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.amazonaws.lambda.demo; 16 | 17 | import com.amazonaws.services.lambda.runtime.Context; 18 | import com.amazonaws.services.lambda.runtime.RequestHandler; 19 | import com.amazonaws.services.lambda.runtime.events.KinesisEvent; 20 | import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord; 21 | 22 | public class LambdaFunctionHandler implements RequestHandler { 23 | 24 | @Override 25 | public Integer handleRequest(KinesisEvent event, Context context) { 26 | // Log the input event to the cloudwatch console 27 | context.getLogger().log("Input: " + event); 28 | 29 | // Read the records from Kinesis Stream and display them on the cloudwatch 30 | // console 31 | for (KinesisEventRecord record : event.getRecords()) { 32 | String payload = new String(record.getKinesis().getData().array()); 33 | context.getLogger().log("Payload: " + payload); 34 | } 35 | // return the number of events. 36 | return event.getRecords().size(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /consumekinesis/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: Administrator 3 | Build-Jdk: 1.8.0_161 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /consumekinesis/target/classes/META-INF/maven/com.amazonaws.lambda/demo/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Wed Jun 27 08:05:18 UTC 2018 3 | version=1.0.0 4 | groupId=com.amazonaws.lambda 5 | m2e.projectName=consumekinesis 6 | m2e.projectLocation=C\:\\Users\\Administrator\\eclipse-workspace\\consumekinesis 7 | artifactId=demo 8 | -------------------------------------------------------------------------------- /consumekinesis/target/classes/META-INF/maven/com.amazonaws.lambda/demo/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.amazonaws.lambda 6 | demo 7 | 1.0.0 8 | jar 9 | 10 | 11 | 12 | 13 | org.apache.maven.plugins 14 | maven-compiler-plugin 15 | 3.6.0 16 | 17 | 1.8 18 | 1.8 19 | UTF-8 20 | true 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 3.0.0 27 | 28 | 29 | package 30 | 31 | shade 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | com.amazonaws 43 | aws-java-sdk-bom 44 | 1.11.320 45 | pom 46 | import 47 | 48 | 49 | 50 | 51 | 52 | 53 | junit 54 | junit 55 | 4.12 56 | test 57 | 58 | 59 | 60 | com.amazonaws 61 | aws-lambda-java-events 62 | 1.3.0 63 | 64 | 65 | com.amazonaws 66 | aws-lambda-java-core 67 | 1.1.0 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /consumekinesis/target/classes/com/amazonaws/lambda/demo/LambdaFunctionHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/classes/com/amazonaws/lambda/demo/LambdaFunctionHandler.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/LambdaFunctionHandlerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/LambdaFunctionHandlerTest.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext$TestLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext$TestLogger.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeDeserializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeDeserializer.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeSerializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeSerializer.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$AttributeValueMixIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$AttributeValueMixIn.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$RecordMixin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$RecordMixin.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$StreamRecordMixin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$StreamRecordMixin.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$TestJacksonMapperModule.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$TestJacksonMapperModule.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$UpperCaseRecordsPropertyNamingStrategy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$UpperCaseRecordsPropertyNamingStrategy.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/consumekinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils.class -------------------------------------------------------------------------------- /consumekinesis/target/test-classes/kinesis-event.json: -------------------------------------------------------------------------------- 1 | { 2 | "Records": [ 3 | { 4 | "kinesis": { 5 | "partitionKey": "partitionKey-3", 6 | "kinesisSchemaVersion": "1.0", 7 | "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0IDEyMy4=", 8 | "sequenceNumber": "49545115243490985018280067714973144582180062593244200961" 9 | }, 10 | "eventSource": "aws:kinesis", 11 | "eventID": "shardId-000000000000:49545115243490985018280067714973144582180062593244200961", 12 | "invokeIdentityArn": "arn:aws:iam::EXAMPLE", 13 | "eventVersion": "1.0", 14 | "eventName": "aws:kinesis:record", 15 | "eventSourceARN": "arn:aws:kinesis:EXAMPLE", 16 | "awsRegion": "us-east-1" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /s32kinesis.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis.zip -------------------------------------------------------------------------------- /s32kinesis/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /s32kinesis/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | s32kinesis 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.fusesource.ide.project.RiderProjectBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | 25 | org.fusesource.ide.project.RiderProjectNature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.m2e.core.maven2Nature 28 | 29 | 30 | -------------------------------------------------------------------------------- /s32kinesis/.settings/com.amazonaws.eclipse.lambda.project.json: -------------------------------------------------------------------------------- 1 | {"lastDeploymentHandler":"com.amazonaws.lambda.demo.LambdaFunctionHandler","lastInvokeHandler":null,"handlerMetadata":{"com.amazonaws.lambda.demo.LambdaFunctionHandler":{"deployment":{"regionId":"us-east-1","awsLambdaFunctionName":"s32kinesis","awsIamRoleName":"s32kinesis-LambdaExecutionRole-UDQUSJ3S82EQ","awsS3BucketName":"awslambdafunctions","memory":0,"timeout":0},"invoke":null}},"lastInvokedHandlerDeployed":false} -------------------------------------------------------------------------------- /s32kinesis/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | -------------------------------------------------------------------------------- /s32kinesis/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 3 | org.eclipse.jdt.core.compiler.compliance=1.8 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.8 6 | -------------------------------------------------------------------------------- /s32kinesis/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /s32kinesis/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 108 | 109 |
110 |
111 | 112 |
113 | 114 |

Welcome to AWS Lambda Eclipse Plugin

115 | 116 |

Congratulations! You have created your first AWS Lambda project. So what's next?

117 | 118 |
119 | 120 |
121 | 122 |
123 | 124 |

Step 1: Implement your function

125 | 126 |

Open up LambdaFunctionHandler.java and implement the handleRequest method. This method is the entry point for your Lambda function, and it will be invoked by Lambda in response to input from the event sources of your function.

127 | 128 |
129 |

Note: You can add new classes and additional external dependencies in your project if needed.

130 |
131 | 132 |
133 | 134 |
135 | 136 |
137 | 138 |

Step 2: Test your function

139 | 140 |

Open up LambdaFunctionHandlerTest.java. Fill in your test logic to validate the input and output of your function handler, and then run it locally as a normal JUnit test.

141 | 142 |
143 |

Note: The unit test provides a sample JSON input file if you have chosen a predefined event type as your function input. You can modify the JSON file, or create new ones based on it.

144 |
145 | 146 |
147 | 148 |
149 | 150 |
151 | 152 |

Step 3: Upload your function

153 | 154 |

155 | Under Project or Package Explorer View, right-click on your project and select Amazon Web Services -> Upload Function to AWS Lambda. 156 | Then follow the steps to create a new Lambda function or upload your code to an existing function. 157 |

158 | 159 | 160 |
161 | 162 |
163 | 164 |
165 | 166 |

Step 4: Invoke your function

167 | 168 |

Now we are ready to run the function in the cloud. Right-click on your project again and select Amazon Web Services -> Run on AWS Lambda.
169 | In the input dialog, enter the JSON input for your function, or select one of the JSON files in your project.

170 | 171 |
172 |

Tip: You can add new JSON input files in your project, and they will show up in this dialog as long as the file name ends with ".json".

173 |
174 | 175 |

Click Invoke and check the output of your function in the Eclipse Console View.

176 | 177 |
178 | 179 |
180 | 181 |
182 | 183 |

What's next?

184 | 185 |

If you want to know more about AWS Lambda, check out the following links:

186 | 187 | 191 | 192 |

Contact us to send bug reports and feedbacks.

193 | 194 |

AWS SDK for Java team

195 | 196 |
197 | 198 |
199 | 200 |
201 | -------------------------------------------------------------------------------- /s32kinesis/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.amazonaws.lambda 6 | demo 7 | 1.0.0 8 | jar 9 | 10 | 11 | 12 | 13 | org.apache.maven.plugins 14 | maven-compiler-plugin 15 | 3.6.0 16 | 17 | 1.8 18 | 1.8 19 | UTF-8 20 | true 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 3.0.0 27 | 28 | 29 | package 30 | 31 | shade 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | com.amazonaws 43 | aws-java-sdk-bom 44 | 1.11.320 45 | pom 46 | import 47 | 48 | 49 | 50 | 51 | 52 | 53 | junit 54 | junit 55 | 4.13.1 56 | test 57 | 58 | 59 | org.mockito 60 | mockito-core 61 | 2.7.22 62 | test 63 | 64 | 65 | 66 | com.amazonaws 67 | aws-java-sdk-s3 68 | 69 | 70 | com.amazonaws 71 | aws-lambda-java-events 72 | 1.3.0 73 | 74 | 75 | com.amazonaws 76 | aws-lambda-java-core 77 | 1.1.0 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /s32kinesis/src/main/java/com/amazonaws/lambda/demo/LambdaFunctionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.amazonaws.lambda.demo; 16 | 17 | import java.io.BufferedReader; 18 | import java.io.IOException; 19 | import java.io.InputStreamReader; 20 | import java.nio.ByteBuffer; 21 | 22 | import com.amazonaws.services.lambda.runtime.Context; 23 | import com.amazonaws.services.lambda.runtime.RequestHandler; 24 | import com.amazonaws.services.lambda.runtime.events.S3Event; 25 | import com.amazonaws.services.s3.AmazonS3; 26 | import com.amazonaws.services.s3.AmazonS3ClientBuilder; 27 | import com.amazonaws.services.s3.model.GetObjectRequest; 28 | import com.amazonaws.services.s3.model.S3Object; 29 | 30 | import com.amazonaws.services.kinesis.AmazonKinesis; 31 | import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; 32 | 33 | public class LambdaFunctionHandler implements RequestHandler { 34 | 35 | private AmazonS3 s3 = AmazonS3ClientBuilder.standard().build(); 36 | 37 | private static AmazonKinesis kinesis; 38 | 39 | public LambdaFunctionHandler() { 40 | } 41 | 42 | LambdaFunctionHandler(AmazonS3 s3) { 43 | this.s3 = s3; 44 | } 45 | 46 | // Request Handler for the Lambda Function 47 | @Override 48 | public String handleRequest(S3Event event, Context context) { 49 | context.getLogger().log("Received event: " + event); 50 | 51 | //Build Kinesis CLient 52 | kinesis = AmazonKinesisClientBuilder.standard().withRegion("us-east-1").build(); 53 | 54 | // Get Kinesis Stream name from Lambda Environment Variables 55 | String streamName = System.getenv("KinesisStream"); 56 | 57 | // Get the object from the S3 event and processes the CSV file 58 | // String holder for each line is CSV file 59 | String line = ""; 60 | 61 | // String holder for content type retrieved from object metadata 62 | String contentType = ""; 63 | 64 | // Get bucket name 65 | String bucket = event.getRecords().get(0).getS3().getBucket().getName(); 66 | // Get bucket key 67 | String key = event.getRecords().get(0).getS3().getObject().getKey(); 68 | 69 | try { 70 | // Retrieve the S3 object with by providing the bucket and key to the ObjectRequest object 71 | S3Object response = s3.getObject(new GetObjectRequest(bucket, key)); 72 | 73 | // Get the content type from the S3Object 74 | contentType = response.getObjectMetadata().getContentType(); 75 | 76 | // Create an InputStreamReader to hold the Object Content from S3 Object 77 | InputStreamReader isr = new InputStreamReader(response.getObjectContent()); 78 | 79 | // Pass in the Input STream Reader to the Buffered Reader 80 | BufferedReader br = new BufferedReader(isr); 81 | 82 | // Process the records from the CSV file one line at a time. 83 | while ((line = br.readLine()) != null) { 84 | // get current time as milliseconds to use as Kinesis Partition Key 85 | long createTime = System.currentTimeMillis(); 86 | //Log to the Lambda Logs in Cloudwatch console. 87 | context.getLogger().log("CSV: " + line); 88 | // Put record in Kinesis Data Stream 89 | kinesis.putRecord(streamName, ByteBuffer.wrap(line.getBytes()), String.format("partitionKey-%d", createTime)); 90 | } 91 | 92 | // Log the content type on the Cloudwatch console 93 | context.getLogger().log("CONTENT TYPE: " + contentType); 94 | 95 | } catch (IOException e) { 96 | e.printStackTrace(); 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | context.getLogger().log(String.format("Error getting object %s from bucket %s. Make sure they exist and" 100 | + " your bucket is in the same region as this function.", key, bucket)); 101 | throw e; 102 | } 103 | return contentType; 104 | } 105 | } -------------------------------------------------------------------------------- /s32kinesis/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: Administrator 3 | Build-Jdk: 1.8.0_161 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /s32kinesis/target/classes/META-INF/maven/com.amazonaws.lambda/demo/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Wed Jun 27 08:05:28 UTC 2018 3 | version=1.0.0 4 | groupId=com.amazonaws.lambda 5 | m2e.projectName=s32kinesis 6 | m2e.projectLocation=C\:\\Users\\Administrator\\eclipse-workspace\\s32kinesis 7 | artifactId=demo 8 | -------------------------------------------------------------------------------- /s32kinesis/target/classes/META-INF/maven/com.amazonaws.lambda/demo/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.amazonaws.lambda 6 | demo 7 | 1.0.0 8 | jar 9 | 10 | 11 | 12 | 13 | org.apache.maven.plugins 14 | maven-compiler-plugin 15 | 3.6.0 16 | 17 | 1.8 18 | 1.8 19 | UTF-8 20 | true 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 3.0.0 27 | 28 | 29 | package 30 | 31 | shade 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | com.amazonaws 43 | aws-java-sdk-bom 44 | 1.11.320 45 | pom 46 | import 47 | 48 | 49 | 50 | 51 | 52 | 53 | junit 54 | junit 55 | 4.12 56 | test 57 | 58 | 59 | org.mockito 60 | mockito-core 61 | 2.7.22 62 | test 63 | 64 | 65 | 66 | com.amazonaws 67 | aws-java-sdk-s3 68 | 69 | 70 | com.amazonaws 71 | aws-lambda-java-events 72 | 1.3.0 73 | 74 | 75 | com.amazonaws 76 | aws-lambda-java-core 77 | 1.1.0 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /s32kinesis/target/classes/com/amazonaws/lambda/demo/LambdaFunctionHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/classes/com/amazonaws/lambda/demo/LambdaFunctionHandler.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/LambdaFunctionHandlerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/LambdaFunctionHandlerTest.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext$TestLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext$TestLogger.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestContext.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeDeserializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeDeserializer.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeSerializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DateTimeSerializer.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$AttributeValueMixIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$AttributeValueMixIn.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$RecordMixin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$RecordMixin.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$StreamRecordMixin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin$StreamRecordMixin.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$DynamodbEventMixin.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$TestJacksonMapperModule.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$TestJacksonMapperModule.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$UpperCaseRecordsPropertyNamingStrategy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils$UpperCaseRecordsPropertyNamingStrategy.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-dms-cdc-sample/5a31ce326229055fc505fa871d0375daff2b4673/s32kinesis/target/test-classes/com/amazonaws/lambda/demo/TestUtils.class -------------------------------------------------------------------------------- /s32kinesis/target/test-classes/s3-event.put.json: -------------------------------------------------------------------------------- 1 | { 2 | "Records": [ 3 | { 4 | "eventVersion": "2.0", 5 | "eventSource": "aws:s3", 6 | "awsRegion": "us-east-1", 7 | "eventTime": "1970-01-01T00:00:00.000Z", 8 | "eventName": "ObjectCreated:Put", 9 | "userIdentity": { 10 | "principalId": "EXAMPLE" 11 | }, 12 | "requestParameters": { 13 | "sourceIPAddress": "127.0.0.1" 14 | }, 15 | "responseElements": { 16 | "x-amz-request-id": "C3D13FE58DE4C810", 17 | "x-amz-id-2": "FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" 18 | }, 19 | "s3": { 20 | "s3SchemaVersion": "1.0", 21 | "configurationId": "testConfigRule", 22 | "bucket": { 23 | "name": "sourcebucket", 24 | "ownerIdentity": { 25 | "principalId": "EXAMPLE" 26 | }, 27 | "arn": "arn:aws:s3:::mybucket" 28 | }, 29 | "object": { 30 | "key": "HappyFace.jpg", 31 | "size": 1024, 32 | "eTag": "d41d8cd98f00b204e9800998ecf8427e" 33 | } 34 | } 35 | } 36 | ] 37 | } --------------------------------------------------------------------------------