CommunitySchreiben & Editierengithub.com

AgentCore-Ressourcen als IaC bereitstellen

Erstellt AWS-Bedrock-AgentCore-Ressourcen als Infrastructure-as-Code: Runtime, Gateway, Identity und Memory als Terraform-Module oder CDK-Stacks.

Was ist AgentCore-Ressourcen als IaC bereitstellen?

Diese Fähigkeit erstellt reproduzierbare Infrastruktur für Amazon Bedrock AgentCore, sodass Ressourcen wie Runtime, Gateway, Identity und Memory nicht manuell in der Konsole, sondern als versionierbare Module im Projektbaum landen. Standardmäßig werden flache Terraform-Module generiert (main.tf, variables.tf, outputs.tf, versions.tf), die der Nutzer in sein Root-Modul einbindet. Alternativ stehen CDK-Stacks mit L1-Konstrukten und die AgentCore-CLI zur Verfügung – die Entscheidung wird anhand des Projektkontexts getroffen. Jeder Schreibvorgang wird zuerst als Plan (--dry-run) angezeigt, bestehende Dateien werden ohne --force nicht überschrieben, und es wird nie direkt bereitgestellt. Die Fähigkeit eignet sich für Aufforderungen wie „Erstelle eine AgentCore-Runtime“, „Rüste ein Gateway ein“ oder „Gib mir das CDK dafür“ und sollte nicht verwendet werden, wenn ein Gateway vor einer bestehenden Lambda erstellt werden soll oder die Ressourcen bereits von einer anderen Infrastruktur verwaltet werden. Sie funktioniert mit Claude Code und anderen KI-Agenten, die Terraform-, CDK- oder CLI-Workflows unterstützen.

Funktioniert mit✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alexaiarchitect/agentcore-skills/tree/HEAD/skills/agentcore-create

Installed? Explore more Schreiben & Editieren skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

AgentCore-Ressourcen als IaC erstellen

Eine neue AgentCore-Ressource sollte als überprüftes Modul im selben Baum landen, den das Team bereitstellt – nicht als Klick in der Konsole, den niemand reproduzieren kann. Diese Fähigkeit schreibt kleine, flache Terraform-Module – eine main.tf, variables.tf, outputs.tf, versions.tf – die der Nutzer aus seinem Root-Modul einbindet. Die Module sind bewusst einfach gehalten: Jedes Argument wird in einem Kommentar erklärt, Geheimnisse sind nur schreibbar, und das Gateway wird niemals ohne einen Authorizer erstellt.

${CLAUDE_SKILL_DIR} wird von der Skill-Laufzeit auf das eigene Verzeichnis dieser Fähigkeit gesetzt. Verwenden Sie es unverändert in jedem Befehl unten; die Skripte einer benachbarten Fähigkeit liegen unter ${CLAUDE_SKILL_DIR}/../<skill>/scripts/.

Ablauf

  1. Erkunden Sie zuerst, damit das Modul neben den vorhandenen Modulen landet und die Region bekannt ist:

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

    Wenn die AgentCore-CLI oder CDK bereits AgentCore-Ressourcen verwaltet (Bereich DSC004), bieten Sie passend --iac anstelle von Terraform an.

  2. Planen Sie den Schreibvorgang.

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

    --component gateway|identity|memory, --iac terraform|cdk|cli, --name, --out-dir, --protocol HTTP|MCP|A2A|AGUI (Runtime).

  3. Optionen. Terraform-Modul (empfohlen, kostenlos), CDK-Stack (kostenlos) oder die AgentCore-CLI-Befehle (kostenlos zur Anzeige; agentcore deploy selbst ist aws).

  4. Bestätigen Sie mit AskUserQuestion, führen Sie dann denselben Befehl ohne --dry-run aus. Verwenden Sie --force nur, wenn der Nutzer nach dem Plan explizit das Ersetzen einer Datei verlangt hat.

  5. Überprüfen Sie das Ergebnis mit der Überprüfung und zeigen Sie es an:

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

Entscheidungsregeln

  • Terraform zuerst. Es ist das, was der erste Nutzer ausführt, und die einzige Option, bei der die Überprüfung, der Bereitstellungsplan und die CI-Richtlinie dieses Plugins alle greifen. Der hashicorp/aws-Provider deckt jede Kernressource ab; siehe provider-coverage.md für das, was awscc oder die CLI benötigt.
  • Ein Modul wird eingebunden, nicht angewendet. Das Skript gibt den einzufügenden module-Block aus; es bearbeitet niemals das Root-Modul.
  • Nur-schreibbare Geheimnisse benötigen Terraform 1.11+. Die generierte versions.tf gibt dies vor; älteres Terraform muss eine sensitive Variable verwenden und akzeptieren, dass das Geheimnis im State liegt (ACR031).
  • Das Starter-Toolkit wird nicht angeboten. Seine CLI wird nicht mehr unterstützt; die AgentCore-CLI ist die CLI-Alternative.

Referenzen

FrageDatei
Was jedes generierte Modul enthält und warumterraform-modules.md
Die CDK- und AgentCore-CLI-Pfade und wann man sie wähltcdk-and-cli-alternatives.md
Welche Ressourcen hashicorp/aws abdeckt; awscc- und CLI-Fallbacksprovider-coverage.md

Skripte

BefehlAufgabeExit-Codes
scripts/scaffold.py <projekt> --component C [--iac terraform|cdk|cli] [--dry-run] [--force] [--json]Plant und schreibt ein Modul, einen CDK-Stack oder gibt CLI-Befehle aus0 geschrieben/geplant, 1 nichts zu schreiben, 2 fehlerhafte Argumente

Erledigungsliste

  • Die Erkennung wurde ausgeführt und das gewählte IaC stimmt mit dem überein, der bereits AgentCore-Ressourcen verwaltet.
  • Der Schreibplan wurde mit --dry-run angezeigt und vor dem Schreiben bestätigt.
  • Der module-Einbindungsblock wurde dem Nutzer mitgeteilt, nicht in sein Root-Modul geschrieben.
  • review.py wurde auf dem Ergebnis ausgeführt und seine Erkenntnisse wurden angezeigt.

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...

Verwandte Skills