0

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/  
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Sathya
  • 29
  • 4
  • What is the problem? Can you clarify again? – Marcin Jun 24 '21 at 22:23
  • Can we deploy the mutiple jars generated in the code-pipline build to the 3 different lambdas defined in the template.yml. i am able to achive using the singe jar but not mutiple jars. – Sathya Jun 25 '21 at 11:38

0 Answers0