{"id":49339530,"url":"https://github.com/citadel-cloud-management/terraform-aws-bedrock-platform","last_synced_at":"2026-04-27T03:03:10.507Z","repository":{"id":344652987,"uuid":"1175258946","full_name":"Citadel-Cloud-Management/terraform-aws-bedrock-platform","owner":"Citadel-Cloud-Management","description":"AWS Bedrock Terraform module with knowledge bases, agents, guardrails, and OpenSearch Serverless","archived":false,"fork":false,"pushed_at":"2026-04-11T22:21:01.000Z","size":33,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-12T00:34:32.984Z","etag":null,"topics":["ai","aws","bedrock","devops","generative-ai","infrastructure-as-code","production-ready","rag","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"https://citadel-cloud-management.github.io/terraform-aws-bedrock-platform/","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Citadel-Cloud-Management.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-07T13:12:47.000Z","updated_at":"2026-04-11T22:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Citadel-Cloud-Management/terraform-aws-bedrock-platform","commit_stats":null,"previous_names":["kogunlowo123/terraform-aws-bedrock-platform","citadel-cloud-management/terraform-aws-bedrock-platform"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Citadel-Cloud-Management/terraform-aws-bedrock-platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-aws-bedrock-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-aws-bedrock-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-aws-bedrock-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-aws-bedrock-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Citadel-Cloud-Management","download_url":"https://codeload.github.com/Citadel-Cloud-Management/terraform-aws-bedrock-platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Citadel-Cloud-Management%2Fterraform-aws-bedrock-platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32320686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","aws","bedrock","devops","generative-ai","infrastructure-as-code","production-ready","rag","terraform","terraform-module"],"created_at":"2026-04-27T03:03:04.373Z","updated_at":"2026-04-27T03:03:10.446Z","avatar_url":"https://github.com/Citadel-Cloud-Management.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-bedrock-platform\n\nTerraform module for deploying a comprehensive Amazon Bedrock platform with Knowledge Bases, Agents, Guardrails, OpenSearch Serverless vector storage, and model invocation logging.\n\n## Architecture\n\nThis module provisions a complete RAG (Retrieval-Augmented Generation) architecture on AWS:\n\n```\n                                    +---------------------------+\n                                    |    Amazon Bedrock         |\n                                    |    Model Invocation       |\n                                    |    Logging                |\n                                    +------------+--------------+\n                                                 |\n                                                 v\n                                    +---------------------------+\n                                    |    S3 Bucket (Logs)       |\n                                    +---------------------------+\n\n+-------------------+       +---------------------------+       +---------------------------+\n|                   |       |                           |       |                           |\n|   End Users /     +------\u003e+   Bedrock Agents          +------\u003e+   Foundation Models       |\n|   Applications    |       |   (Claude, Titan, etc.)   |       |   (LLM Inference)         |\n|                   |       |                           |       |                           |\n+-------------------+       +-------+-------+-----------+       +---------------------------+\n                                    |       |\n                          +---------+       +---------+\n                          |                           |\n                          v                           v\n              +-----------+----------+    +-----------+----------+\n              |                      |    |                      |\n              |  Action Groups       |    |  Bedrock Guardrails  |\n              |  (Lambda Functions)  |    |  - Content Filters   |\n              |                      |    |  - Denied Topics     |\n              +----------------------+    |  - PII Filters       |\n                                          +----------------------+\n                          |\n                          v\n              +-----------+----------+       +---------------------------+\n              |                      |       |                           |\n              |  Knowledge Bases     +------\u003e+  OpenSearch Serverless    |\n              |  (RAG Retrieval)     |       |  (Vector Store)           |\n              |                      |       |                           |\n              +-------+--------------+       +---------------------------+\n                      |\n                      v\n              +-------+--------------+\n              |                      |\n              |  S3 Data Sources     |\n              |  (Documents)         |\n              |                      |\n              +----------------------+\n```\n\n### RAG Flow\n\n1. **Document Ingestion**: Documents stored in S3 are ingested into Knowledge Bases, chunked according to the configured strategy, and embedded using the specified embedding model.\n2. **Vector Storage**: Embeddings are stored in an OpenSearch Serverless collection for efficient similarity search.\n3. **Query Processing**: When an Agent receives a query, it retrieves relevant context from Knowledge Bases via vector similarity search.\n4. **Response Generation**: The Agent uses the retrieved context along with its foundation model to generate grounded responses.\n5. **Safety Controls**: Guardrails filter inputs and outputs for content safety, denied topics, and sensitive information.\n6. **Observability**: Model invocation logging captures all interactions to S3 for auditing and analysis.\n\n### Component Diagram\n\n```mermaid\nflowchart TB\n    subgraph Agents[\"Bedrock Agents\"]\n        AGT[\"Agent\\n(Claude, Titan, etc.)\"]\n        AG[\"Action Groups\\n(Lambda Functions)\"]\n    end\n\n    subgraph KnowledgeBases[\"Knowledge Bases (RAG)\"]\n        KB[\"Knowledge Base\"]\n        S3D[\"S3 Data Sources\\n(Documents)\"]\n    end\n\n    subgraph VectorStore[\"Vector Storage\"]\n        OSS[\"OpenSearch Serverless\\n(Vector Index)\"]\n    end\n\n    subgraph Models[\"Foundation Models\"]\n        FM[\"LLM Inference\\n(Model Access)\"]\n        EMB[\"Embedding Model\\n(Titan Embed)\"]\n    end\n\n    subgraph Safety[\"Guardrails\"]\n        CF[\"Content Filters\"]\n        DT[\"Denied Topics\"]\n        PII[\"PII Filters\"]\n    end\n\n    subgraph Observability[\"Logging\"]\n        LOG[\"Model Invocation\\nLogging\"]\n        S3L[\"S3 Bucket\\n(Logs)\"]\n    end\n\n    AGT --\u003e FM\n    AGT --\u003e AG\n    AGT --\u003e KB\n    AGT --\u003e CF\n    KB --\u003e S3D\n    KB --\u003e EMB\n    EMB --\u003e OSS\n    CF --\u003e DT\n    CF --\u003e PII\n    LOG --\u003e S3L\n\n    style Agents fill:#FF9900,stroke:#FF9900,color:#fff\n    style KnowledgeBases fill:#1A73E8,stroke:#1A73E8,color:#fff\n    style VectorStore fill:#DD344C,stroke:#DD344C,color:#fff\n    style Models fill:#8C4FFF,stroke:#8C4FFF,color:#fff\n    style Safety fill:#3F8624,stroke:#3F8624,color:#fff\n    style Observability fill:#0078D4,stroke:#0078D4,color:#fff\n    style AGT fill:#FF9900,stroke:#cc7a00,color:#fff\n    style AG fill:#FF9900,stroke:#cc7a00,color:#fff\n    style KB fill:#1A73E8,stroke:#1459b3,color:#fff\n    style S3D fill:#1A73E8,stroke:#1459b3,color:#fff\n    style OSS fill:#DD344C,stroke:#b02a3d,color:#fff\n    style FM fill:#8C4FFF,stroke:#6b3dcc,color:#fff\n    style EMB fill:#8C4FFF,stroke:#6b3dcc,color:#fff\n    style CF fill:#3F8624,stroke:#2d6119,color:#fff\n    style DT fill:#3F8624,stroke:#2d6119,color:#fff\n    style PII fill:#3F8624,stroke:#2d6119,color:#fff\n    style LOG fill:#0078D4,stroke:#005a9e,color:#fff\n    style S3L fill:#0078D4,stroke:#005a9e,color:#fff\n```\n\n## Features\n\n- **Knowledge Bases**: Create multiple knowledge bases with S3 data sources and configurable chunking strategies\n- **Agents**: Deploy Bedrock agents with foundation models, instructions, and action groups\n- **Guardrails**: Configure content filters, denied topics, and sensitive information (PII) filters\n- **OpenSearch Serverless**: Automated vector store provisioning with encryption, network, and access policies\n- **Model Invocation Logging**: Centralized logging of all model invocations to S3\n- **IAM**: Least-privilege IAM roles automatically created for each component\n- **Submodules**: Standalone submodules for knowledge bases, agents, and guardrails\n\n## Usage\n\n```hcl\nmodule \"bedrock_platform\" {\n  source  = \"kogunlowo123/bedrock-platform/aws\"\n  version = \"~\u003e 1.0\"\n\n  name_prefix       = \"my-platform\"\n  log_s3_bucket_arn = \"arn:aws:s3:::my-log-bucket\"\n\n  knowledge_bases = {\n    docs = {\n      name                      = \"documentation\"\n      description               = \"Product documentation\"\n      embedding_model           = \"amazon.titan-embed-text-v1\"\n      s3_data_source_bucket_arn = \"arn:aws:s3:::my-docs-bucket\"\n      chunking_strategy         = \"FIXED_SIZE\"\n      max_tokens                = 300\n      overlap_percentage        = 20\n    }\n  }\n\n  agents = {\n    assistant = {\n      name             = \"assistant\"\n      description      = \"Customer assistant\"\n      foundation_model = \"anthropic.claude-3-sonnet-20240229-v1:0\"\n      instruction      = \"You are a helpful assistant.\"\n    }\n  }\n\n  guardrails = {\n    safety = {\n      name                     = \"content-safety\"\n      description              = \"Content safety guardrail\"\n      blocked_input_messaging  = \"Input blocked by safety policy.\"\n      blocked_output_messaging = \"Output blocked by safety policy.\"\n      content_filters = [\n        {\n          type            = \"HATE\"\n          input_strength  = \"HIGH\"\n          output_strength = \"HIGH\"\n        }\n      ]\n    }\n  }\n\n  opensearch_collection_name = \"my-vectors\"\n\n  tags = {\n    Environment = \"production\"\n  }\n}\n```\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | \u003e= 1.5.0 |\n| aws | \u003e= 5.20.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|----------|\n| name_prefix | Prefix for all resource names | `string` | n/a | yes |\n| enable_model_invocation_logging | Enable model invocation logging to S3 | `bool` | `true` | no |\n| log_s3_bucket_arn | ARN of the S3 bucket for invocation logs | `string` | `\"\"` | no |\n| knowledge_bases | Map of knowledge base configurations | `map(object)` | `{}` | no |\n| agents | Map of agent configurations | `map(object)` | `{}` | no |\n| guardrails | Map of guardrail configurations | `map(object)` | `{}` | no |\n| opensearch_collection_name | Name of the OpenSearch Serverless collection | `string` | `\"\"` | no |\n| opensearch_vector_index_name | Name of the vector index | `string` | `\"bedrock-knowledge-base-index\"` | no |\n| tags | Tags to apply to all resources | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| knowledge_base_ids | Map of knowledge base keys to IDs |\n| knowledge_base_arns | Map of knowledge base keys to ARNs |\n| data_source_ids | Map of data source keys to IDs |\n| agent_ids | Map of agent keys to IDs |\n| agent_arns | Map of agent keys to ARNs |\n| agent_alias_ids | Map of agent keys to alias IDs |\n| guardrail_ids | Map of guardrail keys to IDs |\n| guardrail_arns | Map of guardrail keys to ARNs |\n| guardrail_version_ids | Map of guardrail keys to version numbers |\n| opensearch_collection_arn | ARN of the OpenSearch Serverless collection |\n| opensearch_collection_endpoint | Endpoint of the OpenSearch Serverless collection |\n| opensearch_dashboard_endpoint | Dashboard endpoint of the OpenSearch Serverless collection |\n| knowledge_base_role_arns | Map of knowledge base keys to IAM role ARNs |\n| agent_role_arns | Map of agent keys to IAM role ARNs |\n| logging_role_arn | ARN of the logging IAM role |\n\n## Submodules\n\n| Module | Description |\n|--------|-------------|\n| [knowledge-base](./modules/knowledge-base/) | Standalone knowledge base with S3 data source |\n| [agent](./modules/agent/) | Standalone Bedrock agent with action groups |\n| [guardrails](./modules/guardrails/) | Standalone guardrail with filters and policies |\n\n## Examples\n\n- [Basic](./examples/basic/) - Single knowledge base and agent\n- [Advanced](./examples/advanced/) - Multiple knowledge bases, agents, and guardrails\n- [Complete](./examples/complete/) - Full platform deployment with all features\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitadel-cloud-management%2Fterraform-aws-bedrock-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcitadel-cloud-management%2Fterraform-aws-bedrock-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitadel-cloud-management%2Fterraform-aws-bedrock-platform/lists"}