Skip to content

Minimum AWS resources required to deploy and invoke an agent on AgentCore Runtime without agentcore-cli

0

Background

agentcore-cli relies on CDK under the hood, which requires cdk bootstrap. In organisations where bootstrap is restricted or CDK is not the approved IaC tool (e.g. Terraform shops), this is a blocker. After reading the Get started without the AgentCore CLI, I found it is possible to deploy an agent directly via the API or console without the CLI.

Question

What is the minimum set of AWS resources, IAM policies, and configuration needed to deploy a simple agent (with one tool) to AgentCore Runtime and invoke it from a client such as Lambda or ECS? Specifically I want to understand:

  1. Which IAM roles and policies are required (execution role, invocation role)?
  2. Does the container image need to follow a specific interface or protocol?
  3. What are the networking prerequisites: is a VPC required or does it work without one?
  4. Is there a minimal Terraform example or CloudFormation template available?

asked 4 months ago197 views

1 Answer
0
Accepted Answer

To deploy and invoke an agent on AgentCore Runtime without the CLI, here's what you need:

Required AWS Resources

1. IAM Roles and Policies

You need an execution role for the AgentCore Runtime itself. This role must have:

  • ECR pull permissions to retrieve your container image
  • Any permissions your agent needs to access AWS services (like invoking Bedrock models)

For invocation, the calling principal (Lambda, ECS task role, etc.) needs the bedrock-agentcore:InvokeAgentRuntime permission scoped to your specific runtime ARN. Avoid using wildcard resource statements in production.

If you're implementing cross-account access or user delegation, you'll also need resource-based policies on the runtime resource itself, which control which principals can invoke it.

2. Container Requirements

Yes, your container must follow a specific interface. It must:

  • Expose a /invocations POST endpoint for agent interactions
  • Expose a /ping GET endpoint for health checks
  • Be built for ARM64 architecture (linux/arm64 platform)
  • Be packaged as a Docker container and pushed to Amazon ECR

The container should listen on a specific port (typically configured in your deployment), and the runtime will override your container's ENTRYPOINT and CMD to manage its lifecycle.

3. Networking Prerequisites

A VPC is not required for basic deployment. AgentCore Runtime can work with a default public endpoint where both inbound and outbound traffic traverses the internet.

However, if your agent needs to access private resources (like databases in a VPC), you can configure VPC connectivity by specifying subnets and security groups during deployment. For enhanced security, you can also use AWS PrivateLink to establish private connectivity and apply resource-based policies with VPC condition keys to restrict access.

4. Deployment Process

While there isn't a pre-built Terraform or CloudFormation template in the sources, the deployment involves:

  • Building and pushing your ARM64 container image to ECR
  • Using the AWS CLI or SDK to create the AgentCore Runtime, specifying your container URI and execution role ARN
  • Optionally configuring VPC settings, environment variables, and resource-based policies

The deployment can be done programmatically using boto3 or the AWS CLI with commands like create-runtime (the exact API calls would be in the AgentCore control plane API documentation).

Security Best Practices

  • Scope all IAM permissions to specific runtime ARNs, not wildcards
  • Use resource-based policies to control which principals can invoke your runtime
  • If using VPC deployment, use IAM condition keys like bedrock-agentcore:subnets and bedrock-agentcore:securityGroups to enforce approved network configurations
  • Enable CloudTrail logging for auditing
  • Follow the principle of least privilege for all roles

This approach gives you full control over infrastructure-as-code tooling while meeting AgentCore Runtime's requirements.
Sources
Get started without the AgentCore CLI - Amazon Bedrock AgentCore
Secure multi-tenant AI agents with Amazon Bedrock AgentCore resource-based policies | AWS Security Blog
Network connectivity patterns for agents deployed on Amazon Bedrock AgentCore Runtime | Networking & Content Delivery
Security best practices for AgentCore Runtime - Amazon Bedrock AgentCore

answered 4 months ago

EXPERT

reviewed 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.