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?
3 Answers
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.
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.
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.
Thanks, I’ll compare on-demand and provisioned throughput and check the current model-specific rates.

That makes sense. I’ll look into the required permissions and regional model availability before trying it.