Oct 27, 20268 min read

The Best Tools for Letting AI Agents Deploy to AWS in 2026

Encore, AWS CDK with the AWS MCP servers, ECS Express Mode, Ravion, SST and GitHub Actions with OIDC, judged by one question: who holds the AWS credential when the agent's change goes live.

Most agent deploy setups fail in the same place: to deploy, the agent needs an AWS credential, and the credential that can deploy one service can usually do much more. A mistaken command, or a prompt injection in a log line, then runs with the same reach as the deploy.

The useful question for any tool is where the credential sits when the agent's change goes live. The safest setups keep it out of the agent session entirely, and give the agent a way to test its change before anyone reviews it.

What an agent deploy to AWS needs:

  • A change the reviewer can read in one diff, with the code and the infrastructure it uses together.
  • No long-lived AWS keys in the agent's terminal, and production applies done by a role the agent cannot assume.
  • A way to run the change locally first, so a broken queue shows up before the pull request.
  • A review point that sits before anything is created in the account.

AI agent deploy tools for AWS at a glance

ToolWhere the deploy credential sitsWhat the agent editsCost model
EncoreWith Encore, through an IAM role you grantApplication code with infrastructure declarationsOpen source infrastructure SDK, AWS bills resources
AWS CDK with AWS MCP serversThe agent session or CICDK stacksFree CLI, AWS bills resources
ECS Express ModeThe agent session or CIImage and service settingsNo extra charge, pay for Fargate and the load balancer
RavionRavion pipelines in your accountravion.yaml and modulesFree for one user, per module per environment
SSTThe agent session for live modeA TypeScript configOpen source, AWS bills resources
GitHub Actions with OIDCA role assumed per workflow runWorkflow filesActions minutes, no IAM charge
Compare what each tool gives an agent
CapabilityEncoreAWS CDKECS Express ModeRavionSSTGitHub Actions with OIDC
Agent holds AWS credentialsNoUsuallyUsuallyNoYesfor live modeNo
Local run of the changeencore run with Postgres, Pub/Sub and bucketscdk synth onlyDocker onlyDocker onlyLive mode against AWSNot applicable
Databases and queuesDeclared in codeWritten as constructsSeparateModulesComponentsDepends on the tool it runs
Preview before applyPull request and preview environmentcdk diffNone by defaultPlans and approval gatessst diffThe pull request
Scope of AWS it coversBackend resourcesAll of AWSOne web serviceModules for ECS, RDS, Lambda and moreComponents plus providersWhatever it runs

Encore: the agent ships code, the deploy role stays with the platform

Encore

Encore combines an open source infrastructure SDK for TypeScript and Go with a platform that deploys into your own AWS account. Databases, Pub/Sub topics, cron jobs and buckets are typed declarations in the application code. encore run starts them locally, and a deploy provisions them as RDS, SNS and SQS, and S3, with the services on ECS on Fargate or EKS.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.
Encore provisions the infrastructure your application needs in your own AWS or GCP account.

The agent never deploys anything itself. It edits code, runs it, and pushes. A change that adds an order event with an idempotent subscriber looks like this:

import { api } from "encore.dev/api"; import { Topic, Subscription } from "encore.dev/pubsub"; interface OrderPlaced { orderId: string; } // An SNS topic with an SQS subscription on AWS, Pub/Sub on GCP. export const orderPlaced = new Topic<OrderPlaced>("order-placed", { deliveryGuarantee: "at-least-once", }); export const placeOrder = api( { expose: true, method: "POST", path: "/orders" }, async (req: OrderPlaced): Promise<OrderPlaced> => { await orderPlaced.publish(req); return req; }, ); const handled = new Set<string>(); // Use a table with a unique key in production. const _ = new Subscription(orderPlaced, "send-receipt", { handler: async (event) => { if (handled.has(event.orderId)) return; // At-least-once delivery. handled.add(event.orderId); }, });

For the agent, the deploy question disappears from its session. You connect your AWS account once with an IAM role, and every push deploys through that role, which the agent cannot reach. Encore provisions an IAM role for the service, and the AWS infrastructure guide lists what gets created. Instance sizes, networking and backups are configured per environment, outside the code the agent edits. Before pushing, the agent calls placeOrder locally and reads the trace through the local MCP server to confirm the subscriber ran.

Key features

  • Pub/Sub, Postgres, cron jobs, object storage and secrets declared in code and validated at build time.
  • encore run starts the infrastructure locally, so the agent tests the whole flow before the pull request.
  • Deploys to ECS on Fargate or EKS in your AWS account, or to GCP from the same code.
  • A preview environment with its own infrastructure for each pull request.
  • Local and cloud MCP servers for traces, schemas and deploy status.
