


SAP-C02 AWS Certified Solutions Architect – Professional
Exam Practice Test Course
Free Sample Question 1 out of 3:
A company wants to build a highly scalable, event-driven architecture to process EC2 instance state change notifications across multiple AWS accounts. They need a central account to receive and process these notifications. The primary goal is to avoid polling EC2 instances directly or relying on custom Lambda functions to check for changes. Which of the following approaches best meets these requirements using AWS services?
A. In each source AWS account, create a Lambda function that polls EC2 instances for state changes and then sends a custom event to an SNS topic in the central account.
B. In the central AWS account, configure EventBridge to receive events from source accounts by creating EventBridge rules in the source accounts that target the central account's event bus, and set up an SQS queue in the central account as a target for these events.
C. In each source AWS account, create CloudWatch Alarms for EC2 state changes and configure these alarms to send notifications to an SNS topic in the central account.
D. In each source AWS account, create EventBridge rules to capture EC2 instance state change events and have these rules directly send the events to an SQS queue in the central account.
Correct Answer: B
Explanation:
Option B correctly leverages Amazon EventBridge for centralized event processing and cross-account event routing. In the source accounts, EventBridge rules would be configured to capture EC2 instance state change events. These rules would be set up to send events to the central account's EventBridge event bus. The central account's event bus would then have a resource policy allowing event puts from the source accounts. Finally, an EventBridge rule in the central account would capture these incoming events and deliver them to an SQS queue for processing, fulfilling the requirement of an event-driven architecture without polling.
Free Sample Question 2 out of 3:
A mobile application uses Amazon Cognito User Pools for user authentication and Amazon Cognito Identity Pools (Federated Identities) to grant users access to AWS services. The application needs to allow authenticated users to upload and download their private documents to a dedicated S3 bucket. Each user should only be able to access their own documents, adhering to the principle of least privilege. Which of the following solutions provides the most secure and scalable approach for managing user-specific document storage in S3?
A. Configure an IAM policy for the S3 bucket that grants `s3:PutObject` and `s3:GetObject` to all authenticated users, relying on the application's backend server to validate the user's identity and then generate pre-signed URLs for S3 access to specific user prefixes.
B. Store all user files in a single S3 folder (e.g., `s3://your-bucket/user-files/`). The mobile application would retrieve a list of all files in this folder and filter them on the client-side based on the logged-in user's ID to display only their own documents.
C. Utilize Amazon Cognito Identity Pools to provide temporary, limited-privilege AWS credentials to authenticated users. Attach an IAM policy to the authenticated role, allowing `s3:PutObject` and `s3:GetObject` actions only on objects within a specific S3 prefix (e.g., `s3://your-bucket/private/${cognito-identity.amazonaws:sub}/*`) by using the `cognito-identity_amazonaws:sub` principal tag in the IAM policy's `Condition` and `Resource` elements. The client application then uses these temporary credentials to directly interact with S3.
D. Use Cognito User Pools for authentication and then a custom AWS Lambda function that retrieves user-specific files from S3 and sends them to the client. The Lambda function would have an IAM role with full S3 access, mediating all user file operations.
Correct Answer: C
Explanation:
Option C is the most secure and scalable solution. It correctly leverages Amazon Cognito Identity Pools to grant temporary, limited-privilege AWS credentials directly to the client application. The key aspect is the IAM policy attached to the authenticated role, which uses the `cognito-identity.amazonaws:sub` (representing the user's unique identity ID) within the `Condition` and `Resource` elements to restrict access to a user-specific S3 prefix (e.g., `s3://your-bucket/private/${cognito-identity.amazonaws:sub}/*`). This adheres to the principle of least privilege and allows for direct, secure S3 access from the client, eliminating the need for an intermediary backend server for file operations.
Option A introduces a backend server intermediary for generating pre-signed URLs, which adds complexity, potential latency, and an additional point of failure compared to direct S3 access with temporary credentials. While pre-signed URLs can be secure, the direct IAM policy approach is often more efficient for continuous user-specific file operations.
Option B is a major security vulnerability. Relying on client-side filtering for access control is insecure because client-side logic can be bypassed. Users could potentially access files belonging to other users if they manipulate the client application or make direct S3 API calls. Permissions must be enforced at the service level via IAM policies.
Option D introduces an unnecessary intermediary (AWS Lambda function) for every file operation. This increases cost, latency, and complexity, and it doesn't leverage the direct S3 access capabilities provided by Cognito Identity Pools for clients. It also centralizes S3 access through a single Lambda role, which might have broader permissions than necessary for each individual user's specific files, potentially violating least privilege if not meticulously managed.
Free Sample Question 3 out of 3:
A software development team is building a new serverless data processing pipeline that involves multiple sequential and stateful steps. The pipeline needs to ingest data from an S3 bucket, perform a series of data transformations and validations using various AWS Lambda functions, and then store the processed data in an Amazon DynamoDB table. The team requires a solution that can manage the entire workflow, including complex step-by-step orchestration, built-in error handling with retry logic, and conditional branching, all while being fully managed and highly scalable with minimal operational overhead. Which AWS service is best suited for orchestrating this complex, stateful, and sequential workflow?
A. AWS Step Functions
B. AWS Lambda
C. AWS Batch
D. AWS Glue
Correct Answer: A
Explanation:
AWS Step Functions is the ideal service for orchestrating complex, sequential, and stateful workflows involving multiple AWS services. It allows developers to define workflows as state machines, where each step can invoke a Lambda function, run a Fargate task, interact with SQS/SNS, and more. Step Functions provides built-in mechanisms for error handling, automatic retries, parallel execution, and conditional logic, making it perfect for managing multi-step processes like the described data pipeline. It is serverless and fully managed, ensuring high scalability and minimal operational overhead.
Incorrect Options:
B. AWS Lambda is a serverless compute service excellent for running individual, short-lived functions. While it can be a component within a workflow, Lambda itself does not provide the state management, orchestration capabilities, or complex error handling mechanisms needed to manage an entire multi-step, stateful pipeline across different services. You would have to build extensive custom logic within Lambda to manage state and sequence, which defeats the purpose of an orchestration service.
C. AWS Batch is designed for running high-throughput batch computing workloads efficiently across a fleet of EC2 instances or Fargate. It is best suited for executing many independent or array jobs, often involving compute-intensive tasks. It does not primarily offer the high-level workflow orchestration, state management, or complex sequential flow control with integrated error handling between diverse service types as required for this scenario.
D. AWS Glue is an ETL (Extract, Transform, Load) service that is excellent for preparing and transforming data for analytics. While AWS Glue Workflows can orchestrate a series of Glue jobs and other tasks, its primary focus is on data processing within the ETL context. AWS Step Functions offers a more general-purpose, flexible, and powerful orchestration engine for coordinating any AWS service in a stateful workflow, including complex branching logic and long-running processes that extend beyond just ETL job execution.