Skip to content

Commit 0e4f080

Browse files
authored
Merge pull request #70 from datafold/gerard-eng-1941-set-up-aws-bedrock-as-an-llm-provider-for-claude-on-pods
fix: Add role for DMA
2 parents b04858a + 73ef83d commit 0e4f080

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

modules/eks/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ output "storage_worker_service_account_name" {
138138
description = "The name of the service account for storage_worker"
139139
}
140140

141+
# dma
142+
output "dma_role_arn" {
143+
value = module.dma_role[0].arn
144+
description = "The ARN of the AWS Bedrock role"
145+
}
146+
output "dma_service_account_name" {
147+
value = var.dma_service_account_name
148+
description = "The name of the service account for dma"
149+
}
150+
141151
# Clickhouse backup
142152
output "clickhouse_backup_role_name" {
143153
value = module.clickhouse_backup_role.arn

modules/eks/roles.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,21 @@ module "clickhouse_backup_role" {
255255
}
256256
}
257257

258+
# storage_worker
259+
module "dma_role" {
260+
count = 1
261+
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts"
262+
name = "${var.deployment_name}-${var.dma_service_account_name}"
263+
version = "6.2.1"
264+
265+
oidc_providers = {
266+
ex = {
267+
provider_arn = module.eks.oidc_provider_arn
268+
namespace_service_accounts = ["${var.deployment_name}:${var.dma_service_account_name}"]
269+
}
270+
}
271+
}
272+
258273
# Policy Attachments
259274
resource "aws_iam_role_policy_attachment" "bedrock_dfshell_attachment" {
260275
count = var.k8s_access_bedrock ? 1 : 0
@@ -285,3 +300,8 @@ resource "aws_iam_role_policy_attachment" "clickhouse_backup_attachment" {
285300
policy_arn = aws_iam_policy.clickhouse_backup_policy.arn
286301
}
287302

303+
resource "aws_iam_role_policy_attachment" "bedrock_dma_attachment" {
304+
count = var.k8s_access_bedrock ? 1 : 0
305+
role = module.dma_role[0].name
306+
policy_arn = aws_iam_policy.bedrock_access_policy[0].arn
307+
}

modules/eks/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,9 @@ variable "storage_worker_service_account_name" {
189189
default = "storage-worker"
190190
description = "Name of the service account for storage_worker"
191191
}
192+
193+
variable "dma_service_account_name" {
194+
type = string
195+
default = "dma"
196+
description = "Name of the service account for dma"
197+
}

outputs.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,12 @@ output "storage_worker_service_account_name" {
282282
value = module.eks.storage_worker_service_account_name
283283
description = "The name of the service account for storage_worker"
284284
}
285+
286+
output "dma_role_arn" {
287+
value = module.eks.dma_role_arn
288+
description = "The ARN of the AWS Bedrock role"
289+
}
290+
output "dma_service_account_name" {
291+
value = module.eks.dma_service_account_name
292+
description = "The name of the service account for dma"
293+
}

0 commit comments

Comments
 (0)