~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders
An agent adds receipt storage to an orders service and tests it locally with encore run. The same bucket declaration is used in preview environments and production.

Good to know

Apps are written with Encore's SDK, so existing Express or FastAPI services are ported rather than deployed as they are. Resources outside its primitives, such as a DynamoDB table, stay with your existing tools.

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

AWS CDK with the AWS MCP servers: full AWS reach, with credentials in the loop

AWS CDK

The CDK lets an agent describe any AWS resource as a typed construct, and the AWS Documentation MCP server keeps it from inventing properties. The agent loop is edit, cdk synth to catch construct errors, cdk diff to show the change set, then a deploy through CloudFormation, which rolls back a failed update.

Against the credential question, the CDK is neutral: it deploys with whatever role runs it. If that is the agent's terminal, the agent can deploy any stack those credentials reach. Run cdk deploy from CI and the agent stops at the diff, but it still writes the VPC, IAM and database code a reviewer has to read on every change.

Good to know: there is no local runtime for the resources a stack defines.

ECS Express Mode: one container to a URL, nothing else

ECS Express Mode

ECS Express Mode, launched in November 2025, turns a container image into a Fargate service with a load balancer, HTTPS, auto scaling and an AWS-provided URL. It needs the image, a task execution role and an infrastructure role, and can be called from the console, the AWS CLI, an SDK, CloudFormation, Terraform or the AWS Labs MCP server for ECS. Services with the same networking share a load balancer, up to 25 per balancer.

For agents, it shrinks the deploy to one call, and that call still needs credentials. It covers a stateless web service: the database, queue or scheduled job the code also needs is created another way.

Ravion: Terraform modules behind approval gates

Ravion

Ravion, the successor to Flightcontrol, keeps deploys inside pipelines that run in your AWS account. The agent edits ravion.yaml, Ravion plans the change to its Terraform-backed modules for ECS, RDS, Lambda, S3 and more, and an approval step sits before infrastructure changes. That answers the credential question well: the agent edits config, and the pipeline holds the role.

Good to know: there is no automatic migration from Flightcontrol, and infrastructure lives in modules next to the app rather than in it.

SST: live mode puts AWS credentials in the session

SST

SST defines AWS resources in a TypeScript config with components for functions, containers, queues and cron. Its live dev mode runs functions locally against real AWS resources, which gives the agent fast feedback and also means the agent's terminal holds AWS credentials for every dev session.

Good to know: check recent releases before starting a new project on it.

GitHub Actions with OIDC: the deploy step that keeps keys out of the agent

GitHub Actions

Whichever tool builds the change, OIDC from CI is the cleanest answer for the apply step. The workflow exchanges its OIDC token for a short-lived session on an IAM role whose trust policy names the repository and branch, and the agent's part ends at the pull request.

It moves the credential, and it does not shrink what the agent writes. Review depth depends on the tool the workflow runs.

Guardrails that apply to every option

Service control policies in AWS Organizations cap what any role in an account can do, which makes a separate sandbox account a cheap safety net. The OWASP Top 10 for LLM applications lists excessive agency as a core risk, and the AWS Well-Architected Framework security pillar covers the roles your pipeline assumes.

How to choose

  • Encore when agents write backend changes that need databases and queues, and you want them tested locally and deployed to your own AWS account through a role the agent never sees.
  • AWS CDK with the AWS MCP servers when your team wants typed control over every AWS resource and reviews every diff.
  • ECS Express Mode for putting a single container on an HTTPS URL quickly.
  • Ravion for Terraform-backed modules in your account with approval gates.
  • SST for teams with existing SST apps that lean on Lambda.
  • GitHub Actions with OIDC as the apply step behind any infrastructure as code tool.

Frequently asked questions

What is the safest way to let an AI agent deploy to AWS?

Keep AWS credentials out of the agent session. The agent changes code or infrastructure definitions in a pull request, and a system that holds the deploy role applies the change after review, either a platform such as Encore or a CI pipeline that assumes an IAM role through OIDC.

Can Claude Code or Cursor deploy to AWS directly?

Yes, if the terminal has AWS credentials, through the AWS CLI, the CDK or an MCP server such as the AWS API MCP Server. That works for a sandbox account. For production, the agent should open a pull request and let a pipeline or platform deploy it.

How does an agent deploy a queue to AWS with Encore?

The agent declares a Topic and a Subscription from encore.dev/pubsub in the service code, tests the flow locally with encore run, and pushes. On deploy, Encore provisions SNS and SQS in your AWS account with the IAM role you granted, and the agent never holds an AWS credential.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders