launch-with-aws

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Launch with AWS

基于AWS启动应用

Drives an AWS migration end-to-end using CLI scripts. Takes a user's web application, analyzes it, generates a migration plan with cost estimate, and delivers deployable AWS Blocks infrastructure code.
The AWS MCP server is recommended but is not required. This skill works standalone via its CLI scripts in any agent environment.
通过CLI脚本端到端驱动AWS迁移流程。接收用户的Web应用,对其进行分析,生成包含成本估算的迁移计划,并交付可部署的AWS Blocks基础设施代码。
推荐使用AWS MCP服务器,但并非必需。该技能可通过其CLI脚本在任何Agent环境中独立运行。

Script Invocation

脚本调用

All commands are run via:
bash
python3 scripts/launch_with_aws.py <command> [args...]
where
scripts/
is relative to this skill directory. The agent MUST set the working directory to the skill root before invoking commands.
Required files: launch_with_aws.py, launch_config.py, auth.py, auth_callback_server.py, launch_api_client.py, archive.py, service model. When loaded via MCP, fetch all and write to a temp directory preserving structure before invoking.
Each command outputs JSON to stdout on success, or exits non-zero with a JSON error on stderr.
Dependencies: Python 3.10+ and
boto3
. The script checks both on startup and exits with a clear error if either is missing.
所有命令通过以下方式运行:
bash
python3 scripts/launch_with_aws.py <command> [args...]
其中
scripts/
是相对于本技能目录的路径。Agent在调用命令前必须将工作目录设置为技能根目录。
所需文件:launch_with_aws.pylaunch_config.pyauth.pyauth_callback_server.pylaunch_api_client.pyarchive.pyservice model。通过MCP加载时,需先获取所有文件并写入临时目录,保留原有结构后再调用脚本。
每个命令执行成功时会向标准输出(stdout)输出JSON;若执行失败,则会以非零状态退出,并向标准错误(stderr)输出JSON格式的错误信息。
依赖项:Python 3.10+和
boto3
。脚本启动时会检查这两项,若缺失则输出明确的错误信息后退出。

Supported Application Types

支持的应用类型

Full-stack apps built with vibe-coding platforms, and frontend web applications and websites (static sites, SPAs, and SSR frameworks with static export).
Origin PlatformWhat it covers
LovableLovable-generated full-stack apps (React + Supabase)
Bolt.newBolt.new-generated full-stack apps (React + Supabase)
ReplitReplit-hosted full-stack apps (React + Express.js + PostgreSQL)
FrameworkExamples
React ecosystemReact, CRA, Vite + React, Gatsby, Docusaurus
Vue ecosystemVue, Nuxt (static export), VitePress
AngularAngular
Svelte ecosystemSvelte, SvelteKit (static export)
SSR with static exportNext.js, Nuxt, Astro, SvelteKit
Other modern frameworksAstro, Solid, Preact, Lit, Eleventy
Vite (generic)Any Vite-based app
Other frameworks may also work. If the user's app doesn't match these, see Unsupported Application Handling below.
由vibe-coding平台构建的全栈应用,以及各类前端Web应用和网站(静态站点、单页应用SPAs,以及支持静态导出的SSR框架)。
源平台覆盖范围
LovableLovable生成的全栈应用(React + Supabase)
Bolt.newBolt.new生成的全栈应用(React + Supabase)
ReplitReplit托管的全栈应用(React + Express.js + PostgreSQL)
框架示例
React生态React、CRA、Vite + React、Gatsby、Docusaurus
Vue生态Vue、Nuxt(静态导出)、VitePress
AngularAngular
Svelte生态Svelte、SvelteKit(静态导出)
支持静态导出的SSR框架Next.js、Nuxt、Astro、SvelteKit
其他现代框架Astro、Solid、Preact、Lit、Eleventy
Vite(通用)任何基于Vite的应用
其他框架也可能适用。如果用户的应用与上述列表不匹配,请查看下方的不支持应用的处理方式

What Gets Migrated vs. What Stays

迁移内容与保留内容

Lovable / Bolt.new apps (Supabase-backed):
ComponentWhat happens
Frontend & hostingMigrated to AWS (S3 + CloudFront + Lambda)
Edge functions / server functionsMigrated to AWS Lambda
AI calls (e.g. Lovable AI Gateway)Migrated to Amazon Bedrock
Database (Supabase DB)Stays on Supabase — not migrated
Auth (Supabase Auth)Stays on Supabase — not migrated
Storage & RealtimeStays on Supabase — not migrated
The app continues to call Supabase for database, auth, storage, and realtime from the AWS-hosted application.
Replit apps (Express.js + PostgreSQL):
ComponentWhat happens
Frontend & hostingMigrated to AWS (S3 + CloudFront + Lambda)
Server logic (Express.js)Migrated to AWS Lambda (API Gateway)
Database (PostgreSQL)Schema and code migrated to AWS (Aurora Serverless / DynamoDB). Existing data is NOT migrated — customers must export and import their data separately.
Auth (Replit Auth)Code migrated to AWS (Cognito). Existing user accounts are NOT migrated — customers must re-create or invite users in Cognito.
Realtime (WebSockets)Migrated to AWS (AppSync Events)
File storageMigrated to AWS (S3). Existing files are NOT migrated.
Replit app infrastructure and code are migrated to AWS-native services, but existing data, user accounts, and files must be migrated separately by the customer.
Lovable / Bolt.new应用(基于Supabase):
组件处理方式
前端与托管迁移至AWS(S3 + CloudFront + Lambda)
Edge函数/服务器函数迁移至AWS Lambda
AI调用(如Lovable AI Gateway)迁移至Amazon Bedrock
数据库(Supabase DB)保留在Supabase — 不迁移
认证(Supabase Auth)保留在Supabase — 不迁移
存储与实时功能保留在Supabase — 不迁移
迁移后的应用将继续从AWS托管环境调用Supabase的数据库、认证、存储和实时功能。
Replit应用(Express.js + PostgreSQL):
组件处理方式
前端与托管迁移至AWS(S3 + CloudFront + Lambda)
服务器逻辑(Express.js)迁移至AWS Lambda(API Gateway)
数据库(PostgreSQL)模式与代码迁移至AWS(Aurora Serverless / DynamoDB)。现有数据不会迁移 — 客户需自行导出并导入数据。
认证(Replit Auth)代码迁移至AWS(Cognito)。现有用户账户不会迁移 — 客户需在Cognito中重新创建或邀请用户。
实时功能(WebSockets)迁移至AWS(AppSync Events)
文件存储迁移至AWS(S3)。现有文件不会迁移。
Replit应用的基础设施和代码会迁移至AWS原生服务,但现有数据、用户账户和文件需由客户自行迁移。

Input Resolution

输入解析

Resolve the user's input to a local directory path or GitHub URL:
  • If the user provides a local path: pass that path directly.
  • If the user provides a GitHub URL: pass it directly (the service clones it server-side).
  • If neither is provided: use the current working directory. If it doesn't look like an app directory, ask the user for the path.
将用户输入解析为本地目录路径或GitHub URL:
  • 如果用户提供本地路径:直接传入该路径。
  • 如果用户提供GitHub URL:直接传入该URL(服务会在服务器端克隆代码)。
  • 如果两者都未提供:使用当前工作目录。若该目录看起来不像应用目录,则询问用户提供路径。

Flow

流程

Run the script commands in order, surfacing results to the user at each step:
按顺序运行脚本命令,并在每一步向用户展示结果:

1. Authentication

1. 身份认证

bash
python3 scripts/launch_with_aws.py auth-start
Always run first. Returns immediately with JSON:
  • If already authenticated:
    {"authenticated": true, "reusedCachedSession": true, "baseUrl": "..."}
  • If silent refresh succeeded:
    {"authenticated": true, "reusedCachedSession": false, "baseUrl": "..."}
  • If interactive sign-in is needed:
    {"authenticated": false, "signInUrl": "https://...", "pid": 12345, "port": 54321, "baseUrl": "..."}
When
authenticated
is
false
, immediately display the
signInUrl
to the user
(so they can open it in their browser) and call
auth-wait
in the same response:
bash
python3 scripts/launch_with_aws.py auth-wait <pid>
where
<pid>
is the
pid
value from the
auth-start
response. This blocks until the user completes browser sign-in (or times out after 600s). Returns
{"authenticated": true, "baseUrl": "..."}
on success.
bash
python3 scripts/launch_with_aws.py auth-start
始终第一步运行。立即返回JSON:
  • 若已认证:
    {"authenticated": true, "reusedCachedSession": true, "baseUrl": "..."}
  • 若静默刷新成功:
    {"authenticated": true, "reusedCachedSession": false, "baseUrl": "..."}
  • 若需要交互式登录:
    {"authenticated": false, "signInUrl": "https://...", "pid": 12345, "port": 54321, "baseUrl": "..."}
authenticated
false
时,立即向用户展示
signInUrl
(以便他们在浏览器中打开),并在同一响应中调用
auth-wait
bash
python3 scripts/launch_with_aws.py auth-wait <pid>
其中
<pid>
auth-start
响应中的
pid
值。该命令会阻塞,直到用户完成浏览器登录(或600秒后超时)。成功时返回
{"authenticated": true, "baseUrl": "..."}

2. Create Launch

2. 创建迁移任务

For a local directory, present this confirmation and wait for explicit approval:
Your source code will be uploaded to the Launch with AWS service to analyze your application and generate a migration plan. If you later approve execution, an AWS-hosted agent will modify a copy of your source code according to the plan and produce a migrated snapshot for you to download. Your source code is encrypted at rest, automatically deleted after 7 days, and never used to train AI models. We exclude Git history, Git-ignored files, and files matching common sensitive-file patterns. Sensitive-file filtering is best effort; review your project for secrets. Continue?
Do NOT call
create-launch
for a local directory until the user explicitly confirms. A missing or ambiguous response means no.
bash
python3 scripts/launch_with_aws.py create-launch <source-path-or-github-url> [name]
Creates a launch from a local directory (zips, uploads, then creates) or a GitHub URL (passes directly). Returns JSON with the full
launch
object including
launch.launchId
.
The launch starts in
analyzing
status and automatically progresses through analysis and planning.
对于本地目录,先向用户展示以下确认信息,等待明确批准:
你的源代码将上传至Launch with AWS服务,用于分析应用并生成迁移计划。若你后续批准执行,AWS托管的Agent会根据计划修改源代码副本,并生成迁移后的快照供你下载。你的源代码在静态存储时会加密,7天后自动删除,且绝不会用于AI模型训练。我们会排除Git历史、Git忽略的文件,以及符合常见敏感文件模式的文件。敏感文件过滤为尽力而为;请检查你的项目是否包含密钥信息。是否继续?
在用户明确确认前,请勿为本地目录调用
create-launch
。若用户未回应或回应模糊,则视为拒绝。
bash
python3 scripts/launch_with_aws.py create-launch <source-path-or-github-url> [name]
从本地目录(压缩、上传后创建)或GitHub URL(直接传入)创建迁移任务。返回包含完整
launch
对象的JSON,其中包括
launch.launchId
迁移任务初始状态为
analyzing
(分析中),会自动推进至分析和规划阶段。

3. Poll Launch Status

3. 查询迁移任务状态

bash
python3 scripts/launch_with_aws.py get-launch-status <launch-id>
Poll until
status
is
planned
(ready for execution),
awaiting_input
(needs context answers — see step 4), or
failed
. Key status progression:
  • analyzing
    → detecting app type and dependencies
  • awaiting_input
    → needs context answers (see
    refine-plan
    )
  • planning
    → generating migration plan
  • planned
    → ready for execution
  • executing
    → deployment in progress
  • completed
    → done
  • failed
    → check
    failureReason
