Skip to content

Comments

Add AWS Bedrock builders (Agent, Knowledge Base, Data Source, Guardrail)#24

Open
Thorium wants to merge 2 commits intototallymoney:mainfrom
Thorium:aws-bedrock
Open

Add AWS Bedrock builders (Agent, Knowledge Base, Data Source, Guardrail)#24
Thorium wants to merge 2 commits intototallymoney:mainfrom
Thorium:aws-bedrock

Conversation

@Thorium
Copy link
Contributor

@Thorium Thorium commented Feb 14, 2026

Summary

  • Adds src/Bedrock.fs with 4 computation expression builders: bedrockAgent, bedrockKnowledgeBase, bedrockDataSource, bedrockGuardrail
  • Integrates into Stack.fs with Operation DU cases, processOperation, Yield, and Bind methods for let! support
  • Adds 35 Expecto tests covering required field validation, property assignment, tags, and mutable resource references

Details

All builders follow the established Config/Spec/Builder pattern:

  • BedrockAgentBuilder — wraps CfnAgent with foundation model, instruction, auto-prepare defaults
  • BedrockKnowledgeBaseBuilder — wraps CfnKnowledgeBase with typed IKnowledgeBaseConfigurationProperty and IStorageConfigurationProperty parameters
  • BedrockDataSourceBuilder — wraps CfnDataSource with typed IDataSourceConfigurationProperty, encryption, and vector ingestion config
  • BedrockGuardrailBuilder — wraps CfnGuardrail with typed policy config interfaces (content, grounding, PII, topic, word) and ICfnTag conversion

Conventions followed:

  • Typed CDK interface parameters (not obj) for type-safe custom operations
  • Guarded tag Combine pattern (matching AppRunner/XRay)
  • Inline Yield/Zero defaults, state2.XxxName in Combine
  • CfnTag conversion from (string * string) list in Run
  • Documentation script (docs/bedrock.fsx) and docs/index.fsx updated

Build & Tests

  • Build: 0 warnings, 0 errors
  • Tests: 393 passed, 3 skipped (pre-existing RDS/XRay), 0 failures

- Add Bedrock.fs with 4 computation expression builders following the Config/Spec/Builder pattern
- Integrate into Stack.fs with Operation DU cases, processOperation, Yield, and Bind methods
- Add 35 Expecto tests covering all builders, required field validation, and property assignment
- Add documentation script (docs/bedrock.fsx) and update docs/index.fsx
- Use typed CDK interface parameters for type-safe custom operations
- Follow established conventions: guarded tag Combine, inline Yield/Zero defaults, CfnTag conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant