Community写作与编辑github.com

AlexAI架构师/AgentCore技能

将 Amazon Bedrock AgentCore 资源以基础设施即代码(IaC)的方式搭建:支持运行时(Runtime)、网关(Gateway)、身份(Identity)和记忆(Memory)组件,默认使用 Terraform 模块,并提供 TypeScript CDK 选项。

AgentCore技能 是什么?

该技能用于生成 Amazon Bedrock AgentCore 的 IaC 资源,确保新资源以可审阅的 Terraform 模块方式部署,而非手动操作。它支持运行时、网关、身份和记忆四个组件,优先使用 Terraform 模块,也提供 CDK 和 CLI 选项。执行流程包括先自动发现项目环境,生成 dry-run 计划,确认后写入文件,最后进行审阅。该技能严格保护现有文件,不会覆盖,并且强制写后审阅。适用于 Cortex、Cursor、Codex 和 Claude Code 等平台,是 AgentCore 基础设施的标准化、可审计的创建方式。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alexaiarchitect/agentcore-skills/tree/HEAD/skills/agentcore-create

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

以 IaC 方式创建 AgentCore 资源

新的 AgentCore 资源应当以可审阅的模块形式,出现在团队部署的同一目录树中,而不是一次无人能复现的控制台点击。本技能会编写小型的、扁平的 Terraform 模块——包含单个 main.tf、variables.tf、outputs.tf、versions.tf——由用户从其根模块中引用。这些模块故意保持简单:每个参数都有注释说明,机密信息只写不读,并且网关绝不在没有授权器的情况下创建。

${CLAUDE_SKILL_DIR} 由技能运行时设置为该技能自身的目录。在下面每条命令中直接使用它;同级技能的脚本位于 ${CLAUDE_SKILL_DIR}/../<skill>/scripts/。

流程

  1. 发现:首先运行发现,使模块与现有模块处于同一位置,并确定区域:

    python3 ${CLAUDE_SKILL_DIR}/../agentcore-discover/scripts/discover.py <project> --focus agentcore,region,terraform
    

    如果 AgentCore CLI 或 CDK 已经拥有 AgentCore 资源(DSC004 领域),则提供匹配的 --iac 选项而非 Terraform。

  2. 规划写入:

    python3 ${CLAUDE_SKILL_DIR}/scripts/scaffold.py <project> --component runtime --dry-run
    

    --component gateway|identity|memory, --iac terraform|cdk|cli, --name, --out-dir, --protocol HTTP|MCP|A2A|AGUI(运行时)。

  3. 选择:Terraform 模块(推荐,免费)、CDK 堆栈(免费)或 AgentCore CLI 命令(免费打印;agentcore deploy 本身属于 aws)。

  4. 确认:使用 AskUserQuestion 确认后,运行不带 --dry-run 的相同命令。仅当用户在看到计划后要求替换文件时,才传递 --force。

  5. 验证:对结果运行审阅并展示:

    python3 ${CLAUDE_SKILL_DIR}/../agentcore-review/scripts/review.py <project>
    

决策规则

  • 优先 Terraform。这是第一个用户运行的选项,也是本插件的审阅、部署计划和 CI 策略唯一全部适用的选项。hashicorp/aws 提供者覆盖所有核心资源;参见 provider-coverage.md 了解哪些需要 awscc 或 CLI。
  • 模块是被引用,不是被应用。脚本会打印需要添加的 module 块;它不会编辑根模块。
  • 只写机密需要 Terraform 1.11+。生成的 versions.tf 会声明这一点;较旧 Terraform 必须使用敏感变量并接受机密存在于状态中(ACR031)。
  • 不再提供入门工具包。其 CLI 已不再受支持;AgentCore CLI 是替代的 CLI 选项。

参考

问题文件
每个生成模块的内容及原因terraform-modules.md
CDK 和 AgentCore CLI 路径以及选择时机cdk-and-cli-alternatives.md
hashicorp/aws 覆盖的资源;awscc 和 CLI 回退provider-coverage.md

脚本

命令作用退出码
scripts/scaffold.py <project> --component C [--iac terraform|cdk|cli] [--dry-run] [--force] [--json]规划并写入一个模块、一个 CDK 堆栈,或打印 CLI 命令0 已写入/规划,1 无内容可写,2 参数错误