If
status
is
awaiting_input
, check
contextInputs
for the questions that need answering. Inputs with
required: true
must be answered before the launch can proceed; others are optional enrichment.
bash
python3 scripts/launch_with_aws.py get-launch-status <launch-id>
轮询直到状态变为
planned
(准备执行)、
awaiting_input
(需要上下文回答 — 见步骤4)或
failed
(失败)。关键状态流程:
  • analyzing
    → 检测应用类型和依赖项
  • awaiting_input
    → 需要上下文回答(见
    refine-plan
  • planning
    → 生成迁移计划
  • planned
    → 准备执行
  • executing
    → 部署进行中
  • completed
    → 完成
  • failed
    → 查看
    failureReason
    (失败原因)
若状态为
awaiting_input
,检查
contextInputs
获取需要回答的问题。标记为
required: true
的输入必须回答,迁移任务才能继续;其他为可选补充信息。

4. Refine Plan (if awaiting_input)

4. 优化计划(若状态为awaiting_input)

bash
python3 scripts/launch_with_aws.py refine-plan <launch-id> key1=value1 key2=value2
Provide context answers to refine the plan. Triggers re-planning.
bash
python3 scripts/launch_with_aws.py refine-plan <launch-id> key1=value1 key2=value2
提供上下文回答以优化计划。触发重新规划。

5. Get Full Launch Details & Confirm

5. 获取完整迁移任务详情并确认

bash
python3 scripts/launch_with_aws.py get-launch <launch-id> plan,cost_estimate
Get full launch details. Optional second argument is a comma-separated include list:
analysis
,
plan
,
execution
,
cost_estimate
,
download_url
.
Present the cost estimate and plan to the user. The
costEstimate
field in the response contains
estimatedMonthlyCost
,
region
, and a
services
breakdown with per-service costs.
Confirmation Gate — present and wait for explicit approval:
Migration Summary
  • App type: [detected type from analysis]
  • Architecture: [target architecture from plan]
  • Estimated monthly cost: $X.XX/month
  • Region: us-east-1
Ready to proceed? This will execute the migration in an AWS-managed environment (no cost to you) and produce the migrated snapshot for you to download.
Do NOT call
start-launch-execution
until the user explicitly confirms.
bash
python3 scripts/launch_with_aws.py get-launch <launch-id> plan,cost_estimate
获取完整的迁移任务详情。可选的第二个参数是逗号分隔的包含列表:
analysis
(分析结果)、
plan
(迁移计划)、
execution
(执行信息)、
cost_estimate
(成本估算)、
download_url
(下载链接)。
向用户展示成本估算和迁移计划。响应中的
costEstimate
字段包含
estimatedMonthlyCost
(月度估算成本)、
region
(区域)以及按服务划分的
services
成本明细。
确认环节 — 展示信息并等待用户明确批准:
迁移摘要
  • 应用类型:[分析检测到的类型]
  • 架构:[计划中的目标架构]
  • 估算月度成本:$X.XX/月
  • 区域:us-east-1
是否准备继续?这将在AWS托管环境中执行迁移(无需你承担费用),并生成迁移后的快照供你下载。
在用户明确确认前,请勿调用
start-launch-execution

6. Start Execution

6. 开始执行

bash
python3 scripts/launch_with_aws.py start-launch-execution <launch-id>
Starts deployment. Then poll with
get-launch-status
until
status
is
completed
or
failed
. Sleep at least 30 seconds between polls.
bash
python3 scripts/launch_with_aws.py start-launch-execution <launch-id>
启动部署。然后通过
get-launch-status
轮询,直到状态变为
completed
(完成)或
failed
(失败)。轮询间隔至少30秒。

7. Download

7. 下载

bash
python3 scripts/launch_with_aws.py get-launch-download-url <launch-id>
Always present the full download URL to the user — they may need it to download the migrated snapshot directly or for reference.
bash
python3 scripts/launch_with_aws.py get-launch-download-url <launch-id>
务必向用户展示完整的下载链接 — 他们可能需要直接下载迁移后的快照或作为参考。

8. List or Delete Launches

8. 列出或删除迁移任务

bash
python3 scripts/launch_with_aws.py list-launches
python3 scripts/launch_with_aws.py delete-launch <launch-id>
bash
python3 scripts/launch_with_aws.py list-launches
python3 scripts/launch_with_aws.py delete-launch <launch-id>

9. Post-Migration: Apply Migrated Code Locally

9. 迁移后:在本地应用迁移后的代码

After obtaining the download URL (adapt commands for the user's platform if not POSIX):
获取下载链接后(若用户平台非POSIX,需调整命令):

Step A: Download and unpack

步骤A:下载并解压

bash
curl -L -o /tmp/migration-snapshot.zip "<download_url>"
mkdir -p /tmp/migration-output
unzip -o /tmp/migration-snapshot.zip -d /tmp/migration-output
bash
curl -L -o /tmp/migration-snapshot.zip "<download_url>"
mkdir -p /tmp/migration-output
unzip -o /tmp/migration-snapshot.zip -d /tmp/migration-output

Step B: Prepare the local workspace

步骤B:准备本地工作区

Ensure the user's working directory is clean:
bash
cd <user-app-directory>
git status
If there are uncommitted changes, ask the user to commit or stash first. Do NOT proceed with a dirty working tree.
确保用户的工作目录干净:
bash
cd <user-app-directory>
git status
若存在未提交的更改,请询问用户先提交或暂存。请勿在工作目录未清理的情况下继续。

Step C: Apply migration (3-way merge)

步骤C:应用迁移(三方合并)

Create a migration branch and overlay the migrated files:
bash
cd <user-app-directory>
git checkout -b aws-migration
rsync -a /tmp/migration-output/ .
git status
git diff --stat
Review the changes with the user. Key additions to highlight:
  • aws-blocks/
    — AWS Blocks infrastructure definition
  • DEPLOY.md
    — deployment instructions
  • Any modified config files
If there are conflicts with the user's existing files, present them and ask how to resolve.
创建迁移分支并覆盖迁移后的文件:
bash
cd <user-app-directory>
git checkout -b aws-migration
rsync -a /tmp/migration-output/ .
git status
git diff --stat
与用户一起审查更改。需重点突出的关键新增内容:
  • aws-blocks/
    — AWS Blocks基础设施定义
  • DEPLOY.md
    — 部署说明文档
  • 任何修改的配置文件
若与用户现有文件存在冲突,请展示冲突内容并询问用户如何解决。

Step D: Follow DEPLOY.md

步骤D:遵循DEPLOY.md文档

Read the
DEPLOY.md
file in the project root and follow its instructions to deploy the app to the user's AWS account. Typical steps:
  1. AWS authentication (
    aws login --profile aws-migrate --region us-east-1
    )
  2. CDK bootstrap (first-time only):
    npm install && npx cdk bootstrap
  3. Deploy:
    npx cdk deploy --all --progress events
  4. Verify the CloudFront URL that CDK prints on completion.
Important: Always read
DEPLOY.md
from the migrated output — it is generated specifically for this app and architecture. Do not assume deployment steps from memory.
读取项目根目录下的
DEPLOY.md
文件,并按照其说明将应用部署到用户的AWS账户。典型步骤:
  1. AWS身份认证(
    aws login --profile aws-migrate --region us-east-1
  2. CDK引导(首次部署需执行):
    npm install && npx cdk bootstrap
  3. 部署:
    npx cdk deploy --all --progress events
  4. 验证CDK完成部署后输出的CloudFront URL。
重要提示: 务必读取迁移输出中的
DEPLOY.md
文档 — 它是针对当前应用和架构生成的专属文档。请勿凭记忆假设部署步骤。

Unsupported Application Handling

不支持应用的处理方式

If a launch fails during analysis with a
failureReason
indicating an unsupported app type (or the user's stack doesn't match the supported list):
  1. Tell the user: "This app type isn't directly supported by Launch with AWS yet. Let me search for other skills that can help deploy this kind of application."
  2. Search for relevant skills based on the app type (e.g.
    aws-serverless
    ,
    aws-containers
    ,
    databases-on-aws
    ,
    deploy-on-aws
    ,
    aws-cdk
    ,
    sagemaker-ai
    ).
若迁移任务在分析阶段失败,且
failureReason
表明应用类型不被支持(或用户的技术栈不在支持列表中):
  1. 告知用户:“该应用类型目前暂不被Launch with AWS直接支持。我将搜索可帮助部署此类应用的其他技能。”
  2. 根据应用类型搜索相关技能(例如:
    aws-serverless
    aws-containers
    databases-on-aws
    deploy-on-aws
    aws-cdk
    sagemaker-ai
    )。