Skip to content

Commit

Permalink
Reorganize and add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlhagerm committed Oct 17, 2023
1 parent bd14e00 commit 375058e
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 522 deletions.
82 changes: 52 additions & 30 deletions applications/feedback_sentiment_analyzer/cdk/lib/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,49 +214,71 @@ const JAVA_FUNCTIONS: AppFunctionConfig[] = [
},
];

const DOTNET_FUNCTION_CONFIG = {
...BASE_APP_FUNCTION,
runtime: Runtime.DOTNET_6,
codeAsset: () => {
const source = resolve("../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer");
return Code.fromAsset(source, {
bundling: {
command: [
"/bin/sh",
"-c",
" dotnet tool install -g Amazon.Lambda.Tools" +
" && dotnet build" +
" && cd PamApi" +
" && dotnet lambda package --output-package /asset-output/function.zip",
],
image: Runtime.DOTNET_6.bundlingImage,
user: "root",
outputType: BundlingOutput.ARCHIVED,
},
});
},
const DOTNET_BUNDLING_CONFIG = {
command: [
"/bin/sh",
"-c",
" dotnet tool install -g Amazon.Lambda.Tools" +
" && dotnet build" +
" && dotnet lambda package --output-package /asset-output/function.zip",
],
image: Runtime.DOTNET_6.bundlingImage,
user: "root",
outputType: BundlingOutput.ARCHIVED,
};

const DOTNET_FUNCTIONS: AppFunctionConfig[] = [
const DOTNET_FUNCTIONS = [
{
...DOTNET_FUNCTION_CONFIG,
...BASE_APP_FUNCTION,
name: "ExtractText",
handler: "com.example.fsa.handlers.ExtractTextHandler::handleRequest",
handler: "FsaExtractText::FsaExtractText.Function::FunctionHandler",
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaExtractText"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
});
},
},
{
...COMMON_JAVA_FUNCTION_CONFIG,
...BASE_APP_FUNCTION,
name: "AnalyzeSentiment",
handler: "com.example.fsa.handlers.AnalyzeSentimentHandler::handleRequest",
handler: "FsaAnalyzeSentiment::FsaAnalyzeSentiment.Function::FunctionHandler",
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaExtractText"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
});
},
},
{
...COMMON_JAVA_FUNCTION_CONFIG,
...BASE_APP_FUNCTION,
name: "TranslateText",
handler: "com.example.fsa.handlers.TranslateTextHandler::handleRequest",
handler: "FsaTranslateText::FsaTranslateText.Function::FunctionHandler",
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaTranslateText"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
});
},
},
{
...COMMON_JAVA_FUNCTION_CONFIG,
...BASE_APP_FUNCTION,
name: "SynthesizeAudio",
handler: "com.example.fsa.handlers.SynthesizeAudioHandler::handleRequest",
handler: "FsaSynthesizeAudio::FsaSynthesizeAudio.Function::FunctionHandler",
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaSynthesizeAudio"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
});
},
},
];

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 375058e

Please sign in to comment.