AWS

Work with AWS from an agent through per-project AWS connections — one MCP server per connection, pinned to a named identity.

1 command · 1 skill

Work with AWS from an agent: inspect and manage resources, chain API calls in a sandboxed script, search AWS documentation, and load curated AWS skills — through AWS’s managed AWS MCP Server, one instance per configured connection.

What it does

Ships one skill (devbot:aws), vendors AWS’s own agent-toolkit-for-aws skills, and wires the AWS MCP Server into the harness — one server per connection, named aws-<connection>.

An AWS connection is a named identity plus a region. Connections are declared once in .devbot.global.jsonc and each project opts in by name, so a machine can hold several AWS identities (a production read-only one, a dev one, another account) and a project sees only the ones it selected. devbot init/reinit wires and prunes the servers, and nothing is prompted at install time.

Credentials

Authentication is non-interactive: no aws login, no aws sso login, no browser.

Form Where the keys live Note
env values, or ${VAR} references the launcher resolves from the shell environment and the repo .env, handed to the server process through its environment (never the command line, which is visible in ps) fixes the identity to that exact key pair
profile the shared AWS config — ~/.aws/config, or the keys in ~/.aws/credentials nothing credential-shaped enters dev-bot config

Use a ${VAR} reference for anything secret: a literal value in the config is convenient for non-secret settings, but a literal secret sits in a file.

The env block’s keys are the names the AWS SDK reads — normally AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY — and its values are literals or ${VAR} references to your own shell variables. The launcher exports each pair verbatim, so a connection-specific variable name belongs on the right-hand side, never in the key.

A bare aws sts get-caller-identity does not see the referenced variables. To verify a connection by hand, map the references onto the standard names and clear the ambient profile and session token:

AWS_ACCESS_KEY_ID="$AWS_PROD_RO_ACCESS_KEY_ID" \
  AWS_SECRET_ACCESS_KEY="$AWS_PROD_RO_SECRET_ACCESS_KEY" \
  env -u AWS_PROFILE -u AWS_SESSION_TOKEN aws sts get-caller-identity

Declaring both forms is rejected — credential precedence would be ambiguous. An optional account_id turns the identity into a checked property: the launcher calls sts get-caller-identity and refuses to start when the reported account differs.

Read-only is an IAM property

The module imposes no read/write restriction; the server exposes the full AWS API surface. Read-only is the IAM policy on the connection’s identity — run it as a least-privilege (ideally read-only) role. The connection pin covers the MCP path only: an agent with shell access can reach AWS directly with whatever credentials the machine holds, so least privilege plus a permission boundary (or SCP) is the control that actually holds.

Setting up the identity

Read-only access is an IAM property, so the identity has to exist before a connection can use it. The steps below produce one IAM user with a key pair — the AWS equivalent of a service account. (A role has no keys of its own; it is assumed. To use that model instead, give the connection a profile with role_arn + source_profile rather than an env block.)

1. Create the policy. IAM → Policies → Create policy → JSON:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AwsConfigRead",
      "Effect": "Allow",
      "Action": ["eks:ListClusters", "eks:DescribeCluster", "eks:ListNodegroups", "eks:DescribeNodegroup", "eks:ListUpdates", "eks:DescribeUpdate", "eks:ListAddons", "eks:DescribeAddon", "eks:DescribeAddonVersions", "eks:ListIdentityProviderConfigs", "eks:DescribeIdentityProviderConfig", "ec2:Describe*", "rds:Describe*", "rds:ListTagsForResource", "elasticache:Describe*", "elasticache:ListTagsForResource", "es:ListDomainNames", "es:DescribeDomains", "es:DescribeDomainConfig", "es:ListTags", "s3:ListAllMyBuckets", "s3:GetBucket*", "s3:GetAccountPublicAccessBlock", "tag:GetResources"],
      "Resource": "*"
    },
    {
      "Sid": "S3DataRead",
      "Effect": "Allow",
      "Action": ["s3:ListBucket", "s3:ListBucketVersions", "s3:GetObject", "s3:GetObjectVersion", "s3:GetObjectTagging"],
      "Resource": ["arn:aws:s3:::REPLACE-WITH-BUCKET", "arn:aws:s3:::REPLACE-WITH-BUCKET/*"]
    },
    {
      "Sid": "OpenSearchDataRead",
      "Effect": "Allow",
      "Action": ["es:ESHttpGet", "es:ESHttpHead", "es:ESHttpPost"],
      "Resource": "arn:aws:es:eu-central-1:REPLACE-ACCOUNT-ID:domain/REPLACE-DOMAIN-NAME/*"
    },
    {
      "Sid": "OpenSearchServerlessRead",
      "Effect": "Allow",
      "Action": ["aoss:ListCollections", "aoss:BatchGetCollection", "aoss:APIAccessAll"],
      "Resource": "*"
    }
  ]
}

Narrow S3DataRead to the buckets you actually need — as written it reads every object in the account. aoss:APIAccessAll must stay "*". es:ESHttpPost is there because OpenSearch clients send searches as POST; it is method-wide, so the domain-side gate in step 5 is what actually keeps the access read-only. Drop the Serverless statement unless you use OpenSearch Serverless.

2. Create the group and the user. IAM → User groups → create devbot and attach the policy. Then IAM → Users → create e.g. devbot-readonly with no console access, and add it to that group. The group is what the key inherits, so members can rotate without touching permissions.

3. Create the access key. Open the user → Security credentials → Access keys → Create access key → “Application running outside AWS”. The use case only changes the console’s guidance; the key pair is identical whichever you pick (the exception is “running on an AWS compute service”, which offers a role instead — never hold static keys on a workload that can assume one). Copy the Access key ID and the Secret access key; the secret is shown once, and a user can hold at most two keys.

Bulk provisioning. tools/create-devbot-users.sh <person>… does steps 2 and 3 for several names in one pass: it creates devbot-<person> (lowercased), adds it to devbot, issues one access key and prints it once — the same rows also land in a mode-600 CSV in the current directory. --dry-run shows the plan without changing anything; --group targets another group. It needs an admin identity — the users it creates deliberately cannot.

4. Hand the values to the connection. Put them in the repo-root .env (gitignored — the launcher and the datasources renderer both load it) under the names the connection references:

AWS_PROD_RO_ACCESS_KEY_ID=AKIA…
AWS_PROD_RO_SECRET_ACCESS_KEY=…

5. OpenSearch needs a second gate. IAM permission alone is not enough: the domain must allow the principal too. Add the user (or the group) to the domain’s access policy, or — with fine-grained access control, which is what makes this genuinely read-only despite es:ESHttpPost — map it to a backend role with read-only index permissions. A correct IAM policy that still returns 403 on search almost always means this step is missing.

One memory file, and only on a wired project. When the project selects a connection that is actually wired into a harness, init.sh writes <devbot_dir>/memory/active/modules/aws.md: the rule to use the aws-<connection> MCP servers and never the aws CLI, followed by AWS’s own aws-agent-rules.md. Those rules come from aws/agent-toolkit-for-aws at the commit pinned in versions.env.dist (the machine’s gitignored versions.env is what devbot update bumps, so upstream main never moves them silently), and init.sh fetches them itself when they are missing rather than leaving a wired project without them. A project with no wired server gets no file, and a stale one is removed on the next init while the module is enabled — a reinit clears it too. It is machine-local bootstrap content, not project source: the DEVBOT - module memory section devbot init writes to .gitignore keeps it out of the project’s history.

Contents

Type Name Purpose
Command aws-setup Set up AWS for dev-bot — install the prerequisites and declare connections with static credentials
Skill aws Use when working with AWS through a configured connection — reading or managing AWS resources, sandboxed scripts, IaC (CDK/CloudFormation), serverless, containers, or when AWS credentials or region are needed. Triggers on ‘aws’, a service name like EC2, S3, Lambda, EKS, RDS or ElastiCache, an ARN, or an account id.

Configuration

Key Where Meaning
aws_connections .devbot.global.jsonc catalogue of connections — a name mapped to region, plus env (values or ${VAR}) or profile, and an optional account_id
aws_connections .devbot.project.jsonc list of connection names this project opts into

The aws module must also be enabled (modules.aws: true). The shipped global template defaults it to false, and a disabled module’s init never runs — aws_connections alone registers nothing. Init now warns when connections are declared while the module is disabled.

A connection that is declared but not selected is not wired; a selected connection that is not declared is not wired either — it warns and is skipped, since a manifest for it would register a server that cannot start.

Each generated opencode manifest ships the server with enabled: false (wired but not started), matching the other gateway modules — flip it to true in opencode.jsonc to start it, or toggle it in the harness.

install.sh installs the AWS CLI, uv and the mcp-proxy-for-aws-cli uv tool, and fetches AWS’s agent rules at the pinned ref when they are missing; update.sh moves that pin to upstream main and re-fetches. up.sh verifies each declared connection’s credentials and pinned account, and never logs in.

See also