We have the pipeline code. where it does code-commit. code-build and create and deploy changeset where it deploys to other AWS accounts. this codebase has a lambda function in the template.yaml along with java codebase. during the build phase, it creates 3 jar files. how to pack these files to create template-yml code-base. it works fine in a single lamdba function template.yml the challange is here we have lambda functions inside the template.yml
- aws cloudformation package --template-file template.yml --s3-bucket $S3Bucket --s3-prefix packages-$EnvironmentName --output-template-file template-export.yml
how to add the CodeUri: this should be like s3://bucketname/packages-/pack1/
Transform: AWS::Serverless-2016-10-31
Description: Outputs the time
Resources:
TimeFunction:
Type: AWS::Serverless::Function
Properties:
Handler: firstsample/firstsample.handler # firstsample.js file is in firstsample direcotory
Role: !GetAtt BasicAWSLambdaRole.Arn
Runtime: java11
CodeUri: s3://test/packages/jar1/
SecondSampleFunction:
Type: AWS::Serverless::Function
Properties:
Handler: secondsample.handler # didn't have to include secondsample directory
Role: !GetAtt BasicAWSLambdaRole.Arn
Runtime: java11
CodeUri: s3://test/packages/jar2/