0 votes
in AWS by

You are planning to use the Serverless Application model which will be used to deploy a serverless application consisting of a Node.js function.

Which of the following steps need to be carried out? Choose 2 answers from the options given below.

1 Answer

0 votes
by

Answer - B and D.

The AWS Documentation gives an example of this.

Here you need to use the same commands and not the cloud formation commands.

For more information on serverless deployment, please refer to the below URL-

https://docs.aws.amazon.com/lambda/latest/dg/serverless-deploy-wt.html

a@ sam package \  --template-file path/example.yaml \ --output-template-file serverless-output.yaml \ --s3-bucket s3-bucket-name  The package command returns an AWS SAM template, in this case serverless-output. yam] that contains the CodeUri that points to the deployment zip in the Amazon $3 bucket that you specified. This template represents your serverless application. You are now ready to deploy it.  Deployment  To deploy the application, run the following command:  a@ sam deploy \  --template-file serverless-output.yaml \ tack-name new-stack-name \ --capabilities CAPABILITY_IAM

The correct answers are B. Use the SAM package command and D. Use the SAM deploy command.

The Serverless Application Model (SAM) is an open-source framework that is used to build serverless applications on AWS. It is used to simplify the deployment of AWS Lambda functions, API Gateway, and DynamoDB tables.

When you use SAM to deploy your application, the following steps need to be carried out:

  1. Write your serverless application code: In this case, you need to write your Node.js function.

  2. Write your SAM template: This is a CloudFormation template that defines your serverless application. It describes the AWS resources required by your application, such as Lambda functions, API Gateway, and DynamoDB tables.

  3. Package your application: This step involves creating a deployment package that includes your Node.js function code and any dependent libraries. This can be done using the SAM package command, which packages your application and uploads it to an S3 bucket.

  4. Deploy your application: This step involves deploying your application to AWS. This can be done using the SAM deploy command, which creates the necessary resources in your AWS account and deploys your application.

Therefore, the correct steps to be carried out are to use the SAM package command to package your application and then use the SAM deploy command to deploy it.

Option A (Use the Lambda package command) is incorrect because the Lambda package command is used to package only the Lambda function code, and does not include the CloudFormation template required for deployment.

Option C (Use the Lambda deploy command) is also incorrect because the Lambda deploy command is used to update the code of an existing Lambda function, and not to deploy a new serverless application.

...