

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS Identity and Access Management SageMaker HyperPod용
<a name="sagemaker-hyperpod-prerequisites-iam"></a>

AWS Identity and Access Management (IAM)는 관리자가 AWS 리소스에 대한 액세스를 안전하게 제어할 수 있도록 지원하는 AWS 서비스입니다. IAM 관리자는 어떤 사용자가 Amazon EKS 리소스를 사용할 수 있는 *인증*(로그인) 및 *권한*(권한 있음)을 받을 수 있는지를 제어합니다. IAM은 추가 비용 없이 사용할 수 있는 AWS 서비스입니다.

**중요**  
Amazon SageMaker Studio 또는 Amazon SageMaker Studio Classic에서 Amazon SageMaker 리소스를 만들도록 허용하는 사용자 지정 IAM 정책은 해당 리소스에 태그를 추가할 수 있는 권한도 부여해야 합니다. Studio와 Studio Classic은 만드는 리소스에 태그를 자동으로 지정하기 때문에 리소스에 태그를 추가할 권한이 필요합니다. IAM 정책이 Studio 및 Studio Classic에서 리소스를 만들도록 허용하지만 태그 지정은 허용하지 않는 경우 리소스 만들기를 시도할 때 'AccessDenied' 오류가 발생할 수 있습니다. 자세한 내용은 [SageMaker AI 리소스 태그 지정을 위한 권한 제공](security_iam_id-based-policy-examples.md#grant-tagging-permissions) 섹션을 참조하세요.  
[AWS Amazon SageMaker AI에 대한 관리형 정책](security-iam-awsmanpol.md)은 SageMaker 리소스를 생성할 수 있는 권한을 부여합니다. 여기에는 해당 리소스를 생성하는 동안 태그를 추가할 수 있는 권한이 이미 포함되어 있습니다.

SageMaker HyperPod 사용자에는 *클러스터 관리 사용자*와 *데이터 과학자* 사용자라는 두 가지 기본 계층이 있다고 가정해 보겠습니다.
+ **클러스터 관리자 사용자** - SageMaker HyperPod 클러스터를 생성하고 관리할 책임이 있습니다. 여기에는 HyperPod 클러스터 구성 및 이에 대한 사용자 액세스 관리가 포함됩니다.
  + Slurm 또는 Amazon EKS를 사용하여 SageMaker HyperPod 클러스터를 생성하고 구성합니다.
  + 데이터 과학자 사용자 및 HyperPod 클러스터 리소스에 대한 IAM 역할을 생성하고 구성합니다.
  + Amazon EKS를 사용한 SageMaker HyperPod 오케스트레이션의 경우 [EKS 액세스 항목](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html), [역할 기반 액세스 제어(RBAC)](sagemaker-hyperpod-eks-setup-rbac.md) 및 Pod Identity를 생성하고 구성하여 데이터 과학 사용 사례를 충족합니다.
+ **데이터 과학자 사용자** - ML 모델 훈련에 집중합니다. 오픈 소스 오케스트레이터 또는 SageMaker HyperPod CLI를 사용하여 훈련 작업을 제출하고 관리합니다.
  + 클러스터 관리자 사용자가 제공한 IAM 역할을 가정하고 사용합니다.
  + SageMaker HyperPod(Slurm 또는 Kubernetes) 또는 SageMaker HyperPod CLI에서 지원하는 오픈 소스 오케스트레이터 CLI와 상호 작용하여 클러스터 용량을 확인하고 클러스터에 연결하고 워크로드를 제출합니다.

SageMaker HyperPod 클러스터를 작동하는 데 적합한 권한 또는 정책을 연결하여 클러스터 관리자에 대한 IAM 역할을 설정합니다. 또한 클러스터 관리자는 SageMaker HyperPod 리소스에 제공할 IAM 역할을 생성하여 Amazon S3, Amazon CloudWatch 및 AWS Systems Manager (SSM)와 같은 필요한 AWS 리소스를 실행하고 통신하는 데 수임해야 합니다. 마지막으로 AWS 계정 관리자 또는 클러스터 관리자는 과학자에게 SageMaker HyperPod 클러스터에 액세스하고 ML 워크로드를 실행할 수 있는 권한을 부여해야 합니다.

선택하는 오케스트레이터에 따라 클러스터 관리자 및 과학자에게 필요한 권한이 다를 수 있습니다. 서비스당 조건 키를 사용하여 역할의 다양한 작업에 대한 권한 범위를 제어할 수도 있습니다. SageMaker HyperPod와 관련된 서비스에 대한 세부 범위를 추가하려면 다음 서비스 승인 참조를 사용합니다.
+ [ - Amazon Elastic Compute Cloud](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonec2.html)
+ [Amazon Elastic Container Registry](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonelasticcontainerregistry.html)(Amazon EKS를 사용한 SageMaker HyperPod 클러스터 오케스트레이션용)
+ [Amazon Elastic Kubernetes Service](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonelastickubernetesservice.html)(Amazon EKS를 사용한 SageMaker HyperPod 클러스터 오케스트레이션용)
+ [Amazon FSx](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonfsx.html)
+ [AWS IAM Identity Center( AWS Single Sign-On 후속)](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiamidentitycentersuccessortoawssinglesign-on.html)
+ [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentityandaccessmanagementiam.html)
+ [Amazon Simple Storage Service](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazons3.html)
+ [Amazon SageMaker AI](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonsagemaker.html)
+ [AWS Systems Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awssystemsmanager.html)

**Topics**
+ [

## 클러스터 생성에 대한 IAM 권한
](#sagemaker-hyperpod-prerequisites-iam-cluster-creation)
+ [

## 클러스터 관리자의 IAM 사용자
](#sagemaker-hyperpod-prerequisites-iam-cluster-admin)
+ [

## 과학자용 IAM 사용자
](#sagemaker-hyperpod-prerequisites-iam-cluster-user)
+ [

## SageMaker HyperPod의 IAM 역할
](#sagemaker-hyperpod-prerequisites-iam-role-for-hyperpod)

## 클러스터 생성에 대한 IAM 권한
<a name="sagemaker-hyperpod-prerequisites-iam-cluster-creation"></a>

HyperPod 클러스터를 생성하려면 다음 정책 예시에 설명된 IAM 권한이 필요합니다. 에 [https://docs.aws.amazon.com//aws-managed-policy/latest/reference/AdministratorAccess.html](https://docs.aws.amazon.com//aws-managed-policy/latest/reference/AdministratorAccess.html) 권한이 AWS 계정 있는 경우 이러한 권한은 기본적으로 부여됩니다.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:CreateCluster",
                "sagemaker:DeleteCluster",
                "sagemaker:UpdateCluster"
            ],
            "Resource": "arn:aws:sagemaker:*:*:cluster/*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:AddTags"
            ],
            "Resource": "arn:aws:sagemaker:*:*:cluster/*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:ListTags",
                "sagemaker:ListClusters",
                "sagemaker:ListClusterNodes",
                "sagemaker:ListComputeQuotas",
                "sagemaker:ListTrainingPlans",
                "sagemaker:DescribeCluster",
                "sagemaker:DescribeClusterNode"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "cloudformation:CreateStack",
                "cloudformation:UpdateStack",
                "cloudformation:DeleteStack",
                "cloudformation:ContinueUpdateRollback",
                "cloudformation:SetStackPolicy",
                "cloudformation:ValidateTemplate",
                "cloudformation:DescribeStacks",
                "cloudformation:DescribeStackEvents",
                "cloudformation:Get*",
                "cloudformation:List*"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "iam:PassRole",
            "Resource": "arn:aws:iam::*:role/sagemaker-*",
            "Condition": {
                "StringEquals": {
                    "iam:PassedToService": [
                        "sagemaker.amazonaws.com",
                        "eks.amazonaws.com",
                        "lambda.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:PassRole",
                "iam:GetRole"
            ],
            "Resource": "arn:aws:iam::*:role/*",
            "Condition": {
                "StringEquals": {
                    "iam:PassedToService": [
                        "sagemaker.amazonaws.com",
                        "eks.amazonaws.com",
                        "lambda.amazonaws.com",
                        "cloudformation.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Sid": "AmazonVPCFullAccess",
            "Effect": "Allow",
            "Action": [
                "ec2:AcceptVpcPeeringConnection",
                "ec2:AcceptVpcEndpointConnections",
                "ec2:AllocateAddress",
                "ec2:AssignIpv6Addresses",
                "ec2:AssignPrivateIpAddresses",
                "ec2:AssociateAddress",
                "ec2:AssociateDhcpOptions",
                "ec2:AssociateRouteTable",
                "ec2:AssociateSecurityGroupVpc",
                "ec2:AssociateSubnetCidrBlock",
                "ec2:AssociateVpcCidrBlock",
                "ec2:AttachClassicLinkVpc",
                "ec2:AttachInternetGateway",
                "ec2:AttachNetworkInterface",
                "ec2:AttachVpnGateway",
                "ec2:AuthorizeSecurityGroupEgress",
                "ec2:AuthorizeSecurityGroupIngress",
                "ec2:CreateCarrierGateway",
                "ec2:CreateCustomerGateway",
                "ec2:CreateDefaultSubnet",
                "ec2:CreateDefaultVpc",
                "ec2:CreateDhcpOptions",
                "ec2:CreateEgressOnlyInternetGateway",
                "ec2:CreateFlowLogs",
                "ec2:CreateInternetGateway",
                "ec2:CreateLocalGatewayRouteTableVpcAssociation",
                "ec2:CreateNatGateway",
                "ec2:CreateNetworkAcl",
                "ec2:CreateNetworkAclEntry",
                "ec2:CreateNetworkInterface",
                "ec2:CreateNetworkInterfacePermission",
                "ec2:CreateRoute",
                "ec2:CreateRouteTable",
                "ec2:CreateSecurityGroup",
                "ec2:CreateSubnet",
                "ec2:CreateTags",
                "ec2:CreateVpc",
                "ec2:CreateVpcEndpoint",
                "ec2:CreateVpcEndpointConnectionNotification",
                "ec2:CreateVpcEndpointServiceConfiguration",
                "ec2:CreateVpcPeeringConnection",
                "ec2:CreateVpnConnection",
                "ec2:CreateVpnConnectionRoute",
                "ec2:CreateVpnGateway",
                "ec2:DeleteCarrierGateway",
                "ec2:DeleteCustomerGateway",
                "ec2:DeleteDhcpOptions",
                "ec2:DeleteEgressOnlyInternetGateway",
                "ec2:DeleteFlowLogs",
                "ec2:DeleteInternetGateway",
                "ec2:DeleteLocalGatewayRouteTableVpcAssociation",
                "ec2:DeleteNatGateway",
                "ec2:DeleteNetworkAcl",
                "ec2:DeleteNetworkAclEntry",
                "ec2:DeleteNetworkInterface",
                "ec2:DeleteNetworkInterfacePermission",
                "ec2:DeleteRoute",
                "ec2:DeleteRouteTable",
                "ec2:DeleteSecurityGroup",
                "ec2:DeleteSubnet",
                "ec2:DeleteTags",
                "ec2:DeleteVpc",
                "ec2:DeleteVpcEndpoints",
                "ec2:DeleteVpcEndpointConnectionNotifications",
                "ec2:DeleteVpcEndpointServiceConfigurations",
                "ec2:DeleteVpcPeeringConnection",
                "ec2:DeleteVpnConnection",
                "ec2:DeleteVpnConnectionRoute",
                "ec2:DeleteVpnGateway",
                "ec2:DescribeAccountAttributes",
                "ec2:DescribeAddresses",
                "ec2:DescribeAvailabilityZones",
                "ec2:DescribeCarrierGateways",
                "ec2:DescribeClassicLinkInstances",
                "ec2:DescribeCustomerGateways",
                "ec2:DescribeDhcpOptions",
                "ec2:DescribeEgressOnlyInternetGateways",
                "ec2:DescribeFlowLogs",
                "ec2:DescribeInstances",
                "ec2:DescribeInternetGateways",
                "ec2:DescribeIpv6Pools",
                "ec2:DescribeLocalGatewayRouteTables",
                "ec2:DescribeLocalGatewayRouteTableVpcAssociations",
                "ec2:DescribeKeyPairs",
                "ec2:DescribeMovingAddresses",
                "ec2:DescribeNatGateways",
                "ec2:DescribeNetworkAcls",
                "ec2:DescribeNetworkInterfaceAttribute",
                "ec2:DescribeNetworkInterfacePermissions",
                "ec2:DescribeNetworkInterfaces",
                "ec2:DescribePrefixLists",
                "ec2:DescribeRouteTables",
                "ec2:DescribeSecurityGroupReferences",
                "ec2:DescribeSecurityGroupRules",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeSecurityGroupVpcAssociations",
                "ec2:DescribeStaleSecurityGroups",
                "ec2:DescribeSubnets",
                "ec2:DescribeTags",
                "ec2:DescribeVpcAttribute",
                "ec2:DescribeVpcClassicLink",
                "ec2:DescribeVpcClassicLinkDnsSupport",
                "ec2:DescribeVpcEndpointConnectionNotifications",
                "ec2:DescribeVpcEndpointConnections",
                "ec2:DescribeVpcEndpoints",
                "ec2:DescribeVpcEndpointServiceConfigurations",
                "ec2:DescribeVpcEndpointServicePermissions",
                "ec2:DescribeVpcEndpointServices",
                "ec2:DescribeVpcPeeringConnections",
                "ec2:DescribeVpcs",
                "ec2:DescribeVpnConnections",
                "ec2:DescribeVpnGateways",
                "ec2:DetachClassicLinkVpc",
                "ec2:DetachInternetGateway",
                "ec2:DetachNetworkInterface",
                "ec2:DetachVpnGateway",
                "ec2:DisableVgwRoutePropagation",
                "ec2:DisableVpcClassicLink",
                "ec2:DisableVpcClassicLinkDnsSupport",
                "ec2:DisassociateAddress",
                "ec2:DisassociateRouteTable",
                "ec2:DisassociateSecurityGroupVpc",
                "ec2:DisassociateSubnetCidrBlock",
                "ec2:DisassociateVpcCidrBlock",
                "ec2:EnableVgwRoutePropagation",
                "ec2:EnableVpcClassicLink",
                "ec2:EnableVpcClassicLinkDnsSupport",
                "ec2:GetSecurityGroupsForVpc",
                "ec2:ModifyNetworkInterfaceAttribute",
                "ec2:ModifySecurityGroupRules",
                "ec2:ModifySubnetAttribute",
                "ec2:ModifyVpcAttribute",
                "ec2:ModifyVpcEndpoint",
                "ec2:ModifyVpcEndpointConnectionNotification",
                "ec2:ModifyVpcEndpointServiceConfiguration",
                "ec2:ModifyVpcEndpointServicePermissions",
                "ec2:ModifyVpcPeeringConnectionOptions",
                "ec2:ModifyVpcTenancy",
                "ec2:MoveAddressToVpc",
                "ec2:RejectVpcEndpointConnections",
                "ec2:RejectVpcPeeringConnection",
                "ec2:ReleaseAddress",
                "ec2:ReplaceNetworkAclAssociation",
                "ec2:ReplaceNetworkAclEntry",
                "ec2:ReplaceRoute",
                "ec2:ReplaceRouteTableAssociation",
                "ec2:ResetNetworkInterfaceAttribute",
                "ec2:RestoreAddressToClassic",
                "ec2:RevokeSecurityGroupEgress",
                "ec2:RevokeSecurityGroupIngress",
                "ec2:UnassignIpv6Addresses",
                "ec2:UnassignPrivateIpAddresses",
                "ec2:UpdateSecurityGroupRuleDescriptionsEgress",
                "ec2:UpdateSecurityGroupRuleDescriptionsIngress"
            ],
            "Resource": "*"
        },
        {
            "Sid": "CloudWatchPermissions",
            "Effect": "Allow",
            "Action": [
                "cloudwatch:*",
                "logs:*",
                "sns:CreateTopic",
                "sns:ListSubscriptions",
                "sns:ListSubscriptionsByTopic",
                "sns:ListTopics",
                "sns:Subscribe",
                "iam:GetPolicy",
                "iam:GetPolicyVersion",
                "iam:GetRole",
                "oam:ListSinks",
                "rum:*",
                "synthetics:*",
                "xray:*"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:CreateBucket",
                "s3:DeleteBucket",
                "s3:PutBucketPolicy",
                "s3:PutBucketTagging",
                "s3:PutBucketPublicAccessBlock",
                "s3:PutBucketLogging",
                "s3:DeleteBucketPolicy",
                "s3:PutObject",
                "s3:DeleteObject",
                "s3:PutEncryptionConfiguration",
                "s3:AbortMultipartUpload",
                "s3:Get*",
                "s3:List*"
            ],
            "Resource": [
                "arn:aws:s3:::*",
                "arn:aws:s3:::*/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "eks:CreateCluster",
                "eks:DeleteCluster",
                "eks:CreateNodegroup",
                "eks:DeleteNodegroup",
                "eks:UpdateNodegroupConfig",
                "eks:UpdateNodegroupVersion",
                "eks:UpdateClusterConfig",
                "eks:UpdateClusterVersion",
                "eks:CreateFargateProfile",
                "eks:DeleteFargateProfile",
                "eks:CreateAddon",
                "eks:DeleteAddon",
                "eks:UpdateAddon",
                "eks:CreateAccessEntry",
                "eks:DeleteAccessEntry",
                "eks:UpdateAccessEntry",
                "eks:AssociateAccessPolicy",
                "eks:AssociateIdentityProviderConfig",
                "eks:DisassociateIdentityProviderConfig",
                "eks:TagResource",
                "eks:UntagResource",
                "eks:AccessKubernetesApi",
                "eks:Describe*",
                "eks:List*"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "ssm:GetParameter",
                "ssm:PutParameter",
                "ssm:DeleteParameter",
                "ssm:DescribeParameters"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt",
                "kms:GenerateDataKey"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "kms:ViaService": [
                        "sagemaker.*.amazonaws.com",
                        "ec2.*.amazonaws.com",
                        "s3.*.amazonaws.com",
                        "eks.*.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "lambda:CreateFunction",
                "lambda:DeleteFunction",
                "lambda:GetFunction",
                "lambda:UpdateFunctionCode",
                "lambda:UpdateFunctionConfiguration",
                "lambda:AddPermission",
                "lambda:RemovePermission",
                "lambda:PublishLayerVersion",
                "lambda:DeleteLayerVersion",
                "lambda:InvokeFunction",
                "lambda:Get*",
                "lambda:List*",
                "lambda:TagResource"
            ],
            "Resource": [
                "arn:aws:lambda:*:*:function:*",
                "arn:aws:lambda:*:*:layer:*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:DeleteRole",
                "iam:DeleteRolePolicy"
            ],
            "Resource": [
                "arn:aws:iam::*:role/*sagemaker*",
                "arn:aws:iam::*:role/*eks*",
                "arn:aws:iam::*:role/*hyperpod*",
                "arn:aws:iam::*:policy/*sagemaker*",
                "arn:aws:iam::*:policy/*hyperpod*",
                "arn:aws:iam::*:role/*LifeCycleScriptStack*",
                "arn:aws:iam::*:role/*LifeCycleScript*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:CreateRole",
                "iam:TagRole",
                "iam:PutRolePolicy",
                "iam:Get*",
                "iam:List*",
                "iam:AttachRolePolicy",
                "iam:DetachRolePolicy"
            ],
            "Resource": [
                "arn:aws:iam::*:role/*",
                "arn:aws:iam::*:policy/*"
            ]
        },
        {
            "Sid": "FullAccessToFSx",
            "Effect": "Allow",
            "Action": [
                "fsx:AssociateFileGateway",
                "fsx:AssociateFileSystemAliases",
                "fsx:CancelDataRepositoryTask",
                "fsx:CopyBackup",
                "fsx:CopySnapshotAndUpdateVolume",
                "fsx:CreateAndAttachS3AccessPoint",
                "fsx:CreateBackup",
                "fsx:CreateDataRepositoryAssociation",
                "fsx:CreateDataRepositoryTask",
                "fsx:CreateFileCache",
                "fsx:CreateFileSystem",
                "fsx:CreateFileSystemFromBackup",
                "fsx:CreateSnapshot",
                "fsx:CreateStorageVirtualMachine",
                "fsx:CreateVolume",
                "fsx:CreateVolumeFromBackup",
                "fsx:DetachAndDeleteS3AccessPoint",
                "fsx:DeleteBackup",
                "fsx:DeleteDataRepositoryAssociation",
                "fsx:DeleteFileCache",
                "fsx:DeleteFileSystem",
                "fsx:DeleteSnapshot",
                "fsx:DeleteStorageVirtualMachine",
                "fsx:DeleteVolume",
                "fsx:DescribeAssociatedFileGateways",
                "fsx:DescribeBackups",
                "fsx:DescribeDataRepositoryAssociations",
                "fsx:DescribeDataRepositoryTasks",
                "fsx:DescribeFileCaches",
                "fsx:DescribeFileSystemAliases",
                "fsx:DescribeFileSystems",
                "fsx:DescribeS3AccessPointAttachments",
                "fsx:DescribeSharedVpcConfiguration",
                "fsx:DescribeSnapshots",
                "fsx:DescribeStorageVirtualMachines",
                "fsx:DescribeVolumes",
                "fsx:DisassociateFileGateway",
                "fsx:DisassociateFileSystemAliases",
                "fsx:ListTagsForResource",
                "fsx:ManageBackupPrincipalAssociations",
                "fsx:ReleaseFileSystemNfsV3Locks",
                "fsx:RestoreVolumeFromSnapshot",
                "fsx:TagResource",
                "fsx:UntagResource",
                "fsx:UpdateDataRepositoryAssociation",
                "fsx:UpdateFileCache",
                "fsx:UpdateFileSystem",
                "fsx:UpdateSharedVpcConfiguration",
                "fsx:UpdateSnapshot",
                "fsx:UpdateStorageVirtualMachine",
                "fsx:UpdateVolume"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 클러스터 관리자의 IAM 사용자
<a name="sagemaker-hyperpod-prerequisites-iam-cluster-admin"></a>

클러스터 관리자(어드민)는 SageMaker HyperPod 클러스터를 작동 및 구성하여 [SageMaker HyperPod Slurm 클러스터 작업](sagemaker-hyperpod-operate-slurm.md)에서 작업을 수행합니다. 다음 정책 예제에는 클러스터 관리자가 SageMaker HyperPod 코어 APIs를 실행하고 AWS 계정 내에서 SageMaker HyperPod 클러스터를 관리할 수 있는 최소 권한 집합이 포함되어 있습니다.

**참고**  
클러스터 관리자 역할을 가진 IAM 사용자는 조건 키를 사용하여 SageMaker HyperPod 클러스터 리소스를 관리할 때(특히 `CreateCluster` 및 `UpdateCluster` 작업의 경우) 세분화된 액세스 제어를 제공할 수 있습니다. 이러한 작업에 지원되는 조건 키를 찾으려면 [Actions defined by SageMaker AI](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonsagemaker.html#amazonsagemaker-actions-as-permissions)에서 `CreateCluster` 또는 `UpdateCluster`를 검색합니다.

------
#### [ Slurm ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:CreateCluster",
                "sagemaker:ListClusters"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:DeleteCluster",
                "sagemaker:DescribeCluster",
                "sagemaker:DescribeClusterNode",
                "sagemaker:ListClusterNodes",
                "sagemaker:UpdateCluster",
                "sagemaker:UpdateClusterSoftware",
                "sagemaker:BatchDeleteClusterNodes"
            ],
            "Resource": "arn:aws:sagemaker:us-east-1:111122223333:cluster/*"
        }
    ]
}
```

------
#### [ Amazon EKS ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "iam:PassRole",
            "Resource": "arn:aws:iam::111122223333:role/execution-role-name"
        },
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:CreateCluster",
                "sagemaker:DeleteCluster",
                "sagemaker:DescribeCluster",
                "sagemaker:DescribeClusterNode",
                "sagemaker:ListClusterNodes",
                "sagemaker:ListClusters",
                "sagemaker:UpdateCluster",
                "sagemaker:UpdateClusterSoftware",
                "sagemaker:BatchAddClusterNodes",
                "sagemaker:BatchDeleteClusterNodes",
                "sagemaker:ListComputeQuotas",
                "sagemaker:ListClusterSchedulerConfigs",
                "sagemaker:DeleteClusterSchedulerConfig",
                "sagemaker:DeleteComputeQuota",
                "eks:DescribeCluster",
                "eks:CreateAccessEntry",
                "eks:DescribeAccessEntry",
                "eks:DeleteAccessEntry",
                "eks:AssociateAccessPolicy",
                "iam:CreateServiceLinkedRole"
            ],
            "Resource": "*"
        }
    ]
}
```

------

SageMaker AI 콘솔에 액세스할 수 있는 권한을 부여하려면 [Permissions required to use the Amazon SageMaker AI console](https://docs.aws.amazon.com/sagemaker/latest/dg/security_iam_id-based-policy-examples.html#console-permissions)에 제공된 샘플 정책을 사용합니다.

Amazon EC2 Systems Manager 콘솔에 액세스할 수 있는 권한을 부여하려면 * AWS Systems Manager 사용 설명서*의 [AWS Systems Manager 콘솔 사용에](https://docs.aws.amazon.com/systems-manager/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-console) 제공된 샘플 정책을 사용합니다.

또한 [`AmazonSageMakerFullAccess`](security-iam-awsmanpol.md#security-iam-awsmanpol-AmazonSageMakerFullAccess) 정책을 역할에 연결하는 것도 고려할 수 있습니다. 하지만 `AmazonSageMakerFullAccess` 정책은 전체 SageMaker API 호출, 기능 및 리소스에 대한 권한을 부여합니다.

IAM 사용자에 대한 일반적인 지침은 *AWS Identity and Access Management 사용 설명서*의 [IAM 사용자](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)를 참조하세요.

## 과학자용 IAM 사용자
<a name="sagemaker-hyperpod-prerequisites-iam-cluster-user"></a>

과학자는 클러스터 관리자가 프로비저닝한 SageMaker HyperPod 클러스터 노드에 로그인하여 ML 워크로드를 실행합니다. AWS 계정의 과학자의 경우 SSM `start-session` 명령을 `"ssm:StartSession"` 실행할 수 있는 권한을 부여해야 합니다. 다음은 IAM 사용자를 위한 정책 예시입니다.

------
#### [ Slurm ]

다음 정책을 추가하여 모든 리소스를 위한 SSM 대상에 연결할 수 있는 SSM 세션 권한을 부여합니다. 이렇게 하면 HyperPod 클러스터에 액세스할 수 있습니다.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	             
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ssm:StartSession",
                "ssm:TerminateSession"
            ],
            "Resource": "*"    
        }
    ]
}
```

------

------
#### [ Amazon EKS ]

데이터 과학자가 HyperPod CLI `hyperpod connect-cluster` 명령 간에 `hyperpod list-clusters` 및 명령을 실행할 수 있는 다음 IAM 역할 권한을 부여합니다. HyperPod CLI에 대한 자세한 내용은 [Amazon EKS에서 오케스트레이션한 SageMaker HyperPod 클러스터에서 작업 실행](sagemaker-hyperpod-eks-run-jobs.md) 섹션을 참조하세요. 또한 모든 리소스의 SSM 대상에 연결할 수 있는 SSM 세션 권한도 포함되어 있습니다. 이렇게 하면 HyperPod 클러스터에 액세스할 수 있습니다.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "DescribeHyerpodClusterPermissions",
            "Effect": "Allow",
            "Action": [
                "sagemaker:DescribeCluster"
            ],
            "Resource": "arn:aws:sagemaker:us-east-2:111122223333:cluster/hyperpod-cluster-name"
        },
        {
            "Sid": "UseEksClusterPermissions",
            "Effect": "Allow",
            "Action": [
                "eks:DescribeCluster"
            ],
            "Resource": "arn:aws:sagemaker:us-east-2:111122223333:cluster/eks-cluster-name"
        },
        {
            "Sid": "ListClustersPermission",
            "Effect": "Allow",
            "Action": [
                "sagemaker:ListClusters"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "ssm:StartSession",
                "ssm:TerminateSession"
            ],
            "Resource": "*"    
        }
    ]
}
```

------

데이터 과학자 IAM 사용자 또는 역할에 클러스터의 Kubernetes APIs에 대한 액세스 권한을 부여하려면 *Amazon EKS 사용 설명서*의 [Kubernetes APIs에 대한 액세스 권한 부여](https://docs.aws.amazon.com/eks/latest/userguide/grant-k8s-access.html)를 참조하세요.

------

## SageMaker HyperPod의 IAM 역할
<a name="sagemaker-hyperpod-prerequisites-iam-role-for-hyperpod"></a>

SageMaker HyperPod 클러스터를 실행하고 필요한 AWS 리소스와 통신하려면 HyperPod 클러스터가 수임할 IAM 역할을 생성해야 합니다.

관리형 역할 [AWS 관리형 정책: AmazonSageMakerHyperPodServiceRolePolicy](security-iam-awsmanpol-AmazonSageMakerHyperPodServiceRolePolicy.md) 연결부터 시작합니다. 이 AWS 관리형 정책을 고려할 때 SageMaker HyperPod 클러스터 인스턴스 그룹은 Amazon CloudWatch, Amazon S3 및 AWS Systems Manager 에이전트(SSM 에이전트)와 통신하는 역할을 수임합니다. 이 관리형 정책은 SageMaker HyperPod 리소스가 제대로 실행되기 위한 최소 요구 사항이므로 모든 인스턴스 그룹에 이 정책이 포함된 IAM 역할을 제공해야 합니다.

**작은 정보**  
여러 인스턴스 그룹에 대한 권한 수준 설계에 대한 기본 설정에 따라 여러 IAM 역할을 설정하고 다른 인스턴스 그룹에 연결할 수도 있습니다. 특정 SageMaker HyperPod 클러스터 노드에 대한 클러스터 사용자 액세스를 설정할 때 노드는 사용자가 수동으로 연결한 선택적 권한으로 역할을 수임합니다.  
[AWS Systems Manager](https://aws.amazon.com/systems-manager/)을 통해 특정 클러스터 노드에 대한 과학자의 액세스를 설정할 때([클러스터 사용자 액세스 제어를 위한 설정 AWS Systems Manager 및 Run As](sagemaker-hyperpod-prerequisites.md#sagemaker-hyperpod-prerequisites-ssm)도 참조) 클러스터 노드는 수동으로 연결하는 선택적 권한으로 역할을 수임합니다.

IAM 역할 생성을 완료한 후 이름 및 ARNs 둡니다. SageMaker HyperPod 클러스터를 생성할 때 역할을 사용하여 각 인스턴스 그룹이 필요한 AWS 리소스와 통신하는 데 필요한 올바른 권한을 부여합니다.

------
#### [ Slurm ]

Slurm으로 오케스트레이션된 HyperPod의 경우 SageMaker HyperPod IAM 역할에 다음 관리형 정책을 연결해야 합니다.
+ [AmazonSageMakerClusterInstanceRolePolicy](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonSageMakerClusterInstanceRolePolicy.html)

**(선택 사항) Amazon Virtual Private Cloud에서 SageMaker HyperPod를 사용하기 위한 추가 권한**

기본 SageMaker AI VPC 대신 자체 Amazon Virtual Private Cloud(VPC)를 사용하려면 SageMaker HyperPod의 IAM 역할에 다음과 같은 추가 권한을 추가해야 합니다.

```
{
    "Effect": "Allow",
    "Action": [
        "ec2:CreateNetworkInterface",
        "ec2:CreateNetworkInterfacePermission",
        "ec2:DeleteNetworkInterface",
        "ec2:DeleteNetworkInterfacePermission",
        "ec2:DescribeNetworkInterfaces",
        "ec2:DescribeVpcs",
        "ec2:DescribeDhcpOptions",
        "ec2:DescribeSubnets",
        "ec2:DescribeSecurityGroups",
        "ec2:DetachNetworkInterface"
    ],
    "Resource": "*"
}
{
    "Effect": "Allow",
    "Action": "ec2:CreateTags",
    "Resource": [
        "arn:aws:ec2:*:*:network-interface/*"
    ]
}
```

다음 목록은 자체 Amazon VPC로 클러스터를 구성할 때 SageMaker HyperPod 클러스터 기능을 활성화하는 데 필요한 권한을 세분화합니다.
+ VPC를 사용하여 SageMaker HyperPod 클러스터를 구성하려면 다음 `ec2` 권한이 필요합니다.

  ```
  {
      "Effect": "Allow",
      "Action": [
          "ec2:CreateNetworkInterface",
          "ec2:CreateNetworkInterfacePermission",
          "ec2:DeleteNetworkInterface",
          "ec2:DeleteNetworkInterfacePermission",
          "ec2:DescribeNetworkInterfaces",
          "ec2:DescribeVpcs",
          "ec2:DescribeDhcpOptions",
          "ec2:DescribeSubnets",
          "ec2:DescribeSecurityGroups"
      ],
      "Resource": "*"
  }
  ```
+ [SageMaker HyperPod 자동 재개 기능](sagemaker-hyperpod-resiliency-slurm-auto-resume.md)을 활성화하려면 다음 `ec2` 권한이 필요합니다.

  ```
  {
      "Effect": "Allow",
      "Action": [
          "ec2:DetachNetworkInterface"
      ],
      "Resource": "*"
  }
  ```
+ 다음 `ec2` 권한을 통해 SageMaker HyperPod는 계정 내 네트워크 인터페이스에 태그를 생성할 수 있습니다.

  ```
  {
      "Effect": "Allow",
      "Action": "ec2:CreateTags",
      "Resource": [
          "arn:aws:ec2:*:*:network-interface/*"
      ]
  }
  ```

------
#### [ Amazon EKS ]

Amazon EKS로 오케스트레이션된 HyperPod의 경우 SageMaker HyperPod IAM 역할에 다음 관리형 정책을 연결해야 합니다.
+ [AmazonSageMakerClusterInstanceRolePolicy](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonSageMakerClusterInstanceRolePolicy.html)

관리형 정책 외에도 다음 권한 정책을 역할에 연결합니다.

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:AssignPrivateIpAddresses",
        "ec2:AttachNetworkInterface",
        "ec2:CreateNetworkInterface",
        "ec2:CreateNetworkInterfacePermission",
        "ec2:DeleteNetworkInterface",
        "ec2:DeleteNetworkInterfacePermission",
        "ec2:DescribeInstances",
        "ec2:DescribeInstanceTypes",
        "ec2:DescribeNetworkInterfaces",
        "ec2:DescribeTags",
        "ec2:DescribeVpcs",
        "ec2:DescribeDhcpOptions",
        "ec2:DescribeSubnets",
        "ec2:DescribeSecurityGroups",
        "ec2:DetachNetworkInterface",
        "ec2:ModifyNetworkInterfaceAttribute",
        "ec2:UnassignPrivateIpAddresses",
        "ecr:BatchCheckLayerAvailability",
        "ecr:BatchGetImage",
        "ecr:GetAuthorizationToken",
        "ecr:GetDownloadUrlForLayer",
        "eks-auth:AssumeRoleForPodIdentity"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "ec2:CreateTags"
      ],
      "Resource": [
        "arn:aws:ec2:*:*:network-interface/*"
      ]
    }
  ]
}
```

------

**참고**  
단, `"eks-auth:AssumeRoleForPodIdentity"` 권한은 선택 사항입니다. EKS Pod Identity를 사용하려면 필수입니다.

**SageMaker HyperPod 서비스 연결 역할**

SageMaker HyperPod 에서 Amazon EKS를 지원하기 위해 HyperPod는 [AWS 관리형 정책: AmazonSageMakerHyperPodServiceRolePolicy](security-iam-awsmanpol-AmazonSageMakerHyperPodServiceRolePolicy.md)를 사용하여 서비스 연결 역할을 생성하여 노드 교체 및 작업 재시작과 같은 EKS 클러스터의 복원력을 모니터링하고 지원합니다.

**제한된 인스턴스 그룹(RIG)이 있는 Amazon EKS 클러스터에 대한 추가 IAM 정책**

제한된 인스턴스 그룹에서 실행되는 워크로드는 실행 역할에 의존하여 Amazon S3에서 데이터를 로드합니다. 제한된 인스턴스 그룹에서 실행되는 사용자 지정 작업이 입력 데이터를 올바르게 가져올 수 있도록 실행 역할에 추가 Amazon S3 권한을 추가해야 합니다.

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::amzn-s3-demo-bucket"      
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject"
      ],
      "Resource": [
        "arn:aws:s3:::amzn-s3-demo-bucket/*"
      ]
    }
  ]
}
```

------

------