Skip to content

Commit 5e24209

Browse files
committed
Add EKS CNI Policy to SageMaker HyperPod Terraform Role
1 parent 7186278 commit 5e24209

File tree

1 file changed

+7
-0
lines changed
  • 1.architectures/7.sagemaker-hyperpod-eks/terraform-modules/hyperpod-eks-tf/modules/sagemaker_iam_role

1 file changed

+7
-0
lines changed

1.architectures/7.sagemaker-hyperpod-eks/terraform-modules/hyperpod-eks-tf/modules/sagemaker_iam_role/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ resource "aws_iam_role_policy_attachment" "sagemaker_managed_policy_attachment"
2525
policy_arn = "arn:aws:iam::aws:policy/AmazonSageMakerClusterInstanceRolePolicy"
2626
}
2727

28+
# Attach EKS CNI policy to the role
29+
resource "aws_iam_role_policy_attachment" "eks_cni_policy_attachment" {
30+
role = aws_iam_role.sagemaker_execution_role.name
31+
policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
32+
}
33+
34+
2835
# Custom IAM Policy
2936
resource "aws_iam_policy" "sagemaker_execution_policy" {
3037
name = "${var.resource_name_prefix}-ExecutionRolePolicy-${data.aws_region.current.name}"

0 commit comments

Comments
 (0)