Skip to content

Commit

Permalink
Fixing up logging, models, and content type issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlhagerm committed Oct 17, 2023
1 parent 375058e commit f963aec
Showing 1 changed file with 64 additions and 25 deletions.
89 changes: 64 additions & 25 deletions applications/feedback_sentiment_analyzer/cdk/lib/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,69 +214,108 @@ const JAVA_FUNCTIONS: AppFunctionConfig[] = [
},
];

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 = [
{
...BASE_APP_FUNCTION,
name: "ExtractText",
handler: "FsaExtractText::FsaExtractText.Function::FunctionHandler",
handler: "FsaExtractText::FsaExtractText.ExtractTextFunction::FunctionHandler",
runtime: Runtime.DOTNET_6,
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaExtractText"
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
bundling: {
command: [
"/bin/sh",
"-c",
" dotnet tool install -g Amazon.Lambda.Tools" +
" && dotnet build" +
" && cd FsaExtractText" +
" && dotnet lambda package --output-package /asset-output/function.zip",
],
image: Runtime.DOTNET_6.bundlingImage,
user: "root",
outputType: BundlingOutput.ARCHIVED,
},
});
},
},
{
...BASE_APP_FUNCTION,
name: "AnalyzeSentiment",
handler: "FsaAnalyzeSentiment::FsaAnalyzeSentiment.Function::FunctionHandler",
handler: "FsaAnalyzeSentiment::FsaAnalyzeSentiment.AnalyzeSentimentFunction::FunctionHandler",
runtime: Runtime.DOTNET_6,
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaExtractText"
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
bundling: {
command: [
"/bin/sh",
"-c",
" dotnet tool install -g Amazon.Lambda.Tools" +
" && dotnet build" +
" && cd FsaAnalyzeSentiment" +
" && dotnet lambda package --output-package /asset-output/function.zip",
],
image: Runtime.DOTNET_6.bundlingImage,
user: "root",
outputType: BundlingOutput.ARCHIVED,
},
});
},
},
{
...BASE_APP_FUNCTION,
name: "TranslateText",
handler: "FsaTranslateText::FsaTranslateText.Function::FunctionHandler",
handler: "FsaTranslateText::FsaTranslateText.TranslateTextFunction::FunctionHandler",
runtime: Runtime.DOTNET_6,
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaTranslateText"
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
bundling: {
command: [
"/bin/sh",
"-c",
" dotnet tool install -g Amazon.Lambda.Tools" +
" && dotnet build" +
" && cd FsaTranslateText" +
" && dotnet lambda package --output-package /asset-output/function.zip",
],
image: Runtime.DOTNET_6.bundlingImage,
user: "root",
outputType: BundlingOutput.ARCHIVED,
},
});
},
},
{
...BASE_APP_FUNCTION,
name: "SynthesizeAudio",
handler: "FsaSynthesizeAudio::FsaSynthesizeAudio.Function::FunctionHandler",
handler: "FsaSynthesizeAudio::FsaSynthesizeAudio.SynthesizeAudioFunction::FunctionHandler",
runtime: Runtime.DOTNET_6,
codeAsset() {
const source = resolve(
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer/FsaSynthesizeAudio"
"../../../dotnetv3/cross-service/FeedbackSentimentAnalyzer"
);
return Code.fromAsset(source, {
bundling: DOTNET_BUNDLING_CONFIG,
bundling: {
command: [
"/bin/sh",
"-c",
" dotnet tool install -g Amazon.Lambda.Tools" +
" && dotnet build" +
" && cd FsaSynthesizeAudio" +
" && dotnet lambda package --output-package /asset-output/function.zip",
],
image: Runtime.DOTNET_6.bundlingImage,
user: "root",
outputType: BundlingOutput.ARCHIVED,
},
});
},
},
Expand Down

0 comments on commit f963aec

Please sign in to comment.