Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/giuseppe-trisciuoglio-aws-cloudformation-bedrock/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 152% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 277% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 144% | 0% |
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.
yamlParameters: 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
yamlResources: 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}"
yamlBedrockAgent: 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.
yamlKnowledgeBaseRole: 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"
yamlDataBucket: 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/
yamlGuardrail: Type: AWS::Bedrock::Guardrail Properties: Name: !Sub "${AWS::StackName}-guardrail" BlockedInputMessaging: "I cannot help with that request." ContentPolicyConfig: filtersConfig: - type: PROFANITY - type: MISCONDUCT
yamlActionLambdaFunction: 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:
bashaws cloudformation validate-template --template-body file://bedrock-template.yaml
bash# 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:
yamlAWSTemplateFormatVersion: "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
yamlResources: 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:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 26,161 | 22,068 | -16% | 1 | 1 | 0% | 5,209 | 7,915 | +52% | 0 | 0 | — |
case-02 | pass→pass | 9,713 | 5,705 | -41% | 1 | 1 | 0% | 1,905 | 4,202 | +121% | 0 | 0 | — |
case-03 | fail→pass | 20,743 | 16,295 | -21% | 1 | 1 | 0% | 4,191 | 6,804 | +62% | 0 | 0 | — |
case-04 | pass→pass | 28,434 | 18,507 | -35% | 1 | 1 | 0% | 5,467 | 7,014 | +28% | 0 | 0 | — |
case-05 | pass→pass | 12,076 | 9,388 | -22% | 1 | 1 | 0% | 2,223 | 4,804 | +116% | 0 | 0 | — |
case-06 | pass→pass | 11,975 | 10,152 | -15% | 1 | 1 | 0% | 2,439 | 5,140 | +111% | 0 | 0 | — |
case-07 | pass→pass | 5,774 | 4,212 | -27% | 1 | 1 | 0% | 1,133 | 3,922 | +246% | 0 | 0 | — |
case-08 | pass→pass | 8,413 | 5,124 | -39% | 1 | 1 | 0% | 1,613 | 4,112 | +155% | 0 | 0 | — |
case-09 | fail→pass | 8,591 | 7,233 | -16% | 1 | 1 | 0% | 1,744 | 4,399 | +152% | 0 | 0 | — |
case-10 | pass→pass | 6,217 | 5,416 | -13% | 1 | 1 | 0% | 1,080 | 3,935 | +264% | 0 | 0 | — |
case-11 | pass→pass | 5,646 | 4,837 | -14% | 1 | 1 | 0% | 1,012 | 3,888 | +284% | 0 | 0 | — |
case-12 | pass→pass | 10,420 | 7,428 | -29% | 1 | 1 | 0% | 1,868 | 4,292 | +130% | 0 | 0 | — |
case-13 | pass→pass | 3,298 | 2,930 | -11% | 1 | 1 | 0% | 515 | 3,428 | +566% | 0 | 0 | — |
case-14 | pass→pass | 3,221 | 3,627 | +13% | 1 | 1 | 0% | 551 | 3,629 | +559% | 0 | 0 | — |
case-15 | fail→fail | 4,178 | 4,361 | +4% | 1 | 1 | 0% | 700 | 3,767 | +438% | 0 | 0 | — |
case-16 | pass→pass | 4,666 | 4,023 | -14% | 1 | 1 | 0% | 713 | 3,709 | +420% | 0 | 0 | — |
case-17 | fail→pass | 5,482 | 4,767 | -13% | 1 | 1 | 0% | 1,038 | 3,915 | +277% | 0 | 0 | — |
case-18 | pass→pass | 5,472 | 4,545 | -17% | 1 | 1 | 0% | 897 | 3,922 | +337% | 0 | 0 | — |
case-19 | pass→pass | 5,271 | 5,022 | -5% | 1 | 1 | 0% | 1,012 | 4,022 | +297% | 0 | 0 | — |
case-20 | pass→pass | 10,934 | 6,538 | -40% | 1 | 1 | 0% | 2,149 | 4,194 | +95% | 0 | 0 | — |
case-21 | pass→pass | 7,561 | 5,159 | -32% | 1 | 1 | 0% | 958 | 3,815 | +298% | 0 | 0 | — |
case-22 | fail→pass | 9,217 | 2,845 | -69% | 1 | 1 | 0% | 1,419 | 3,468 | +144% | 0 | 0 | — |
case-23 | pass→pass | 10,828 | 9,237 | -15% | 1 | 1 | 0% | 2,307 | 4,965 | +115% | 0 | 0 | — |
case-24 | pass→pass | 4,272 | 3,569 | -16% | 1 | 1 | 0% | 703 | 3,659 | +420% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +21 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.