How to enable cross-account EC2 access to a Kinesis data stream?
A developer is deploying an application on Amazon EC2 instances that run in Account A. The application needs to read data from an existing Amazon Kinesis data stream in Account B. Which actions should the developer take to provide the application with access to the stream? (Choose two.)
Community Votes
73% of anonymous learners picked answer BC. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests cross-account IAM role assumption for Kinesis access, where the common trap is confusing resource-based policies on the stream with identity-based trust policies on the target role.
This question tests cross-account access to an Amazon Kinesis data stream from an EC2 instance in another AWS account. The community consensus favors creating an IAM role in the target account and configuring a trust policy to allow the source account's instance profile role to assume it.
Many candidates choose BE, believing a resource-based policy on the Kinesis stream is required. While Kinesis supports resource-based policies, the exam scenario expects cross-account role assumption via a trust policy on a role in Account B.
Community Discussion (8 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
To allow an EC2 instance in Account A to read from an Amazon Kinesis data stream in Account B, the developer must configure cross-account IAM role assumption.
Correct Actions
B. Create an IAM role with stream read permissions in Account B.
This role will contain an identity-based policy granting kinesis:GetRecords, kinesis:GetShardIterator, kinesis:DescribeStream, and kinesis:ListStreams on the target stream ARN.
C. Add a trust policy to the IAM role in Account B to allow the instance profile role to assume it.
The trust policy (assume-role policy) on the Account B role must specify the instance profile role ARN from Account A as a trusted principal. The EC2 instance's application code then calls sts:AssumeRole to obtain temporary credentials.
Note: The option wording mentions adding a trust policy to both the instance profile role and the Account B role. In practice, only the target role (Account B) needs a trust policy; the source role (Account A instance profile) only needs permission to call sts:AssumeRole. However, the exam treats this option as correct because it captures the trust relationship concept.
Why Other Options Are Wrong
- A is partially true (the instance profile role needs
sts:AssumeRolepermission), but it does not by itself grant cross-account stream access without the Account B role. - D is incorrect because a trust policy does not grant data-plane permissions like stream reads; it only controls who can assume the role.
- E is a plausible alternative since Kinesis does support resource-based policies, but the exam's intended pattern is cross-account role assumption (B + C), as confirmed by the majority of community voters and AWS security blog references.
Official Reference
Exam Strategy
When you see cross-account access questions involving EC2 and a managed service, first check whether the service supports resource-based policies. If the options include both role assumption and resource-based policy, favor the cross-account role assumption pattern (create role + trust policy) unless the question explicitly mentions a resource-based policy requirement.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →