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
10 changes: 10 additions & 0 deletions modules/eks/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ output "storage_worker_service_account_name" {
description = "The name of the service account for storage_worker"
}

# dma
output "dma_role_arn" {
value = module.dma_role[0].arn
description = "The ARN of the AWS Bedrock role"
}
output "dma_service_account_name" {
value = var.dma_service_account_name
description = "The name of the service account for dma"
}

# Clickhouse backup
output "clickhouse_backup_role_name" {
value = module.clickhouse_backup_role.arn
Expand Down
20 changes: 20 additions & 0 deletions modules/eks/roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,21 @@ module "clickhouse_backup_role" {
}
}

# storage_worker
module "dma_role" {
count = 1
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts"
name = "${var.deployment_name}-${var.dma_service_account_name}"
version = "6.2.1"

oidc_providers = {
ex = {
provider_arn = module.eks.oidc_provider_arn
namespace_service_accounts = ["${var.deployment_name}:${var.dma_service_account_name}"]
}
}
}

# Policy Attachments
resource "aws_iam_role_policy_attachment" "bedrock_dfshell_attachment" {
count = var.k8s_access_bedrock ? 1 : 0
Expand Down Expand Up @@ -285,3 +300,8 @@ resource "aws_iam_role_policy_attachment" "clickhouse_backup_attachment" {
policy_arn = aws_iam_policy.clickhouse_backup_policy.arn
}

resource "aws_iam_role_policy_attachment" "bedrock_dma_attachment" {
count = var.k8s_access_bedrock ? 1 : 0
role = module.dma_role[0].name
policy_arn = aws_iam_policy.bedrock_access_policy[0].arn
}
6 changes: 6 additions & 0 deletions modules/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,9 @@ variable "storage_worker_service_account_name" {
default = "storage-worker"
description = "Name of the service account for storage_worker"
}

variable "dma_service_account_name" {
type = string
default = "dma"
description = "Name of the service account for dma"
}
9 changes: 9 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,12 @@ output "storage_worker_service_account_name" {
value = module.eks.storage_worker_service_account_name
description = "The name of the service account for storage_worker"
}

output "dma_role_arn" {
value = module.eks.dma_role_arn
description = "The ARN of the AWS Bedrock role"
}
output "dma_service_account_name" {
value = module.eks.dma_service_account_name
description = "The name of the service account for dma"
}