├── .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:
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: