exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 97 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 97
Topic #: 1
[All AWS Certified Developer Associate Questions]

Given the source code for an AWS Lambda function in the local file store.py containing a handler function called get_store and the following AWS
CloudFormation template:

What should be done to prepare the template so that it can be deployed using the AWS CLI command aws cloudformation deploy?

  • A. Use aws cloudformation compile to base64 encode and embed the source file into a modified CloudFormation template.
  • B. Use aws cloudformation package to upload the source code to an Amazon S3 bucket and produce a modified CloudFormation template.
  • C. Use aws lambda zip to package the source file together with the CloudFormation template and deploy the resulting zip archive.
  • D. Use aws serverless create-package to embed the source file directly into the existing CloudFormation template.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
awscertified
Highly Voted 3 years, 7 months ago
B. Use aws cloudformation package to upload the source code to an Amazon S3 bucket and produce a modified CloudFormation template. https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html (...) Examples Following command exports a template named template.json by uploading local artifacts to S3 bucket bucket-name and writes the exported template to packaged-template.json: aws cloudformation package --template-file /path_to_template/template.json --s3-bucket bucket-name --output-template-file packaged-template.json
upvoted 28 times
...
Kane
Highly Voted 3 years, 7 months ago
Answer is 'B'. First of all packaging the source code and uploading to s3 then deploy the code with s3 url.
upvoted 12 times
...
sumanshu
Most Recent 4 months, 3 weeks ago
Selected Answer: B
When deploying an AWS Lambda function using a CloudFormation template, the Lambda function's source code must be made accessible for deployment.
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: B
B is the correct answer. We need to launch sam package first, in order to upload the code on S3 and create a cloudformation template and sam deploy after, in order to run the CF template and create the resources. P.S. instead of "sam" we can also run "aws cloudformation" command.
upvoted 1 times
...
sichilam
2 years, 4 months ago
B is the answer
upvoted 1 times
...
tasbasi
3 years ago
Selected Answer: B
as stated by 'awscertified', aws cloudformation package ->> (which will upload to s3) aws cloudformation deploy ->> (deploy from s3 via AWS Cli)
upvoted 4 times
...
KingGuo
3 years, 3 months ago
Selected Answer: B
ANS: B
upvoted 1 times
...
JP_PA
3 years, 3 months ago
ANS: B
upvoted 1 times
...
Mal_8
3 years, 6 months ago
Ans: B
upvoted 1 times
...
praveenas400
3 years, 6 months ago
Answer is B
upvoted 2 times
...
capoitas
3 years, 6 months ago
The answer is D because in the first line of the template the transform is set to the SAM transform, also the resource type is Serverless::Function. So i guess we can assume this is a SAM template. Now i'm not sure that command exists, but it makes sense to do.
upvoted 1 times
t33me
3 years, 4 months ago
B: Command “aws serverless create-package” does not exist. aws cloudformation package – is the same as "sam package" and can be used with SAM
upvoted 3 times
...
...
wils3
3 years, 6 months ago
Ans : B
upvoted 2 times
...
kkdd
3 years, 6 months ago
B is correct. https://aws.nz/best-practice/cloudformation-package-deploy/ ~ $ aws cloudformation package \ --template-file template.yml \ --output-template-file template.packaged.yml \ --s3-bucket {some-bucket} ~ $ aws cloudformation deploy \ --template-file template.packaged.yml \ --stack-name {some-name}
upvoted 1 times
...
RicardoD
3 years, 6 months ago
B is the answer D is for SAM CLI
upvoted 1 times
...
cafeaulait
3 years, 6 months ago
Answer: B
upvoted 1 times
...
codeScalable
3 years, 6 months ago
I strongly believe the answer is D, using SAM
upvoted 2 times
...
hulala
3 years, 6 months ago
What's going on with the revealed solution? Isn't that something set by those who make those questions? I'm getting a little confused here. I think that the answer is 'B' like everyone else here. But the revealed solution says its 'D'. Very confused
upvoted 5 times
loyfra
3 years, 6 months ago
I am also Very confused. Who is revealing the answer here. Please explain why it was 'D'
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago