Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/extract-review-risk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ fi

echo "risk_level=${RISK}" >> "$GITHUB_OUTPUT"
echo "LLM review risk: ${RISK}"

if [ "$RISK" = "FAILED" ]; then
echo "LLM review failed — blocking pipeline."
exit 1
fi
19 changes: 18 additions & 1 deletion terraform/platform/iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,31 @@ resource "aws_iam_role_policy" "ci_infra_plan_extras" {
Resource = "arn:aws:s3:::${var.project}-ci-plan-artifacts-${var.aws_account_id}/*"
},
{
Sid = "BedrockForReview"
Sid = "BedrockInferenceProfile"
Effect = "Allow"
Action = [
"bedrock:InvokeModel",
"bedrock:Converse",
]
Resource = "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.anthropic.*"
},
{
# Cross-region inference profiles route to foundation models in EU
# destination regions. IAM requires access to destination model ARNs.
# Condition scopes this to only work via our inference profiles.
Sid = "BedrockFoundationModels"
Effect = "Allow"
Action = [
"bedrock:InvokeModel",
"bedrock:Converse",
]
Resource = "arn:aws:bedrock:eu-*::foundation-model/anthropic.*"
Condition = {
StringLike = {
"bedrock:InferenceProfileArn" = "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.anthropic.*"
}
}
},
{
Sid = "SSMReadSlackWebhook"
Effect = "Allow"
Expand Down
49 changes: 35 additions & 14 deletions terraform/platform/lambdas/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
locals {
lambda_src_path = "${path.module}/../../lambda-src"
github_org_url = "https://github.com/javaBin"

# EU cross-region inference profiles route to any eu-* region.
# IAM requires foundation model access in destination regions.
bedrock_eu_foundation_model_arns = "arn:aws:bedrock:eu-*::foundation-model/anthropic.*"
bedrock_inference_profile_arn = "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.anthropic.*"
}

################################################################################
Expand Down Expand Up @@ -159,13 +164,21 @@ resource "aws_iam_role_policy" "slack_alert" {
]
},
{
Sid = "Bedrock"
Effect = "Allow"
Action = [
"bedrock:InvokeModel",
"bedrock:Converse",
]
Resource = "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.anthropic.*"
Sid = "BedrockInferenceProfile"
Effect = "Allow"
Action = ["bedrock:InvokeModel", "bedrock:Converse"]
Resource = local.bedrock_inference_profile_arn
},
{
Sid = "BedrockFoundationModels"
Effect = "Allow"
Action = ["bedrock:InvokeModel", "bedrock:Converse"]
Resource = local.bedrock_eu_foundation_model_arns
Condition = {
StringLike = {
"bedrock:InferenceProfileArn" = local.bedrock_inference_profile_arn
}
}
},
{
Sid = "PricingRead"
Expand Down Expand Up @@ -236,13 +249,21 @@ resource "aws_iam_role_policy" "cost_report" {
Resource = "*"
},
{
Sid = "Bedrock"
Effect = "Allow"
Action = [
"bedrock:InvokeModel",
"bedrock:Converse",
]
Resource = "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.anthropic.*"
Sid = "BedrockInferenceProfile"
Effect = "Allow"
Action = ["bedrock:InvokeModel", "bedrock:Converse"]
Resource = local.bedrock_inference_profile_arn
},
{
Sid = "BedrockFoundationModels"
Effect = "Allow"
Action = ["bedrock:InvokeModel", "bedrock:Converse"]
Resource = local.bedrock_eu_foundation_model_arns
Condition = {
StringLike = {
"bedrock:InferenceProfileArn" = local.bedrock_inference_profile_arn
}
}
},
]
})
Expand Down
Loading