A Lambda function must run a SQL statement on Amazon Redshift without managing database drivers or persistent connections. What should it call?
- Exam domain
- Data Operations and Support22% of the exam
- Difficulty
- Medium
- In this mock
- 21 questions on this domainPractise this domain
Why the exam asks this
Task Statement 3.1: Automate data processing by using AWS services.
Objective in the exam guide: Call SDKs to access Amazon features from code.
Serverless pipelines often need to run SQL. The Data API removes driver and connection management, which suits Lambda well.
Why D is the answer
The Amazon Redshift Data API through the AWS SDK
The Redshift Data API runs SQL over HTTPS through the AWS SDK, with no drivers or persistent connections.
Remember: SQL on Redshift from code without drivers: the Redshift Data API via the SDK.
How it works
The AWS SDKs let code call AWS services, such as starting a Glue job or running SQL on Redshift.
The Amazon Redshift Data API runs SQL statements over HTTPS, with no database drivers or persistent connections.
Calls are asynchronous: you submit a statement, then check its status and fetch results.
Clues in the question
The words that point to the answer, and what each one tells you.
- Without managing database drivers or persistent connections
- The Data API.
In detail
- Data API calls are asynchronous: submit a statement, then fetch its status and results.
- Authentication uses IAM or Secrets Manager.
Side by side with look-alikes
| Option | Drivers needed? |
|---|---|
| Redshift Data API | No |
| JDBC with pool | Yes |
| Athena | Queries S3, not Redshift |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. A JDBC driver bundled with a connection poolWrongMost tempting
Drivers and connection pools are what the requirement wants to avoid.
Why it tempts: JDBC is the standard way to run SQL from code. But it needs drivers and connections, which the requirement rules out.
B. Amazon SESWrong
SES sends email.
C. Amazon AthenaWrong
Athena queries S3, not Redshift tables.
D. The Amazon Redshift Data API through the AWS SDKRight
SQL on Redshift from code without drivers: the Redshift Data API via the SDK.
In practice
- Use Secrets Manager or IAM for Data API authentication.
Use case
An illustrative scenario, not a real incident.
A Lambda function calls ExecuteStatement to refresh a summary table, then polls for completion.
See how it works
sequenceDiagram participant L as Lambda participant D as Redshift Data API L->>D: ExecuteStatement D-->>L: Statement ID L->>D: DescribeStatement D-->>L: FINISHED L->>D: GetStatementResult
How to read this chart
- 1. Lambda sends "ExecuteStatement" to Redshift Data API.
- 2. Lambda gets a reply from Redshift Data API: "Statement ID".
- 3. Lambda sends "DescribeStatement" to Redshift Data API.
- 4. Lambda gets a reply from Redshift Data API: "FINISHED".
- 5. Lambda sends "GetStatementResult" to Redshift Data API.