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 139 discussion

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

A developer is creating an AWS Lambda function that generates a new file each time it runs. Each new file must be checked into an AWS CodeCommit repository hosted in the same AWS account.
How should the developer accomplish this?

  • A. When the Lambda function starts, use the Git CLI to clone the repository. Check the new file into the cloned repository and push the change.
  • B. After the new file is created in Lambda, use cURL to invoke the CodeCommit API. Send the file to the repository.
  • C. Use an AWS SDK to instantiate a CodeCommit client. Invoke the putjile method to add the file to the repository.
  • D. Upload the new file to an Amazon S3 bucket. Create an AWS Step Function to accept S3 events. In the Step Function, add the new file to the repository.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
jodeepak
Highly Voted 3 years, 8 months ago
Answer C https://docs.aws.amazon.com/cli/latest/reference/codecommit/index.html
upvoted 15 times
...
RachitNandi1997
Most Recent 1 year, 9 months ago
Selected Answer: C
C is the correct answer.
upvoted 1 times
...
rcaliandro
1 year, 11 months ago
Selected Answer: C
C is the correct one we can call the put_file method from AWS SDK to put a file to the CodeCommit repo
upvoted 2 times
...
Rpod
2 years, 1 month ago
Selected Answer: C
Is there a typo here in this option - pujile ? they meant putfile ?
upvoted 2 times
...
MrTee
2 years, 1 month ago
C. Use an AWS SDK to instantiate a CodeCommit client. Invoke the putFile method to add the file to the repository is the best approach to accomplish the given task.
upvoted 1 times
...
Krok
2 years, 2 months ago
Selected Answer: C
I'm agree it's C
upvoted 1 times
...
pancman
2 years, 3 months ago
Selected Answer: C
C is correct
upvoted 1 times
...
dark_cherrymon
2 years, 6 months ago
i'm starting to think it's not A because you need a linux ec2 to issue git cli
upvoted 1 times
...
LaXuanLinh
2 years, 9 months ago
the correct command is put-file, not put_file
upvoted 2 times
...
JP_PA
3 years, 4 months ago
Selected Answer: C
ANS: C
upvoted 2 times
...
rolymeck
3 years, 7 months ago
A and C are correct But C takes less effort Answer is C
upvoted 2 times
aws_leo
2 years, 6 months ago
Agree. From Lambda function, we can use CodeCommit API to put new file(s) to a repository or a branch: PutFile (API), which adds or modifies a single file in a specified repository and branch. Ref: https://docs.aws.amazon.com/cli/latest/reference/codecommit/index.html
upvoted 1 times
...
...
VAG1595
3 years, 7 months ago
Answer: A
upvoted 1 times
...
gobble
3 years, 7 months ago
both A and C seems right. However, wrapping all your want inside lambda code is better than getting git configured during lambda runtime. https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/codecommit/AWSCodeCommitClient.html
upvoted 1 times
...
Chinta
3 years, 7 months ago
C is correct need to call put file method
upvoted 3 times
PopoAWS
3 years, 7 months ago
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/codecommit.html
upvoted 1 times
...
...
dragonie
3 years, 7 months ago
C is correct
upvoted 1 times
...
BiswaGB
3 years, 8 months ago
I feel both A and C are correct. However C seems to be a better approach. To use A(git cli), first git cli need to be installed in lambda run time.
upvoted 4 times
...
quanlh
3 years, 8 months ago
C is correct
upvoted 2 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 ...