完成清单

  • 已运行发现,且选择的 IaC 与原有拥有 AgentCore 资源的团队一致。
  • 写入计划已通过 --dry-run 展示,并在写入前确认。
  • module 引用块已提供给用户,未写入其根模块。
  • 已对结果运行 review.py,并展示了其发现。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

alexaiarchitect/agentcore-skills

>- Put Amazon Bedrock AgentCore infrastructure behind a plan-only CI gate. Generates a GitHub Actions workflow that, on pull requests touching the infrastructure, runs the static AgentCore review (`ACR0xx`), `terraform fmt -check`, `init`, `validate`, a saved `plan` (Terraform or Terragrunt) with a read-only OIDC role, `show -json`, and the plan policy (`CI0xx`: no delete or replace of memories, gateways, credential providers, workload identities, user pools or tables without an explicit per-address allowance; no `*` on `*`; no gateway with `authorizer_type = NONE`; pinned MCP revisions), then uploads the plan JSON. Nothing in it applies. The plugin's stdlib-only library is vendored into `ci/agentcore/` so the job needs nothing from the plugin, and action pins are reused from the repository's own SHA-pinned workflows. `policy_check.py` also runs locally on any saved plan. Use when asked to "add CI for the AgentCore Terraform", "gate the plan", "block destructive changes", "policy check the plan", "plan on ...

alexaiarchitect/agentcore-skills

>- Estimate what Amazon Bedrock AgentCore will cost per month from a usage profile, line by line with the formula for each line, and put a budget and a usage alarm around it. Prices the published AgentCore rate card (Gateway invocations, search and tool indexing; Identity token requests, free through Runtime or Gateway; Runtime vCPU-hours billed only while active and GB-hours; Memory short-term events — per 1,000 events until 2026-10-05, per GB from 2026-10-06 — and long-term records and retrievals; Evaluations tokens), prices model tokens only at the user's own per-1,000 rates, and lists what it does not price (Lambda, API Gateway, CloudWatch, X-Ray, DynamoDB) so the total is never mistaken for the bill. Generates an AWS Budget filtered to AgentCore with forecast and actual alerts, plus a CloudWatch alarm on gateway invocations, as Terraform after a dry run. Findings are the `CST0xx` band. Use when asked "what will AgentCore cost", "estimate the gateway bill", "is there a free tier", "memory pricing chang...

alexaiarchitect/agentcore-skills

>- Plan the deployment of Amazon Bedrock AgentCore infrastructure and its rollback, and hand the user the exact commands — never running them. Finds the root module (or Terragrunt stack) that actually reaches the AgentCore resources, orders what comes up (identity and roles, then gateway, runtime and memory, then targets and strategies, then log delivery), flags where a first apply trips (IAM propagation, creation-only semantic search, Transaction Search before TRACES delivery, an old provider lock, no remote backend), checks published quotas (targets per gateway, tools per target), and emits init / validate / plan-to-file / show -json / policy check / apply of that saved plan, the post-apply checks, and the rollback for each kind of change. Findings are the `DPL0xx` band; the cost tier is `aws` because the commands create billable resources. Use when asked to "deploy the gateway", "apply this", "what order do I apply in", "how do I roll back", "will this hit a quota", "give me the terraform commands". Don...

alexaiarchitect/agentcore-skills

>- Inventory a project for Amazon Bedrock AgentCore work and report before advising. Finds existing AgentCore resources and which tool owns them (Terraform `aws_bedrockagentcore_*`/`awscc_*`, CDK constructs, the AgentCore CLI's `agentcore.json`, the deprecated starter toolkit's `.bedrock_agentcore.yaml`, boto3 `bedrock-agentcore` clients, the AgentCore Python SDK and `@requires_access_token`), the agent framework (Strands, LangGraph, LangChain, Claude Agent SDK, CrewAI, OpenAI Agents, ADK, raw), MCP servers and the API Gateway routes and Lambdas behind `/mcp`, Cognito pools, clients and JWT authorizers, the AWS region and per-service availability there, the hashicorp/aws constraint and lock, Terragrunt, and Lambda tracing. Read-only; findings are the `DSC0xx` band. Use when asked "what do I have", "is this on AgentCore", "inventory this repo", "which region are we in", "is AgentCore available in eu-central-1", "what framework is this agent", or before any other AgentCore skill on an unfamiliar project. Don...

相关技能