Skip to content

Commit 1cd9ec2

Browse files
committed
bumping to latest bedrock module version and removing redundant iam
1 parent da5bb3e commit 1cd9ec2

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

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.6"
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-
}

0 commit comments

Comments
 (0)