PluginWorks in Claude CodeCurrent
Deploy on aws
Deploy applications to AWS with architecture recommendations, cost estimates, and IaC deployment.
0
Try it
See what this would do for you. No sign-up needed.
Runs shell commands (hooks)
This plugin runs commands on your computer when Claude Code reaches certain events. Read its hooks before you install it.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install deploy-on-aws@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
3 skills
- aws-architecture-diagram
- deploy
- elastic-beanstalk
1 hook
3 MCP servers
Security scan
Passed
Promptu's text scan of the files it could read didn't match any known risky patterns. It doesn't run the plugin, and a clean scan doesn't mean the plugin is safe.
Automated pattern check of 14 file(s) found nothing risky. Not a full audit.
Details
# Deploy on AWS Plugin
Deploy applications to AWS with architecture recommendations, cost estimates, IaC deployment, and validated architecture diagrams.
## Overview
This plugin provides two skills: infrastructure deployment with cost estimation, and AWS architecture diagram generation as draw.io XML with official AWS4 icons.
## Skills
| Skill | Description |
| -------------------------- | ----------------------------------------------------------------------------------------------------- |
| `deploy` | Analyze codebases, recommend AWS services, estimate costs, and generate CDK/CloudFormation IaC |
| `aws-architecture-diagram` | Generate validated draw.io architecture diagrams with AWS4 icons, step legends, and dark mode support |
## MCP Servers
| Server | Description |
| -------------- | ------------------------------------------------- |
| `awsiac` | AWS IaC best practices and patterns |
| `awsknowledge` | Architecture guidance and service recommendations |
| `awspricing` | Real-time AWS pricing data for cost estimation |
## Installation
```bash
/plugin marketplace add awslabs/agent-plugins
/plugin install deploy-on-aws@agent-plugins-for-aws
```
## Prerequisites
- Python 3.9+
- `defusedxml` — required for diagram XML validation: `pip3 install defusedxml>=0.7.1`
- AWS CLI with configured credentials (for deployment skills)
- [draw.io desktop](https://www.drawio.com/) (optional, for PNG/SVG/PDF export)
## Examples
- "Deploy my app to AWS"
- "Estimate AWS costs for this project"
- "Generate an architecture diagram for a serverless REST API"
- "Create a sketch-mode diagram of my IoT pipeline"
- "Analyze my codebase and generate an architecture diagram"
## Files
- `skills/deploy/SKILL.md` — Infrastructure deployment workflow
- `skills/aws-architecture-diagram/SKILL.md` — Diagram generation skill
- `skills/aws-architecture-diagram/references/` — Style guides, templates, and example diagrams
- `scripts/validate-drawio.sh` — PostToolUse hook for diagram validation
- `scripts/lib/` — Post-processing pipeline (icon colors, badge placement, legend sizing)
- `scripts/requirements.txt` — Python dependencies
## License
Apache-2.0
## skills/aws-architecture-diagram/SKILL.md
---
name: aws-architecture-diagram
description: "Generate validated AWS architecture diagrams as draw.io XML using official AWS4 icon libraries. Use this skill whenever the user wants to create, generate, or design AWS architecture diagrams, cloud infrastructure diagrams, or system design visuals. Also triggers for requests to visualize existing infrastructure from CloudFormation, CDK, or Terraform code. Supports two modes: analyze an existing codebase to auto-generate diagrams, or brainstorm interactively from scratch. Exports .drawio files with optional PNG/SVG/PDF export via draw.io desktop CLI."
argument-hint: "[describe your architecture or say 'analyze' to scan codebase]"
allowed-tools: Bash, Write, Read, Glob, Grep
user-invocable: true
---
You are an AWS architecture diagram generator that produces draw.io XML files with official AWS4 icons. The diagrams you produce MUST match the style of official AWS Reference Architecture diagrams — professional title and subtitle, teal numbered step badges with a right sidebar legend, 48x48 service icons inside colored category containers, clean Helvetica typography, and clear data flow.
## Workflow
### Step 1: Determine Mode
**Mode A — Codebase Analysis:** If the user says "analyze", "scan", "from code", or references their existing project:
1. Scan for infrastructure files: CloudFormation (`AWSTemplateFormatVersion`, `AWS::*`), CDK (`cdk.json`, construct definitions), Terraform (`resource "aws_*"`)
2. Extract services, relationships, VPC structure, and data flow direction
3. If NO AWS infrastructure files found, scan for non-AWS technologies: Dockerfiles, database configs, API integrations, ML frameworks (pytorch, tensorflow, coreml), message brokers (kafka, rabbitmq). Map discovered technologies using `references/general-icons.md`
4. For MIXED architectures (AWS + non-AWS): use AWS icons for AWS services, general icons for non-AWS. Same layout rules apply.
5. Confirm discovered architecture with user before generating
6. Ask which diagram type best represents the architecture
**Mode B — Brainstorming:** If the user describes an architecture or says "brainstorm"/"design"/"from scratch":
1. Ask 3-5 focused questions (purpose, services, scale, security, traffic pattern)
2. Propose the architecture with service recommendations and data flow
3. Iterate if needed, then generate
### Step 2: Styling Selections
These are independent of Mode and apply after mode selection:
- **Sketch mode**: Activated ONLY if user says "sketch", "hand-drawn", or "sketchy". Default: OFF (Helvetica, no sketch attributes). See Sketch Mode in Style Rules below.
- **Legend panel**: Activated by default for 7+ services or multiple branching paths. Disabled ONLY if user says "no legend", "without legend", "skip steps", or "no sidebar".
- **Export format**: Check for format keywords (png, svg, pdf). Default: `.drawio` only.
### Step 3: Generate Diagram XML
**Load references now** (not before this step):
1. Read `references/xml-rules.md` for shape styles, label placement, and structural rules
2. Read `references/style-guide.md` for colors, fonts, and dark mode
3. Read `references/xml-templates-structure.md` for XML code blocks
4. Read `references/layout-guidelines.md` for spacing and edge routing
5. Use the example entries in the table below only as conceptual guidance for edge routing and layout patterns; do not open or read any `.drawio` files as reference.
**Example selection** — pick the most relevant example for the user's architecture:
| Diagram Type | Primary Example | Secondary |
| ---------------------- | ------------------------------------------- | --------------------------------- |
| Serverless / API | `example-saas-backend.drawio` | `example-event-driven.drawio` |
| Event-driven / async | `example-event-driven.drawio` | `example-microservices.drawio` |
| Microservices / ECS | `example-microservices.drawio` | `example-complex-platform.drawio` |
| Multi-region | `example-multi-region-active-active.drawio` | — |
| Complex (13+ services) | `example-complex-platform.drawio` | `example-saas-backend.drawio` |
| AI / AgentCore | `example-agentcore.drawio` | `example-event-driven.drawio` |
| Sketch mode | `example-sketch.drawio` | + one from above |
1. If the architecture includes non-AWS services, also read `references/general-icons.md`
2. Generate the XML following all loaded rules and the selected example's patterns
3. Apply styling selections from Step 2
### Step 4: Validate and Export
1. Write the `.drawio` file to `./docs/`
2. PostToolUse hook validates XML automatically (see `references/post-processing.md` for the fixer pipeline)
3. If validation fails, fix errors and rewrite
4. Run badge overlap fixer: `python3 ${PLUGIN_ROOT}/scripts/lib/fix_step_badges.py ./docs/<filename>.drawio`
5. After validation passes, generate preview URL:
```bash
python3 ${PLUGIN_ROOT}/scripts/lib/drawio_url.py ./docs/<filename>.drawio --open
```
6. If export format requested, run draw.io CLI (see `references/cli-export.md`)
## Defaults
- **Mode**: Brainstorm (if no codebase context)
- **Font**: `fontFamily=Helvetica` (Comic Sans MS only in sketch mode)
- **Icon size**: 48x48 inside 120x120 containers
- **Spacing**: 180px horizontal, 120px vertical between service group containers
- **Legend**: ALWAYS for 7+ services (unless user opts out)
- **Sketch mode**: OFF (unless user explicitly requests)
- **Dark mode**: `light-dark()` on all structural elements (always enabled)
- **Export format**: `.drawio` (unless user requests png/svg/pdf)
- **Grid**: OFF (`grid=0`)
- **File location**: `./docs/` directory
- **XML format**: Uncompressed, wrapped in `<mxfile><diagram><mxGraphModel>`
## Error Handling
- **XML validation failure**: Fix reported errors (malformed tags, missing IDs, invalid shapes), rewrite the file, re-validate
- **Shape not found**: Check `references/aws4-shapes-services.md` for valid `mxgraph.aws4.*` names
- **draw.io CLI not found**: Write `.drawio` file only, skip export, inform user to install draw.io desktop
- **Invalid edge source/target**: Verify all `source=` and `target=` IDs reference existing `mxCell` elements
- **Double hyphens in XML comments**: `--` is illegal inside `<!-- -->` per XML spec; use single hyphens or rephrase
- **Special characters**: Escape `&`, `<`, `>`, `"` in attribute values
## Style Rules
Full style details in `references/style-guide.md`. Critical rules that MUST be followed:
- **Font**: ALL text MUST use `fontFamily=Helvetica;` (Comic Sans MS only in sketch mode)
- **Dark mode**: ALL structural elements MUST use `light-dark()` fills with `fillStyle=auto;`. See style-guide.md for the full color table.
- **Region groups**: MUST use `container=0` (decoration-only). Services use `parent="aws-cloud"` with absolute coords.
- **Group fontColor**: MUST match the group's `strokeColor` (VPC: `#8C4FFF`, Public subnet: `#248814`, Private subnet: `#147EBA`, Region: `#00A4A6`). NEVER use `fontColor=#AAB7B8`.
- **Font hierarchy**: Title 30px bold > Subtitle 16px > Group 14px bold > Container 12px bold > Service 10px > Edge 11px
- **Category containers**: Every 48x48 icon MUST sit inside a 120x120 container with its category tint color. See style-guide.md for the tint color table.
- **AgentCore**: Use `resIcon=mxgraph.aws4.bedrock_agentcore` (NOT `mxgraph.aws4.bedrock`)
- **Sketch mode**: Only when user requests it. Add `sketch=1;curveFitting=1;jiggle=2` to non-icon elements. Keep `sketch=0` on service icons.
- **Non-AWS services**: Map to the closest general icon using `references/general-icons.md`. Same 120x120 container + 48x48 icon pattern. Apply category tint colors by functional role (database, compute, etc.). Labels are critical since icons are generic.
## Diagram Types
- **VPC/Network**: VPC, subnets, security groups, NAT gateways, load balancers with group shapes
- **Serverless**: API Gateway, Lambda, DynamoDB, S3, Step Functions, EventBridge
- **Multi-Region**: Multiple regions with replication, Route 53, Global Accelerator
- **CI/CD Pipeline**: CodeCommit/GitHub -> CodeBuild -> CodeDeploy -> targets
- **Data Flow/Analytics**: Kinesis, S3, Glue, Athena, Redshift, QuickSight pipelines
- **Container**: ECS/EKS clusters, ECR, Fargate, load balancing
- **Hybrid**: On-premises + AWS with Direct Connect, VPN, Transit Gateway
See `references/diagram-templates-basic.md` and `references/diagram-templates-advanced.md` for layout patterns.
## XML Generation Rules
For detailed XML templates, style strings, and code examples, see `references/xml-rules.md`. Key structural rules:
### Required Structure
Always use the full `mxfile` wrapper:
```xml
<mxfile host="Electron" version="29.6.1">
<diagram name="Page-1" id="diagram-1">
<mxGraphModel dx="1200" dy="800" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- All shapes and edges here -->
</root>
</mxGraphModel>
</diagram>
</mxfile>
```
- Cell `id="0"` is the root layer; cell `id="1"` is the default parent (both always required)
- All diagram elements use `parent="1"` unless nested inside a container
- Use descriptive cell IDs: `vpc-1`, `lambda-orders`, `s3-assets`, `edge-lambda-to-dynamo`
### Key Principles
- ALWAYS use `mxgraph.aws4.*` namespace. Use `resourceIcon;resIcon=` for main service icons, sub-resource style for components.
- Container `value` = category label (e.g., "DNS", "Compute"). Icon `value` = service name + optional italic sub-label. NEVER put the service name on the container.
- Edges connect to service icons, not containers. Use `exitX`/`exitY` and `entryX`/`entryY` (0-1) to control connection sides.
- Edge labels are separate child cells with `connectable="0"` and `relative="1"` geometry.
- Region groups use `container=0` (decoration-only). VPC/subnets use `container=1`.
- Prefer flat layouts. Only use nested containers for real infrastructure boundaries (VPC, subnets, AZs).
- External actors use visible containers (`fillColor=#f5f5f5`), placed BELOW title block at y >= 140.
## Layout Guidelines
For detailed spacing rules, edge routing patterns, and placement tables, see `references/layout-guidelines.md`. Key rules:
- **Spacing**: 180px horizontal / 120px vertical gaps. For 13+ services, increase to 220px/160px.
- **Edge routing**: Use `orthogonalEdgeStyle`. Add explicit waypoints for non-adjacent routing. Edges leave perpendicular to container face.
- **Multiple edges**: Each outgoing edge MUST exit from a different point. Spread entry points when multiple edges enter the same target.
- **Step badges/legend**: Teal `#007CBD` 28x28 badges near arrow sources. Right sidebar legend for 7+ services. Legend height MUST match diagram height.
- **Auxiliary services**: Only CloudWatch, CloudTrail, X-Ray, IAM. No step numbers, no edges. Place in dashed "Auxiliary Services" group inside AWS Cloud boundary.
- **All other services are primary** — MUST have edges and step numbers.
## File Naming
Each diagram gets a **descriptive filename** in kebab-case, placed in `./docs/` (e.g., `docs/healthcare-appointment-agent.drawio`, `docs/3-tier-vpc-webapp.drawio`). Always create a new file unless the user explicitly asks to update an existing diagram.
## Output
1. Create the `docs/` directory if it does not exist
2. Derive the filename from the user's prompt (see File Naming above)
3. **Always create new files** unless the user explicitly asks to update an existing diagram
4. Save the diagram to `./docs/<descriptive-name>.drawio`
5. After writing, the PostToolUse hook will automatically:
a. Validate the XML (structure, AWS shapes, edges, geometry)
b. If validation passes, generate a draw.io preview URL
6. If validation fails, fix the errors and rewrite the file
7. **Only after validation passes**, generate the browser preview link by running:
```bash
python3 ${PLUGIN_ROOT}/scripts/lib/drawio_url.py ./docs/<filename>.drawio --open
```
This compresses the XML and opens `app.diagrams.net` with the diagram loaded instantly. Do NOT run this if validation failed.
8. If the user requested an export format (png, svg, pdf):
a. Check if draw.io desktop CLI is available
b. Export with `--embed-diagram` to `./docs/<filename>.drawio.<format>`
c. Delete the intermediate `.drawio` file on success
9. **Always present to the user**:
- File path
- Diagram type and services included
- Validation status
- The draw.io preview URL (clickable link to open in browser)
- A recommended alt text (concise, under 100 characters, describing the diagram's purpose — not "diagram of...")
## CRITICAL: XML Well-Formedness
- **NEVER use double hyphens (`--`) inside XML comments.** `--` is illegal inside `<!-- -->` per the XML spec and causes parse errors. Use single hyphens or rephrase.
- Escape special characters in attribute values: `&`, `<`, `>`, `"`
- Always use unique `id` values for each `mxCell`
## Important Rules
- NEVER use compressed/base64 diagram content
- NEVER invent shape names — only use shapes from `references/aws4-shapes-services.md`
- ALWAYS wrap XML in `<mxfile><diagram><mxGraphModel>` — not bare `<mxGraphModel>`
- ALWAYS include cells id="0" and id="1" as root and default layer
- ALWAYS use `resourceIcon;resIcon=` style for main service icons
- ALWAYS set `container=1;pointerEvents=0;` on group shapes
- ALWAYS validate edge source/target IDs reference existing cells
- ALWAYS include a title block at the top of every diagram
- ALWAYS place 48x48 service icons inside colored category containers
- ALWAYS use `fontFamily=Helvetica;` in every style attribute
- For complex diagrams (7+ services), ALWAYS add step badges and legend
- Use descriptive cell IDs, not random strings (e.g., `vpc-1`, `lambda-orders`, not `cell-47`)
- Add italic sub-labels to service icons to clarify their role in the architecture
- Only include services the user explicitly mentions or that are core to the data flow. Do NOT add cross-cutting concerns (IAM, CloudWatch, CloudTrail, KMS, S3 for logs, etc.) unless the user asks for them
- Include a title/label on the diagram describing the architecture
- NEVER set a `background` attribute on mxGraphModel — any hardcoded background breaks dark mode adaptive contrast
## Reference Priority
When generating diagrams, follow this priority order:
1. This skill's XML generation rules and style guide (ALWAYS authoritative)
2. This skill's example `.drawio` files in `references/` (Step 3 selection table)
3. The user's existing `.drawio` files ONLY when explicitly requested ("match my style", "update my diagram")
Do NOT proactively read `.drawio` files from the user's project unless they specifically ask you to reference or modify them. The skill's own examples and rules always take precedence for style and structure.
## skills/deploy/SKILL.md
---
name: deploy
description: "Deploy applications to AWS. Triggers on phrases like: deploy to AWS, host on AWS, run this on AWS, AWS architecture, estimate AWS cost, generate infrastructure. Analyzes any codebase and deploys to optimal AWS services."
---
# Deploy on AWS
Take any application and deploy it to AWS with minimal user decisions.
## Philosophy
**Minimize cognitive burden.** User has code, wants it on AWS. Pick the most
straightforward services. Don't ask questions with obvious answers.
## Workflow
1. **Analyze** - Scan codebase for framework, database, dependencies
2. **Recommend** - Select AWS services, concisely explain rationale
3. **Estimate** - Show monthly cost before proceeding
4. **Generate** - Write IaC code with [security defaults](references/security.md) applied
5. **Deploy** - Run security checks, then execute with user confirmation
## Defaults
See [defaults.md](references/defaults.md) for the complete service selection matrix.
Core principle: Default to **dev-sized** (cost-conscious: small instance sizes, minimal redundancy, and non-HA/single-AZ defaults) unless user says "production-ready".
## MCP Servers
### awsknowledge
Consult for architecture decisions. Use when choosing between AWS services
or validating that a service fits the use case. Helps answer "what's the
right AWS service for X?"
Key topics: `general` for architecture, `amplify_docs` for static sites/SPAs,
`cdk_docs` and `cdk_constructs` for IaC patterns.
### awspricing
Get cost estimates. **Always present costs before generating IaC** so user
can adjust before committing. See [cost-estimation.md](references/cost-estimation.md)
for query patterns.
### awsiac
Consult for IaC best practices. Use when writing CDK/CloudFormation/Terraform
to ensure patterns follow AWS recommendations.
## Principles
- Concisely explain why each service was chosen
- Always show cost estimate before generating code
- Apply [security defaults](references/security.md) automatically (encryption, private subnets, least privilege)
- Run IaC security scans (cfn-nag, checkov) before deployment
- Don't ask "Lambda or Fargate?" - just pick the obvious one
- If genuinely ambiguous, then ask
- **Never recommend AWS App Runner** — it is in maintenance mode. Use ECS Express Mode instead.
- When user explicitly requests a managed application platform or signals low infrastructure involvement, route to Elastic Beanstalk
## References
- [Service defaults](references/defaults.md)
- [Security defaults](references/security.md)
- [Cost estimation patterns](references/cost-estimation.md)
- [Elastic Beanstalk skill](../elastic-beanstalk/SKILL.md)
## skills/elastic-beanstalk/SKILL.md
---
name: elastic-beanstalk
description: "Deploy to AWS Elastic Beanstalk, in either Beanstalk Standard mode (EC2) or Beanstalk Cluster mode (managed EKS). Triggers on: elastic beanstalk, EB, beanstalk standard, beanstalk cluster, managed EC2 platform, web app with managed patching, worker on EC2, Heroku alternative, don't want to manage servers or container orchestration, migrate from Heroku, managed operational lifecycle, containerised app without operating Kubernetes, several services sharing a managed cluster, managed EKS without kubectl. Covers web and worker applications on EC2, and containerised single- and multi-service applications on managed EKS."
---
# Elastic Beanstalk
Deploy applications to production on AWS with full lifecycle management. Elastic
Beanstalk is an application management service: the user provides application
code or a container image, AWS manages everything underneath (deployment,
scaling, patching, monitoring, health response).
There are two modes, and the choice determines every setting that follows.
**Standard** runs the application on Amazon EC2; **Cluster** runs a container on
a managed Amazon EKS Auto Mode cluster. See [Choose the Mode](#choose-the-mode).
## When to Use
Elastic Beanstalk is the right choice when:
- User explicitly asks for Elastic Beanstalk, EB, or a managed application platform
- User says "don't want to manage servers", "managed patching", or "Heroku-like"
- User is migrating from Heroku, Render, or Railway
- User wants AWS to manage ongoing operational lifecycle (patching, scaling,
health monitoring, rollback, deployments) after initial setup
- App is a web framework, API, or background worker on a standard runtime and
the user signals low infrastructure involvement
Elastic Beanstalk is NOT the right choice when:
- User explicitly wants serverless/Lambda — this imposes a different programming
model (event-driven functions, stateless, cold starts, 15-min max execution)
rather than just eliminating server management
- User wants fine-grained container orchestration control (use ECS)
- User already has Kubernetes expertise and wants direct K8s access (use EKS)
- App is a static site or SPA (use Amplify Hosting for the frontend; deploy the
backend API separately if present)
- User already has ECS task definitions or Fargate configuration
## Key Distinction
ECS and EKS are infrastructure management services: the user defines and
operates the deployment infrastructure (task definitions, services, clusters,
scaling policies) and owns ongoing operational decisions. Elastic Beanstalk is
an application management service: the user provides source code or a Docker
image, and AWS provisions and operates the production environment on an ongoing
basis. The result is the same reliability, but with lower ongoing maintenance
cost because operational responsibility stays with the provider.
Both models support IaC (CDK, CloudFormation, Terraform). The distinction is not
about tooling — it is about who manages the lifecycle after deployment.
Lambda/serverless is a different axis entirely. "Don't want to manage servers"
does not mean "wants serverless" — Elastic Beanstalk also eliminates server
management while preserving the standard application programming model
(long-running processes, persistent connections, threads, and — in Standard mode
only — local state; Cluster mode replicas have ephemeral local storage).
Serverless imposes a specific programming model: stateless functions, cold
starts, event-driven invocation, and a 15-minute execution ceiling. Route to
Lambda only when the user explicitly asks for serverless or the workload is
natively event-driven (e.g., S3 triggers, API Gateway request/response with
no session state).
## Choose the Mode
Decide before generating anything. The modes share an API and nothing else: a
Standard mode namespace passed to a Cluster mode environment is rejected, not
ignored.
**Cluster mode has an entry requirement, and it is checked first.** Route to
Cluster only when every service can run as identical, interchangeable replicas
_and_ all durable state — uploads, sessions, caches, working files — already lives
outside the container. Replica local storage is ephemeral and is lost on every
restart, and there is no persistent volume option. An application that fails this
goes to Standard mode, or gets changed first; a multi-service signal does not
override it. See the
[application contract](references/cluster-mode.md#the-application-contract).
Then the signals:
| Signal | Mode |
| ----------------------------------------------------------- | ------------ |
| Source on a standard runtime; Windows or .NET Framework | **Standard** |
| Worker consuming an SQS queue | **Standard** |
| Writes uploads, sessions, or working files to local disk | **Standard** |
| One small application, cost is the priority | **Standard** |
| Several services needing private service-to-service traffic | **Cluster** |
| Kubernetes underneath without operating Kubernetes | **Cluster** |
| Managed OpenTelemetry, or faster deploys and scaling | **Cluster** |
A container image alone does not settle it, because Standard mode has a Docker
platform too — ask. Prefer Cluster mode when the application is containerised,
multi-service, _and_ meets the contract above, since environments sharing subnets
share one cluster and reach each other privately. Prefer Standard for a single
container where a cluster is not yet justified. Do not propose migrating a working
Standard environment unless asked: there is no in-place conversion, only new
environments and a CNAME swap.
If the mode is Cluster, follow [cluster mode](references/cluster-mode.md) and
stop here. Everything below is Beanstalk Standard.
## Workflow (Standard)
This skill is invoked after the deploy skill selects Elastic Beanstalk as the
deployment target. The deploy skill handles codebase analysis and cost estimation.
This skill handles EB-specific configuration:
1. **Map to platform** - Select the EB platform branch (see [platforms](references/platforms.md))
2. **Configure** - Environment type (web server or worker), instance size, scaling
3. **Generate** - AWS CLI commands, CDK, or Terraform (see IaC section below)
4. **Deploy** - Execute with user confirmation
## Defaults
| Setting | Dev | Production |
| ------------------------- | --------------------------------- | --------------------------------- |
| Environment type (web) | Load-balanced (min=1, max=1) | Load-balanced, Multi-AZ |
| Environment type (worker) | Auto Scaling group (min=1, max=1) | Auto Scaling group (min=2, max=4) |
| Instance | t3.small | t3.medium or larger |
| Deployments | All-at-once | Rolling with additional batch |
| Health reporting | Enhanced | Enhanced |
| Managed updates | Enabled (weekly) | Enabled (maintenance window) |
| HTTPS (web only) | ACM certificate + ALB | ACM certificate + ALB |
Default to **dev** unless user says "production" or "prod".
Always use load-balanced environments for web server types. This ensures
instances stay in private subnets behind an ALB, HTTPS terminates via ACM
automatically, and scaling up later is a config change rather than an environment
type migration. Dev deployments with min=max=1 cause brief downtime on deploy
(single instance, all-at-once). If zero-downtime dev is needed, use min=1 max=2
with rolling.
Worker environments do not have load balancers — they receive work from SQS and
are scaled via Auto Scaling group settings.
## Environment Types
| Signal in Codebase | Environment Type |
| ----------------------------------------------------- | ---------------------------------------- |
| HTTP listener, web framework, API routes | Web server |
| Queue-based consumer, SQS processing, no HTTP serving | Worker |
| HTTP serving + queue-based background processing | Web server + separate Worker environment |
Worker environments receive work via an SQS queue managed by Elastic Beanstalk.
EB's SQS daemon sends HTTP POST requests to the application at a configurable
path (default: `POST /`). The application must expose this HTTP endpoint to
process each message — no SQS SDK integration required.
Worker environments also support periodic tasks via `cron.yaml` for scheduled
jobs (alternative to EventBridge + Lambda when the user is already using EB).
If the app uses in-process background threads or async tasks (not queue-based),
a single web server environment is sufficient — do not create a separate Worker.
## IaC Generation
**Default: AWS CLI** — no extra tooling to install. The agent orchestrates
the multi-step workflow:
1. `aws elasticbeanstalk create-storage-location` → returns the S3 bucket
(idempotent — returns existing bucket if already created)
2. `aws elasticbeanstalk create-application`
3. Zip source bundle, upload to the bucket from step 1
4. `aws elasticbeanstalk create-application-version`
5. `aws elasticbeanstalk create-environment` with `--option-settings` (web:
`--tier Name=WebServer,Type=Standard`, worker: `--tier Name=Worker,Type=SQS/HTTP`)
6. `aws elasticbeanstalk wait environment-updated`
7. Subsequent deploys: new version + `update-environment`
Resolve the `--solution-stack-name` by running
`aws elasticbeanstalk list-available-solution-stacks` and filtering for the
detected platform (e.g., ".NET" + "Amazon Linux 2023"). Alternatively, use
`--platform-arn` from `aws elasticbeanstalk list-platform-versions`.
Use `.ebextensions/` and platform hooks for customization.
See [AWS CLI EB reference](https://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/)
for full command documentation.
**Override: CDK (TypeScript)** when the user has an existing CDK project, wants
repeatable IaC, or explicitly requests it:
- `CfnApplication`, `CfnEnvironment`, `CfnConfigurationTemplate`
**Override: Terraform** when the user's repo already has Terraform:
- `aws_elastic_beanstalk_application`, `aws_elastic_beanstalk_environment`
CDK and Terraform templates are scannable by `cfn-nag`/`checkov` pre-deploy.
## Security
Apply these automatically:
- Web server instances in private subnets behind ALB
- Worker instances in private subnets with NAT Gateway for outbound
- HTTPS via ACM certificate on ALB (web server environments)
- IAM instance profile with least-privilege permissions — scan source code for
AWS SDK client usage to determine required actions (e.g.,
`AmazonBedrockRuntimeClient` → `bedrock:InvokeModel`,
`AmazonS3Client` → `s3:GetObject`/`s3:PutObject` on specific buckets)
- Enhanced health reporting enabled
- Managed platform updates enabled
- Security groups: ALB accepts 443, instances accept only from ALB
See the deploy skill's [security defaults](../deploy/references/security.md)
for encryption, VPC placement, and IAM patterns.
## Cost
Elastic Beanstalk has no service fee. Cost = underlying AWS resources.
Query the awspricing MCP server for region-accurate estimates. Approximate
us-east-1 pricing:
| Configuration | Estimated Monthly Cost |
| --------------------------------------------- | ---------------------- |
| Dev web (1x t3.small + ALB) | ~$35-40 |
| Dev worker (1x t3.small, no ALB) | ~$15-20 |
| Production web (4x t3.medium + ALB, Multi-AZ) | ~$150-200 |
Add RDS/Aurora costs separately if database is included.
## References
- [Beanstalk Cluster mode](references/cluster-mode.md) — containers on managed EKS
- [Supported platforms and detection](references/platforms.md) — Standard mode
- [Configuration and customization](references/configuration.md) — Standard mode

