Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some spelling errors. Added textract policy for apps #5515

Merged
merged 11 commits into from
Oct 3, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ data "aws_iam_policy_document" "bedrock_integration" {
#checkov:skip=CKV_AWS_111: This is a service policy
#checkov:skip=CKV_AWS_356: Needs to access multiple resources
statement {
sid = "AnalyticalPlatformBedrockIntegrtion"
sid = "AnalyticalPlatformBedrockIntegration"
effect = "Allow"
actions = [
"bedrock:ListFoundationModels",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ data "aws_iam_policy_document" "bedrock_integration" {
#checkov:skip=CKV_AWS_111: This is a service policy
#checkov:skip=CKV_AWS_356: Needs to access multiple resources
statement {
sid = "AnalyticalPlatformBedrockIntegrtion"
sid = "AnalyticalPlatformBedrockIntegration"
effect = "Allow"

actions = [
Expand Down Expand Up @@ -68,8 +68,62 @@ data "aws_iam_policy_document" "bedrock_integration" {
}
}

#tfsec:ignore:aws-iam-no-policy-wildcards
data "aws_iam_policy_document" "textract_integration" {
#checkov:skip=CKV_AWS_111: This is a service policy
#checkov:skip=CKV_AWS_356: Needs to access multiple resources
statement {
sid = "AnalyticalPlatformTextractIntegration"
effect = "Allow"

actions = [
"textract:AnalyzeDocument",
"textract:DetectDocumentText",
"textract:GetDocumentAnalysis",
"textract:GetLendingAnalysis",
"textract:ListAdapterVersions",
"textract:AnalyzeExpense",
"textract:GetAdapter",
"textract:GetDocumentTextDetection",
"textract:GetLendingAnalysisSummary",
"textract:ListTagsForResource",
"textract:AnalyzeID",
"textract:GetAdapterVersion",
"textract:GetExpenseAnalysis",
"textract:ListAdapters",
"textract:CreateAdapter",
"textract:DeleteAdapterVersion",
"textract:StartExpenseAnalysis",
"textract:CreateAdapterResource",
"textract:StartDocumentAnalysis",
"textract:StartLendingAnalysis",
"textract:DeleteAdapter",
"textract:StartDocumentTextDetection",
"textract:UpdateAdapter",
"textract:TagResource",
"textract:UntagResource",
]

resources = ["*"]
condition {
test = "StringEquals"
variable = "aws:RequestedRegion"
values = [
"eu-west-1",
"eu-west-2",
]
}
}
}

resource "aws_iam_policy" "bedrock_integration" {
name = "analytical-platform-bedrock-integration"
description = "Permissions needed to allow access to Bedrock in Frankfurt from tooling."
policy = data.aws_iam_policy_document.bedrock_integration.json
}

resource "aws_iam_policy" "textract_integration" {
name = "analytical-platform-textract-integration"
description = "Permissions needed to allow access to Textract from tooling."
policy = data.aws_iam_policy_document.textract_integration.json
}
Loading