AWS Serverless Application Model (SAM) Flashcards Preview

AWS Developer Associate > AWS Serverless Application Model (SAM) > Flashcards

Flashcards in AWS Serverless Application Model (SAM) Deck (4)
Loading flashcards...
1
Q

In a SAM template, what AWS resource type would you be using when running lambda, dynamoDB or API Gatway?

A

AWS::Serverless::Function is used for running lambda functions in SAM
AWS::Serverless::SimpleTable for DynamoDB and
AWS::Serverless::Api for API Gway

2
Q

You have a cloud formation template which contains the line

Transform:’AWS::Serverless-2016-10-31’ in the template header. What is this template and how will it differ from a CF template?

A

This is a SAM template. This will allow you deploy an entire cloud formation stack using just the
aws cloudformation package

and

aws cloudformation deploy

3
Q

How are SAM applications packaged and deployed?

A

sam package and sam deploy cli commands will package and deploy a SAM application. These are aliases for aws cloudformation package and deploy

4
Q

We have a SAM stack ready to be deployed using cloud formation. We have run the cloudformation package commands correctly with our template.yaml and it looks to have generate the correct output - template-generated.yaml file for running the deploy. The deploy command generate by CloudFormation is:

aws cloudformation deploy –template-file gen/template-generated.yaml –stack-name hello-world-sam2

When we run this though, we get the following error:

“FAILED” Status: FAILED. Reason: Requires capabilities : [CAPABILITY_IAM]

Why?

A

When you’re creating or deploying a stack you need to explicitly allow creation of IAM resources. To do that, you need to add the parameter –capabilities CAPABILITY_IAM