Skip to content

Commit 0569af5

Browse files
authored
Merge pull request #75 from aws-samples/latest-bedrock-version
bumping to latest bedrock module version and removing redundant iam
2 parents da5bb3e + ed009b8 commit 0569af5

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

samples/bedrock-agent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ This project is built using [Terraform](https://www.terraform.io/). See [Getting
8585
```shell
8686
python -m venv .venv
8787
source .venv/bin/activate
88-
pip install poetry
88+
pip install poetry==1.8.3
8989
```
9090

9191
4. Initialize the neccessary Terraform providers.

samples/bedrock-agent/main.tf

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ provider "opensearch" {
1414
module "bedrock" {
1515
#checkov:skip=CKV_TF_1:Terraform registry has no ability to use a commit hash
1616
source = "aws-ia/bedrock/aws"
17-
version = "0.0.5"
17+
version = "0.0.7"
1818
create_kb = true
1919
create_default_kb = true
2020
create_agent = true
@@ -47,24 +47,3 @@ module "lambda" {
4747
}
4848
]
4949
}
50-
51-
resource "aws_lambda_permission" "allow_bedrock_agent" {
52-
action = "lambda:InvokeFunction"
53-
function_name = module.lambda.lambda_function_arn
54-
principal = "bedrock.amazonaws.com"
55-
source_arn = module.bedrock.bedrock_agent[0].agent_arn
56-
}
57-
58-
resource "aws_iam_role_policy" "agent_policy" {
59-
policy = jsonencode({
60-
Version = "2012-10-17"
61-
Statement = [
62-
{
63-
Effect = "Allow"
64-
Action = "lambda:InvokeModel"
65-
Resource = module.lambda.lambda_function_arn
66-
}
67-
]
68-
})
69-
role = split("/", provider::aws::arn_parse(module.bedrock.bedrock_agent[0].agent_resource_role_arn).resource)[1]
70-
}

samples/bedrock-guardrails/main.tf

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module "bedrock_withoutguardrail" {
22
#checkov:skip=CKV_TF_1:Terraform registry has no ability to use a commit hash
33
source = "aws-ia/bedrock/aws"
4-
version = "0.0.6"
4+
version = "0.0.7"
55
create_kb = false
66
create_default_kb = false
77
create_s3_data_source = false
@@ -17,7 +17,7 @@ module "bedrock_withoutguardrail" {
1717
module "bedrock_withguardrail" {
1818
#checkov:skip=CKV_TF_1:Terraform registry has no ability to use a commit hash
1919
source = "aws-ia/bedrock/aws"
20-
version = "0.0.6"
20+
version = "0.0.7"
2121
create_kb = false
2222
create_default_kb = false
2323
create_s3_data_source = false
@@ -38,19 +38,3 @@ module "bedrock_withguardrail" {
3838
blocked_input_messaging = var.blocked_input_messaging
3939
blocked_outputs_messaging = var.blocked_outputs_messaging
4040
}
41-
42-
resource "aws_iam_role_policy" "guardrail_policy" {
43-
policy = jsonencode({
44-
Version = "2012-10-17"
45-
Statement = [
46-
{
47-
Effect = "Allow"
48-
Action = [
49-
"bedrock:ApplyGuardrail",
50-
]
51-
Resource = module.bedrock_withguardrail.bedrock_agent[0].guardrail_configuration.guardrail_identifier
52-
}
53-
]
54-
})
55-
role = split("/", provider::aws::arn_parse(module.bedrock_withguardrail.bedrock_agent[0].agent_resource_role_arn).resource)[1]
56-
}

0 commit comments

Comments
 (0)