aws-samples / serverless-patterns

Serverless patterns. Learn more at the website: https://serverlessland.com/patterns.
https://serverlessland.com
Other
1.48k stars 863 forks source link

New Pattern Submission - TranslateDocument s3-lambda-translate-cdk-python #2049

Closed awsarippa closed 4 months ago

awsarippa commented 4 months ago

Issue #, if available:

Description of changes: This patterns shows CDK deployment on how to leverage Amazon S3, AWS Lambda, and Amazon Translate to perform document language translation in a serverless fashion.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 4 months ago

Valid pattern file found.

Reviewer you can view the pattern file here

awsarippa commented 4 months ago

@ellisms - All changes are committed.

ellisms commented 4 months ago

Thanks @awsarippa. I tried to test the code changes and encounter the following error during cdk synth and cdk deploy:

Traceback (most recent call last):
  File "/Users/ellisms/repo/serverless-patterns/s3-lambda-translate-cdk-python/app.py", line 144, in <module>
    filestack = S3LambdaTranslateServerless(app, "S3LambdaTranslateServerless")
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
  File "/Users/ellisms/repo/serverless-patterns/s3-lambda-translate-cdk-python/app.py", line 72, in __init__
    lambda_function = lambda_.Function(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'log_group'
awsarippa commented 4 months ago

@ellisms - Can you please try with the latest version of CDK libraries and github PR code? I just tried it in a brand new Cloud9 machine (did a pip install of all packages as part of the requirements.txt), did a clone of the latest copy of PR files and it worked without any bugs.

ellisms commented 4 months ago

I figured out my error and re-tested. It looks good. I'll merge this and place it in the publishing pipeline. Thanks!

awsarippa commented 4 months ago

@ellisms - Thanks a lot for your review and effort. Appreciate the same.