How Do You Securely Give a Private-Subnet App Cognito-Based S3 Access?
Short answer
AC Create a Cognito identity pool to issue temporary AWS credentials, and add an S3 gateway VPC endpoint so S3 traffic stays on the AWS network.
Question
Key Takeaways
This question tests the Cognito user pool versus identity pool distinction and private-subnet S3 connectivity; the trap is assuming the existing user pool can mint S3 access tokens on its own.
A private-subnet application already authenticates users with an Amazon Cognito user pool and now needs secure per-user access to Amazon S3. The correct combination is to add a Cognito identity pool for temporary AWS credentials and an S3 VPC endpoint so traffic never leaves the AWS network (A and C).
Common mistake: Choosing option B — reusing the existing Cognito user pool to generate S3 access tokens. User pools only authenticate users and issue OIDC/JWT tokens; they never vend AWS credentials, which is exactly what an identity pool does by exchanging those tokens for temporary, IAM-scoped credentials.
Expert Analysis
Why the Answer Is Correct
Option A is required because an Amazon Cognito identity pool is the component that exchanges the user pool's authentication tokens for temporary AWS credentials, which are then scoped by an IAM role to the specific S3 prefixes each user may read or write. Option C completes the secure integration: a gateway VPC endpoint for Amazon S3 keeps all traffic between the private subnet and the bucket on the AWS network, so documents are never exposed over the public internet and no NAT gateway is needed for S3. As LeonSauveterre put it, "Identity pools are for authorization" — that authorization layer plus private connectivity is precisely what the question asks for. The combination also aligns with the AWS guidance linked by bujuman to the identity pools and S3 interface/gateway endpoint documentation. Together A and C satisfy both halves of the requirement: authenticated users get least-privilege S3 credentials, and the private-subnet application reaches S3 securely.
Why the Other Options Are Wrong
Option B fails because a user pool issues ID, access, and refresh tokens for your application, not AWS credentials — it cannot generate Amazon S3 access tokens for users. Option D is wrong on two counts: a NAT gateway only provides outbound internet access rather than security, and an S3 bucket policy cannot meaningfully deny requests based on "initiated from Amazon Cognito." Option E is unworkable because user IP addresses are dynamic and untrusted, and an IP-allowlist policy would also break legitimate users on mobile or corporate networks while granting anyone sharing that address access to the documents. Only A and C address authentication-to-authorization and network path respectively.
Community Comment Notes
The community consensus in this thread is overwhelmingly AC, with the highest-voted comment by bujuman supplying the official Cognito identity pools page plus the S3 VPC endpoint documentation to justify both choices. LeonSauveterre adds the cleanest mental model, noting that "User pools are for authentication (who the user is). Identity pools are for authorization (what the user can do)." FlyingHawk similarly explains that identity pools produce temporary AWS credentials so only authenticated users can upload or retrieve documents. One learner dissented with "respuesta correcta: A - B," but B is the classic distractor: the existing user pool authenticates users but cannot issue AWS credentials, so that pairing would leave the application without any temporary S3 credentials.
Official Reference
- https://docs.aws.amazon.com/cognito/latest/developerguide/identity-pools.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html#types-of-vpc-endpoints-for-s3
These links open the official vendor documentation in a new tab.
Exam Strategy
Read the phrase "securely integrate Amazon S3" as a two-part signal: one option must establish per-user AWS credentials and one must establish a private network path. If you see an option that reuses a Cognito user pool for AWS credentials, eliminate it immediately — user pools authenticate, identity pools authorize.
Frequently Asked Questions
Why can't the existing Cognito user pool generate S3 access tokens?
Is the S3 VPC endpoint really needed in this private-subnet scenario?
Community Votes
100% of anonymous learners picked answer AC. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 4 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 4
-
bujuman 👍 7securely integrate Amazon S3 with the application: https://docs.aws.amazon.com/cognito/latest/developerguide/identity-pools.html https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html#types-of-vpc-endpoints-for-s3
-
LeonSauveterre 👍 2A - Amazon Cognito identity pools provide temporary AWS credentials for authenticated users. B - User pools are for authentication (who the user is). Identity pools are for authorization (what the user can do). C - Traffic between your VPC and S3 stays within the AWS network, good. This also removes the need for a NAT Gateway for S3 access. D - Unnecessary and not secure. E - Users' IP addresses can change frequently (especially mobile users).
-
FlyingHawk 👍 1An Amazon Cognito identity pool allows you to generate temporary AWS credentials (e.g., access tokens) for authenticated users. These credentials can be used to securely access AWS services like Amazon S3. By creating an identity pool, the application can generate secure Amazon S3 access tokens for users after they successfully log in, ensuring that only authenticated users can upload or access documents in the S3 bucket.
-
viejito 👍 2respuesta correcta : A - B
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SAA-C03 Questions
Access 120 questions with complete answers and detailed explanations.
View Full SAA-C03 Practice Test →