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

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

A developer is writing an application in Python. The application runs on AWS Lambda. The application generates a file and needs to upload this file to Amazon S3.
The developer must implement this upload functionality with the least possible change to the application code.
Which solution meets these requirements?

  • A. Make an HTTP request directly to the S3 API to upload the file.
  • B. Include the AWS SDK for Python in the Lambda function. Use the SDK to upload the file.
  • C. Use the AWS SDK for Python that is installed in the Lambda environment to upload the file.
  • D. Use the AWS CLI that is installed in the Lambda environment to upload the file.
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
Chhotu_DBA
Highly Voted 2 years, 9 months ago
Selected Answer: C
C seems correct
upvoted 7 times
...
tuongthuy
Most Recent 1 year, 11 months ago
Selected Answer: B
Option B is the best solution to meet the requirements of the developer with the least possible change to the application code. By including the SDK in the Lambda function, the developer can use the SDK to upload the file to S3 without making significant changes to the application code. Option C is not recommended because using the SDK that is installed in the Lambda environment could lead to version conflicts and unexpected behavior if the SDK version in the environment is different from the version used by the developer.
upvoted 2 times
nmc12
1 year, 7 months ago
require least posible change, so that is C. with B is complex
upvoted 1 times
...
...
rcaliandro
1 year, 11 months ago
Selected Answer: C
C is the correct one: "Use the AWS SDK for Python that is installed in the Lambda environment to upload the file"
upvoted 1 times
...
Syre
2 years, 1 month ago
Selected Answer: B
B is Correct
upvoted 1 times
...
RajinderKaur
2 years, 2 months ago
Reason why it's not B: https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html You can run Python code in AWS Lambda. Lambda provides runtimes for Python that run your code to process events. Your code runs in an environment that includes the SDK for Python (Boto3), with credentials from an AWS Identity and Access Management (IAM) role that you manage.
upvoted 1 times
...
shahs10
2 years, 2 months ago
Selected Answer: B
What is the difference between B and C?
upvoted 1 times
BATSIE
2 years, 1 month ago
is also not the best choice since it requires the developer to include the SDK for Python in the application code, which may increase the size of the deployment package and the time it takes to deploy the function.
upvoted 2 times
BATSIE
2 years, 1 month ago
B******
upvoted 1 times
...
...
...
jv_
2 years, 5 months ago
answer C
upvoted 1 times
...
michaldavid
2 years, 6 months ago
Selected Answer: C
CCCCCCCCC
upvoted 1 times
...
dark_cherrymon
2 years, 6 months ago
Selected Answer: C
it's probably still C because even with A you need a presigned url though i would mention that boto is ending support for python so this question may not be so relevant. though you probably can use the older versions of python https://github.com/boto/boto3 "On 2022-05-30, support for Python 3.6 was ended. This follows the Python Software Foundation end of support for the runtime which occurred on 2021-12-23. For more information, see this blog post."
upvoted 1 times
dark_cherrymon
2 years, 6 months ago
"On 2022-05-30, support for Python 3.6 was ended. This follows the Python Software Foundation end of support for the runtime which occurred on 2021-12-23. For more information, see this blog post." https://www.serverlessops.io/blog/aws-lambda-and-python-boto3-bundling#:~:text=Because%20the%20boto3%20module%20is,t%20bother%20bundling%20that%20either.
upvoted 1 times
dark_cherrymon
2 years, 6 months ago
my copy paste didn't work, here's the quote i was going for "Because the boto3 module is already available in the AWS Lambda Python runtimes, don’t bother including boto3 and its dependency botocore in your Lambda deployment zip file."
upvoted 1 times
...
...
...
habros
2 years, 8 months ago
Selected Answer: C
Boto3 comes with the Lambda environment by default https://aws.amazon.com/sdk-for-python/
upvoted 3 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 ...