plugins/developer-kit-aws/skills/aws-cloudformation/aws-cloudformation-bedrock/SKILL.md
Provides AWS CloudFormation patterns for Amazon Bedrock resources including agents, knowledge bases, data sources, guardrails, prompts, flows, and inference profiles. Use when creating Bedrock agents with action groups, implementing RAG with knowledge bases, configuring vector stores, setting up content moderation guardrails, managing prompts, orchestrating workflows with flows, and configuring inference profiles for model optimization.
npx skillsauth add giuseppe-trisciuoglio/developer-kit aws-cloudformation-bedrockInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Creates production-ready AI infrastructure using AWS CloudFormation templates for Amazon Bedrock. Covers Bedrock agents, knowledge bases for RAG implementations, data source connectors, guardrails for content moderation, prompt management, workflow orchestration with flows, and inference profiles for optimized model access.
Parameters:
FoundationModel:
Type: String
Default: anthropic.claude-3-sonnet-20240229-v1:0
AllowedValues:
- anthropic.claude-3-sonnet-20240229-v1:0
- anthropic.claude-3-haiku-20240307-v1:0
- amazon.titan-text-express-v1
Description: Foundation model for agent
Resources:
AgentRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: bedrock.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: BedrockPermissions
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- bedrock:InvokeModel
Resource: !Sub "arn:aws:bedrock:${AWS::Region}:${AWS::AccountId}:foundation-model/${FoundationModel}"
BedrockAgent:
Type: AWS::Bedrock::Agent
Properties:
AgentName: !Sub "${AWS::StackName}-agent"
AgentResourceRoleArn: !GetAtt AgentRole.Arn
FoundationModelArn: !Sub "arn:aws:bedrock:${AWS::Region}::foundation-model/${FoundationModel}"
AutoPrepare: true
Instruction: |
You are a helpful assistant. Use the knowledge base to answer questions.
KnowledgeBaseRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: bedrock.amazonaws.com
Action: sts:AssumeRole
KnowledgeBase:
Type: AWS::Bedrock::KnowledgeBase
Properties:
Name: !Sub "${AWS::StackName}-kb"
RoleArn: !GetAtt KnowledgeBaseRole.Arn
KnowledgeBaseConfiguration:
Type: VECTOR
VectorKnowledgeBaseConfiguration:
EmbeddingModelArn: !Sub "arn:aws:bedrock:${AWS::Region}::embedding-model/amazon.titan-embed-text-v1"
DataBucket:
Type: AWS::S3::Bucket
S3DataSource:
Type: AWS::Bedrock::DataSource
Properties:
KnowledgeBaseId: !Ref KnowledgeBase
Name: s3-data-source
Type: S3
DataSourceConfiguration:
S3Configuration:
BucketArn: !GetAtt DataBucket.Arn
InclusionPrefixes:
- documents/
Guardrail:
Type: AWS::Bedrock::Guardrail
Properties:
Name: !Sub "${AWS::StackName}-guardrail"
BlockedInputMessaging: "I cannot help with that request."
ContentPolicyConfig:
filtersConfig:
- type: PROFANITY
- type: MISCONDUCT
ActionLambdaFunction:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.12
Handler: index.handler
Role: !GetAtt ActionLambdaRole.Arn
Code:
ZipFile: |
def handler(event, context):
return {"statusCode": 200, "body": "{\"result\": \"success\"}"}
ActionGroup:
Type: AWS::Bedrock::AgentActionGroup
Properties:
ActionGroupName: api-operations
ActionGroupState: ENABLED
AgentId: !GetAtt BedrockAgent.AgentId
ActionGroupExecutor:
Lambda: !Ref ActionLambdaFunction
FunctionSchema:
functionConfigurations:
- function: |
{ "name": "get_inventory", "description": "Get current inventory status", "parameters": { "type": "object", "properties": { "sku": { "type": "string" } }, "required": [] } }
Always validate the template before deployment:
aws cloudformation validate-template --template-body file://bedrock-template.yaml
# Check agent status
aws bedrock-agent get-agent --agent-id $(aws cloudformation describe-stacks --stack-name STACK_NAME --query 'Stacks[0].Outputs[?OutputKey==`AgentId`].OutputValue' --output text)
# Check knowledge base sync status
aws bedrock-agent list-knowledge-bases --agent-id AGENT_ID
# Test guardrail
aws bedrock-runtime apply_guardrail --guardrail-identifier GUARDRAIL_ID --source SOURCE
Complete working template for a RAG-enabled agent:
AWSTemplateFormatVersion: "2010-09-09"
Description: "Bedrock RAG Agent with Knowledge Base"
Parameters:
FoundationModel:
Type: String
Default: anthropic.claude-3-sonnet-20240229-v1:0
Resources:
# IAM Role for Agent
AgentRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub "${AWS::StackName}-agent-role"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: bedrock.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: InvokeModel
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: bedrock:InvokeModel
Resource: "*"
# IAM Role for Knowledge Base
KnowledgeBaseRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub "${AWS::StackName}-kb-role"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: bedrock.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: S3Access
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: s3:GetObject
Resource: !Sub "${DataBucket.Arn}/*"
# S3 Bucket for Documents
DataBucket:
Type: AWS::S3::Bucket
# Knowledge Base
KnowledgeBase:
Type: AWS::Bedrock::KnowledgeBase
Properties:
Name: !Sub "${AWS::StackName}-kb"
RoleArn: !GetAtt KnowledgeBaseRole.Arn
KnowledgeBaseConfiguration:
Type: VECTOR
VectorKnowledgeBaseConfiguration:
EmbeddingModelArn: !Sub "arn:aws:bedrock:${AWS::Region}::embedding-model/amazon.titan-embed-text-v1"
# Data Source
DataSource:
Type: AWS::Bedrock::DataSource
Properties:
KnowledgeBaseId: !Ref KnowledgeBase
Name: !Sub "${AWS::StackName}-ds"
Type: S3
DataSourceConfiguration:
S3Configuration:
BucketArn: !GetAtt DataBucket.Arn
# Bedrock Agent
BedrockAgent:
Type: AWS::Bedrock::Agent
Properties:
AgentName: !Sub "${AWS::StackName}-agent"
AgentResourceRoleArn: !GetAtt AgentRole.Arn
FoundationModelArn: !Sub "arn:aws:bedrock:${AWS::Region}::foundation-model/${FoundationModel}"
AutoPrepare: true
Instruction: |
You are a helpful assistant. Use the knowledge base to answer user questions accurately.
Outputs:
AgentId:
Description: Bedrock Agent ID
Value: !GetAtt BedrockAgent.AgentId
KnowledgeBaseId:
Description: Knowledge Base ID
Value: !Ref KnowledgeBase
Resources:
Guardrail:
Type: AWS::Bedrock::Guardrail
Properties:
Name: !Sub "${AWS::StackName}-guardrail"
blockedInputMessaging: "Content blocked by safety filters."
blockedOutputMessaging: "Response filtered for safety."
contentPolicyConfig:
filtersConfig:
- type: PROFANITY
inputStrength: HIGH
outputStrength: HIGH
- type: MISCONDUCT
inputStrength: HIGH
outputStrength: HIGH
sensitiveInformationPolicyConfig:
piiEntitiesConfig:
- type: EMAIL
action: ANONYMIZE
- type: SSN
action: BLOCK
aws cloudformation validate-template before deployFor detailed limits, see constraints.md:
development
Provides security review capability for TypeScript/Node.js applications, validates code against XSS, injection, CSRF, JWT/OAuth2 flaws, dependency CVEs, and secrets exposure. Use when performing security audits, before deployment, reviewing authentication/authorization implementations, or ensuring OWASP compliance for Express, NestJS, and Next.js. Triggers on "security review", "check for security issues", "TypeScript security audit".
development
Provides final code cleanup after task review approval. Removes debug logs, temporary comments, dead code, optimizes imports, and improves readability. Use when asked to clean up code, polish, finalize, tidy up, remove technical debt, or prepare code for completion after review. Not for refactoring logic or fixing bugs—focused solely on cosmetic and hygiene cleanup.
tools
Ralph Wiggum-inspired automation loop for specification-driven development. Orchestrates task implementation, review, cleanup, and synchronization using a Python script. Use when: user runs /loop command, user asks to automate task implementation, user wants to iterate through spec tasks step-by-step, or user wants to run development workflow automation with context window management. One step per invocation. State machine: init → choose_task → implementation → review → fix → cleanup → sync → update_done. Supports --from-task and --to-task for task range filtering. State persisted in fix_plan.json.
testing
Creates, updates, validates, and displays the architectural DNA of a project through two shared documents: docs/specs/architecture.md (technology stack, architectural rules, security constraints, AI guardrails) and docs/specs/ontology.md (domain glossary / Ubiquitous Language). Use BEFORE brainstorm as a project setup step, or at any point in the SDD lifecycle to validate specs/tasks against architecture principles. Triggers on 'create constitution', 'update constitution', 'constitution check', 'validate against constitution', 'project principles', 'architectural guardrails', 'setup project architecture', 'define ontology'.