How does Amazon Bedrock access and pricing work from an EC2 instance?

September 16, 2026 3 answers
Asked by neutron.flux
I'm learning about Amazon Bedrock and want to connect it to an application running on an EC2 instance. My understanding is that I can attach an IAM role to the instance profile, grant the necessary Bedrock permissions, and then use an AWS SDK from the application to send prompts to a supported foundation model. Is that generally correct? Also, how does Bedrock charge for model usage, and what should I watch out for when controlling costs?

Answers

7 quiet minutes
Pricing depends on the model and how you use it. On-demand inference is generally billed based on the input and output tokens processed, with rates varying by model. Bedrock also has options such as batch inference and provisioned throughput, which use different pricing models. Custom models or deployments may add storage or dedicated-capacity charges, so check the current pricing page for the exact model.

neutron.flux: Thanks, Iโ€™ll compare on-demand and provisioned throughput and check the current model-specific rates.

Reply to this answer
ledger.A7
Your understanding is mostly right. An application on EC2 can use the instance profileโ€™s IAM role to call Bedrock through an AWS SDK, as long as the role has the required permissions and the selected model is available in the relevant region. Keep the permissions as narrow as possible rather than granting broad access.

neutron.flux: That makes sense. Iโ€™ll look into the required permissions and regional model availability before trying it.

Reply to this answer
hinge+socket
Set up cost controls before sending production traffic. Use tightly scoped IAM policies, application-level request limits, logging, and AWS budgets or billing alerts. Also remember that a compromised EC2 instance could use its role to generate unexpected Bedrock charges, so security and monitoring are important.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions