Deploy Aws¶
Deploy AWS — mvp.deploy_aws
Cluster: Core Infrastructure | Type: component | MCP Tools: 18
Overview¶
AWS deployment provider that pushes container images to ECR and deploys them to ECS/Fargate clusters. Wraps the aws CLI with structured DeployResult responses, configurable ECS task definitions (CPU, memory, desired count, VPC subnets), optional blocking image signature policy, and secret injection via AWS SSM or Secrets Manager. Participates in the shared deploy_core protocol so it can be swapped for any other provider without changing pipeline code.
The component exposes read-only discover_capabilities, preflight, validate_environment, plan, and explain_degradation operations so operators can distinguish dry-run/introspection from live AWS readiness before any mutating deploy, push, teardown, or rollback operation. Missing credentials and provider/tool gaps are surfaced as canonical completion_state, warning_card, and evidence fields rather than cosmetic success.
Launch pilot caveat
AWS/ECS is supported for teams that already have AWS accounts, IAM roles, VPC networking, ECR, and ECS operations in place. It is not the recommended first deployment path for launch pilots or non-technical "vibe coder" onboarding. For the first 50-100 users, prefer the simplest verified path, such as local Docker or a single VPS deployment, and only use deploy_aws when the operator is comfortable debugging AWS credentials, regions, subnets, security groups, service creation, and ECS rollout failures.
When to use:
- Deploying a G6 base image (REST, gRPC, MCP) to an ECS Fargate service
- Pushing a built Docker image to ECR as part of a CI/CD pipeline step
- Querying or tearing down an existing ECS service from an agent workflow
Do not use as the default first-run path when:
- A new user is trying to install and see value in under 10 minutes
- The deployment target has not already been provisioned with working subnets, security groups, roles, and ECR access
- A single VPS or local Docker deployment is enough for the pilot or demo
Example:
from mvp.deploy_aws import AWSBlock, AWSInput
from mvp.deploy_core.schema import ImageSpec, DeployTarget
block = AWSBlock(name="aws")
result = block.infer(AWSInput(
op="deploy",
image=ImageSpec(name="g6-rest", tag="abc1234", registry="123456.dkr.ecr.us-east-1.amazonaws.com"),
target=DeployTarget(provider="aws", region="us-east-1", service_name="g6-rest-svc"),
))
# result.ok → True; result.value.stage → "deploy"
Works well with: deploy_core, deploy_docker, cicd
Public API¶
AWSBlock(AIBlock[AWSInput, DeployResult, None])¶
| Field | Type | Default |
|---|---|---|
name | str | 'aws' |
Methods:
infer(data: AWSInput) -> Result[DeployResult]¶
ECSConfig¶
ECS/Fargate deployment configuration.
| Field | Type | Default |
|---|---|---|
cluster | str | 'g6' |
cpu | str | '256' |
memory | str | '512' |
desired_count | int | 1 |
launch_type | str | 'FARGATE' |
assign_public_ip | str | 'ENABLED' |
subnets | list[str] | field(default_factory=list) |
security_groups | list[str] | field(default_factory=list) |
task_role_arn | str | '' |
execution_role_arn | str | '' |
log_group | str | '' |
vpc_id | str | '' |
require_signature | bool | False |
signature_policy | str | 'optional' |
AWSInput¶
Input for AWSBlock.infer().
| Field | Type | Default |
|---|---|---|
op | str | required |
image | ImageSpec | field(default_factory=lambda: ImageSpec(name='')) |
target | DeployTarget | field(default_factory=lambda: DeployTarget(provider='aws')) |
ecs_config | ECSConfig | field(default_factory=ECSConfig) |
run_mode | str | 'beta' |
reviewer_signature | str | '' |
AWSTarget¶
InfraTarget implementation using the aws CLI.
Constructor:
| Parameter | Type | Default |
|---|---|---|
dry_run | bool | False |
planner | Any | None |
Methods:
push_image(image: ImageSpec, target: DeployTarget | None = None, ecs_config: ECSConfig | None = None) -> DeployResult¶
ECR login then docker push.
deploy(image: ImageSpec, target: DeployTarget, ecs_config: ECSConfig | None = None) -> DeployResult¶
Full ECS deploy: ensure_repo → register_task_def → update-service → wait_for_rollout.
wait_healthy(image: ImageSpec, target: DeployTarget, cluster_override: str = '') -> DeployResult¶
Poll ECS describe-services until runningCount >= desiredCount.
status(target: DeployTarget) -> DeployResult¶
ECS service status — must include --services
.
teardown(image: ImageSpec, target: DeployTarget | None = None) -> DeployResult¶
Delete ECS service — must include --service
.
rollback(image: ImageSpec, target: DeployTarget) -> DeployResult¶
Rollback to the previous active task definition revision.
discover_capabilities(target: DeployTarget | None = None, ecs_config: ECSConfig | None = None) -> DeployResult¶
Read-only local capability discovery for AWS deploy prerequisites.
preflight(image: ImageSpec, target: DeployTarget, ecs_config: ECSConfig | None = None, require_live: bool = False) -> DeployResult¶
Read-only preflight contract for AWS deploy readiness.
plan(image: ImageSpec, target: DeployTarget, ecs_config: ECSConfig | None = None) -> DeployResult¶
explain_degradation(target: DeployTarget | None = None, ecs_config: ECSConfig | None = None) -> DeployResult¶
MCP Tools¶
| Operation | Source |
|---|---|
ops | deploy_aws_mcp |
help | deploy_aws_mcp |
push_image | deploy_aws_mcp |
deploy | deploy_aws_mcp |
status | deploy_aws_mcp |
teardown | deploy_aws_mcp |
rollback | deploy_aws_mcp |
wait_healthy | deploy_aws_mcp |
validate_resources | deploy_aws_mcp |
discover_capabilities | deploy_aws_mcp |
preflight | deploy_aws_mcp |
validate_environment | deploy_aws_mcp |
plan | deploy_aws_mcp |
explain_degradation | deploy_aws_mcp |
list_strategies | deploy_aws_mcp |
assess_deploy_readiness | deploy_aws_mcp |
explain_rollback_selection | deploy_aws_mcp |
list_patterns | deploy_aws_mcp |