Module 4: Python for Automation

Looking for ‘Python for Serverless Applications and Automation on AWS Module 4 Answers‘?

In this post, I provide accurate answers and detailed explanations for Module 4: Python for Automation of Course 6: Python for Serverless Applications and Automation on AWS – AWS Cloud Support Associate Professional Certificate.

Whether you’re preparing for quizzes or brushing up on your knowledge, these insights will help you master the concepts effectively. Let’s dive into the correct answers and detailed explanations for each question.

Module 1 Quiz

Graded Assignment

1. Which Python package is used to make calls to AWS services from applications?

  • NumPy
  • Requests
  • Certifi
  • Boto3 ✅

Explanation:
Boto3 is the official AWS SDK for Python, which allows Python developers to write software that makes calls to AWS services like S3, EC2, DynamoDB, Lambda, etc.

  • NumPy is for numerical operations.
  • Requests is for making HTTP requests.
  • Certifi is related to SSL certificates.

2. An application programmer is working on code to store a PDF file in Amazon Simple Storage Service (Amazon S3). What is the correct Python code to complete this task?

Explanation:

  • To upload an object (like a PDF) to S3, use put_object.
  • Body is the file data (or filename if opened correctly),
  • Bucket is the target S3 bucket,
  • Key is the name under which the file will be stored in S3.
    Incorrect options either create a bucket or set its ACL/CORS but do not upload files.

3. Match the statements to the correct type of database.

Explanation:

  • Relational databases (RDS) are schema-based and use SQL.
  • Amazon DynamoDB is a NoSQL database designed for scalability and low latency. It uses partition and sort keys and does not require a fixed schema.

4. An application programmer is writing an application that retrieves loan applications, processes the application, and then delivers the results to an API. The application will be scaled out by running on multiple hosts. The application needs to be resilient against host reboots, so the messages need to be stored durably.

Which service meets the requirements for storing the loan application messages?

  • Amazon Simple Notification Service (Amazon SNS)
  • Amazon Simple Storage Service (Amazon S3)
  • Amazon DynamoDB
  • Amazon Simple Queue Service (Amazon SQS) ✅

Explanation:
SQS is a durable message queue used to decouple and scale microservices and distributed systems.
It ensures that:

  • Messages are not lost if a host fails.
  • Multiple consumers can retrieve and process messages independently.
    Other options:
  • SNS is for pub/sub notifications.
  • S3 is for file/object storage, not message queuing.
  • DynamoDB is a NoSQL database, not a queue.

5. An application programmer is working on an event driven architecture with Amazon EventBridge. The programmer has been asked to implement a feature that will respond to an event that contains a reference to an image in an Amazon Simple Storage Service (Amazon S3) bucket. When the event occurs, the image needs to be resized to a thumbnail image.

Which type of rule target can be used to create the image resizing?

  • Amazon Simple Queue Service (Amazon SQS) queue
  • AWS Lambda function ✅
  • Amazon Simple Notification Service (Amazon SNS) topic
  • Amazon CloudWatch Logs log group

Explanation:

  • Lambda is perfect for event-driven tasks such as processing an image upon S3 upload.
  • The EventBridge rule can trigger a Lambda function, which then resizes and saves the image.
    Other options:
  • SQS would queue the event, but not process it.
  • SNS can notify, but doesn’t process logic.
  • CloudWatch Logs is for logging, not executing tasks.

Leave a Reply