-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code cleanup and documentation (#38)
* Fixed carriage return issue with build.sh in each python lambda. * Added an exports file so users can change that instead of messing with code when trying to load this onto their environment. * Updated READMEs * Added convinient buildall bash scripts * Modified buildall script to include gradle and fixed getting environment variable in python functions. * Minor Semantic Changes and README * Added dynamic links to AWS service dependancies * Updated README for UserConfigFunction * Get rid of unnecessary files * Cleaned up code * Modified Testing and code clean up * Update cdk-init-ts-stack.ts Changed node 18 to node 16 * Update README.md Added forgotten step
- Loading branch information
Showing
30 changed files
with
567 additions
and
796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# UserConfigFunction | ||
|
||
This directory contains the service that is responsible for interacting with the proper translation model, and sending the result back to the AppSync in proper format, given a URL input. | ||
|
||
## Tech Specs | ||
This function uses Java 17 and Gradle as a package manager. It is intended to run on using AWS Lambda. | ||
|
||
### Directory Structure | ||
|
||
- [Handler](src/main/java/com/awsomenlp/lambda/config/): This is what is called when this lambda is invoked. | ||
- [Objects](src/main/java/com/awsomenlp/lambda/config/objects): This is where the objects are stored. | ||
- [Resolvers](src/main/java/com/awsomenlp/lambda/config/resolvers): This is where the resolvers are stored. Resolvers act as interfaces between different services, for example, the AppSyncResolver converts relevant data from this service into something AppSync can understand. | ||
- [Models](src/main/java/com/awsomenlp/lambda/config/models): This is where the different translation models are stored and interfaced with. | ||
|
||
### Building & Testing | ||
|
||
Since this project is using Gradle, you can test it using ```$ gradle test``` and build using ```$ gradle build```. | ||
|
||
#### Deployment | ||
|
||
This function should be deployed automatically by CDK, however, if you'd like to deploy this manually, you can with ```$ gradle buildZip``` and uploading it to a Lambda function with the following specifications: | ||
|
||
``` | ||
role: userConfigFunctionRole, | ||
runtime: Runtime.JAVA_17, | ||
handler: com.awsomenlp.lambda.config.UserConfigHandler::handleRequest, | ||
memorySize*: 1024MB, | ||
timeout: cdk.Duration.seconds(45) | ||
``` | ||
|
||
*The memory size is totally optional, this can be left at default. | ||
|
||
**input** | ||
|
||
``` | ||
{ | ||
"arguments": { | ||
"input": { | ||
"url":https://aws.amazon.com/blogs/mobile/export-amplify-backends-to-cdk-and-use-with-existing-deployment-pipelines/, | ||
"targetLanguage": { | ||
"name": "TURKISH", | ||
"code": "tr" | ||
}, | ||
"sourceLanguage": { | ||
"name": "ENGLISH", | ||
"code": "en" | ||
}, | ||
"translationModel": { | ||
"type": "amazonTranslate" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**output** | ||
|
||
``` | ||
{ | ||
"blogPostOriginalPostId": "10", | ||
"blogPostLanguageCode": "tr", | ||
"id": "100", | ||
"title": (Translated Title), | ||
"content": [ | ||
(Translated Paragraph), | ||
(Translated Paragraph) | ||
], | ||
"authors": [ | ||
(Author 1), | ||
(Author 2) | ||
] | ||
} | ||
``` |
202 changes: 0 additions & 202 deletions
202
amplify/backend/function/UserConfigFunction/UserConfigFunction-cloudformation-template.json
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
amplify/backend/function/UserConfigFunction/custom-policies.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.