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

chore: Add access entry for workshop #644

Merged
merged 1 commit into from
Sep 10, 2024
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
31 changes: 27 additions & 4 deletions ai-ml/trainium-inferentia/addons.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,33 @@ module "eks_blueprints_addons" {
tags = local.tags
}

resource "aws_eks_access_entry" "karpenter_node_access_entry" {
cluster_name = module.eks.cluster_name
principal_arn = module.eks_blueprints_addons.karpenter.node_iam_role_arn
type = "EC2_LINUX"
# Access Entries
locals {
# Default access entry
karpenter_access_entry = {
karpenter = {
principal_arn = module.eks_blueprints_addons.karpenter.node_iam_role_arn
type = "EC2_LINUX"
}
}

# Merge var.access_entries with the karpenter_access_entry
merged_access_entries = merge(
local.karpenter_access_entry,
var.access_entries
)
}

resource "aws_eks_access_entry" "this" {
for_each = local.merged_access_entries

cluster_name = module.eks.cluster_name
kubernetes_groups = try(each.value.kubernetes_groups, null)
principal_arn = each.value.principal_arn
type = try(each.value.type, "STANDARD")
user_name = try(each.value.user_name, null)

tags = merge(try(each.value.tags, {}))
}

#---------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions ai-ml/trainium-inferentia/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,10 @@ variable "enable_rayserve_ha_elastic_cache_redis" {
type = bool
default = false
}


variable "access_entries" {
description = "Map of access entries to add to the cluster"
type = any
default = {}
}
Loading