
Aws Amplify
Wire Bedrock-backed conversation and one-shot generation routes into an Amplify Gen 2 backend after auth and data are defined.
Overview
aws-amplify is an agent skill for the Build phase that documents how to add Amplify Gen 2 conversation and generation AI routes with correct Bedrock model selection.
Install
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill aws-amplifyWhat is this skill?
- Select models with `a.ai.model('Claude Sonnet 4.5')` or Bedrock `resourcePath` escape hatch for unsupported IDs
- `a.conversation()` supports any supported model; `a.generation()` is limited to Anthropic Claude models
- Documents Bedrock Model access troubleshooting for `AccessDeniedException` on restricted model IDs
- Prerequisites: `defineBackend({ auth, data })` in `amplify/backend.ts` before adding AI routes
- Points to Amplify global inference profiles and regional Bedrock enablement constraints
Adoption & trust: 1.1k installs on skills.sh; 819 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have an Amplify backend but no clear pattern for choosing Bedrock models or defining `a.conversation()` versus `a.generation()` routes without hitting model or access errors.
Who is it for?
Indie builders extending an existing Amplify Gen 2 app with chat or generation features backed by AWS Bedrock.
Skip if: Greenfield apps with no Amplify backend yet, or teams that only need generic LLM prompting outside Amplify’s data schema.
When should I use this skill?
Backend defined in `amplify/backend.ts` with `defineBackend({ auth, data })` and you are adding or fixing Amplify AI conversation or generation routes.
What do I get? / Deliverables
After following the skill, your `amplify/data` schema declares AI routes with valid `aiModel` choices and you know how to fix Bedrock access issues before shipping.
- Conversation and/or generation route definitions in the Amplify data schema
- Documented `aiModel` selection matching route type constraints
Recommended Skills
Journey fit
Canonical shelf is Build because the skill documents Amplify data-schema AI routes (`a.conversation`, `a.generation`) and model selection—not idea research or production alerting. Integrations fits AWS Amplify + Amazon Bedrock model wiring inside `amplify/data/resource.ts` alongside existing backend resources.
How it compares
Amplify-schema AI routing guidance—not a standalone MCP server or generic “call OpenAI from a script” skill.
Common Questions / FAQ
Who is aws-amplify for?
Solo and indie developers already on Amplify Gen 2 who need Bedrock-integrated conversation or generation routes in their data layer.
When should I use aws-amplify?
During Build when you are adding `a.conversation()` or `a.generation()` to `resource.ts`, picking Claude versus other models, or debugging Bedrock model access in your deployment region.
Is aws-amplify safe to install?
Treat it as documentation that may drive AWS API usage; review the Security Audits panel on this Prism page and restrict agent permissions around cloud credentials.
SKILL.md
READMESKILL.md - Aws Amplify
# AI > **Prerequisites:** Backend defined in `amplify/backend.ts` with `defineBackend({ auth, data })`. ## Model Selection Use `a.ai.model()` to select an AI model in both `a.conversation()` and `a.generation()` routes. Pass a human-readable model name string: ```typescript aiModel: a.ai.model('Claude Sonnet 4.5') ``` For the full list of supported models, see [AI Concepts: Models](https://docs.amplify.aws/react/ai/concepts/models/). Key constraint: `a.generation()` routes only support Anthropic (Claude) models. `a.conversation()` routes work with any supported model. For models not in the supported list, use the raw escape hatch: `aiModel: { resourcePath: '<bedrock-model-id>' }`. Availability depends on the AWS region and Bedrock model access enablement. ### Bedrock Model Access Some older or restricted models require explicit enablement in the AWS Bedrock console (Model access). On-demand foundation models (Claude Sonnet 4+, Nova) are available immediately. Amplify uses global inference profiles for cross-region model access. If you get `AccessDeniedException: Could not access the model with the specified model ID`, check **Bedrock → Model access** in your region. ## Backend: Conversation Routes Define multi-turn conversation routes in your data schema using `a.conversation()`: ```typescript // amplify/data/resource.ts import { a, type ClientSchema } from '@aws-amplify/backend'; const schema = a.schema({ chat: a.conversation({ aiModel: a.ai.model('Claude Sonnet 4.5'), systemPrompt: 'You are a helpful assistant.', }) .authorization(allow => allow.owner()), }); ``` ## Backend: Generation Routes Use `a.generation()` for single-turn (stateless) inference. ```typescript const schema = a.schema({ summarize: a.generation({ aiModel: a.ai.model('Claude Sonnet 4.5'), systemPrompt: 'Summarize the provided text concisely.', inferenceConfiguration: { maxTokens: 500, temperature: 0.3 }, }) .arguments({ text: a.string().required() }) .returns(a.customType({ summary: a.string() })) .authorization(allow => allow.authenticated()), }); ``` **Authorization constraints (these cause TypeError at CDK assembly if violated):** - **Conversation routes** (`a.conversation()`) require `allow.owner()` authorization — `allow.authenticated()` and other non-owner strategies throw a TypeError at CDK assembly time. - **Generation routes** (`a.generation()`) require non-owner authorization (`allow.authenticated()`, `allow.guest()`, `allow.group()`, or `allow.publicApiKey()`) — `allow.owner()` throws a TypeError at CDK assembly time. These constraints are asymmetric and frequently confused. Getting them wrong causes the CDK synthesis to fail with a non-obvious TypeError. > **Security:** Conversation history sent to Amazon Bedrock may contain PII. Do not log full request/response payloads in production. Enable CloudWatch Logs encryption (KMS) and set appropriate retention policies for any logs that may capture inference data. ### Backend Integration AI conversation and generation routes are part of your data schema. Import into `amplify/backend.ts`: ```typescript import { defineBackend } from '@aws-amplify/backend'; import { data } from './data/resource'; defineBackend({ data }); // AI routes live inside the data schema ``` ## Backend: AI Tools Attach Lambda functions as tools to conversation routes so the AI model can invoke them: ```typescript import { myToolFunc } from '../functions/my-tool/resource'; const schema = a.schema({ chat: a.conversation({ aiModel: a.ai.model('Claude Sonnet 4.5'), systemPrompt: 'You are a helpful assistant with tool access.', tools: [ { name: 'getWeather', query: a.ref('getWeather'), description: 'Get current weather for a city', }, ], }) .authorization(allow => allow.owner()), getWeather: a.query() .arguments({ city: a.string().required() }) .returns(a.customType({ temp: a.float(), condition: a.stri