I'm looking into integrating an application with Amazon Bedrock. My current understanding is that I can attach an IAM role to the EC2 instance profile, allowing applications running on that instance to use an AWS SDK and send requests to a selected foundation model in Bedrock. Is that generally correct? Also, how are Bedrock costs calculated, and what should I watch out for when controlling usage and expenses?
3 Answers
For on-demand inference, the usual pricing is based on the number of input and output tokens processed, although the exact rate depends on the model. Custom models can also involve storage or hosting costs. Provisioned throughput is priced differently and can cost more if you do not use the reserved capacity consistently, so compare the options based on your expected request volume.
That setup is generally correct. An application on EC2 can use the instance’s IAM role through the AWS SDK, as long as the role has the appropriate Bedrock permissions and the model is available in the selected AWS Region. Keep the permissions as limited as possible rather than granting broad access.
Before deploying this, set up AWS Budgets, usage alerts, and sensible application-side limits. Restrict which models and Regions the role can use, validate requests, and monitor token usage. A misconfigured role or an exposed application can generate a surprisingly large bill, so treating IAM and cost controls as part of the initial design is worthwhile.

That makes sense. I’ll look into budgets, limits, and restricting the IAM role before connecting the application.