本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
使用密Amazon KMS钥配置共享存储加密
了解如何设置客户管理的Amazon KMS密钥来加密和保护配置的群集文件存储系统中的数据Amazon ParallelCluster。
Amazon ParallelCluster支持以下共享存储配置选项:
您可以使用这些选项为 Amazon EBS、Amazon EFS 和 FSx 提供客户管理的Amazon KMS密钥,用于 Lustre 共享存储系统加密。要使用它们,您必须为以下内容创建和配置 IAM 策略:
先决条件
-
Amazon ParallelCluster已安装。
-
Amazon CLI已安装并配置。
-
您有一个 EC2 key pair。
创建 策略
创建策略。
-
前往 IAM 控制台:https://console.aws.amazon.com/iam/home
。 -
选择策略。
-
选择 Create policy(创建策略)。
-
选择 JSON 选项卡并粘贴以下策略。请务必
使用您的Amazon Web Services 账户 ID 和密钥 Amazon 资源名称 (ARN) 以及Amazon Web Services 区域您自己的资源名称 (ARN) 替换所有出现的内容。123456789012
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kms:DescribeKey", "kms:ReEncrypt*", "kms:CreateGrant", "kms:Decrypt" ], "Resource": [ "arn:aws:kms:
region-id
:123456789012
:key/abcd1234-ef56-gh78-ij90-abcd1234efgh5678
" ] } ] } -
在本教程中,命名策略
ParallelClusterKmsPolicy
,然后选择 “创建策略”。 -
请记下策略 ARN。您需要它来配置您的集群。
配置和创建集群
以下是集群配置示例,其中包括具有加密功能的 Amazon Elastic Block Store 共享文件系统。
Region:
eu-west-1
Image: Os: alinux2 HeadNode: InstanceType: t2.micro Networking: SubnetId: subnet-abcdef01234567890
Ssh: KeyName:my-ssh-key
Iam: AdditionalIamPolicies: - Policy: arn:aws:iam::123456789012
:policy/ParallelClusterKmsPolicy Scheduling: Scheduler: slurm SlurmQueues: - Name:q1
ComputeResources: - Name: t2micro InstanceType: t2.micro MinCount: 0 MaxCount: 10 Networking: SubnetIds: - subnet-abcdef01234567890
Iam: AdditionalIamPolicies: - Policy: arn:aws:iam::123456789012
:policy/ParallelClusterKmsPolicy SharedStorage: - MountDir: /shared/ebs1
Name:shared-ebs1
StorageType: Ebs EbsSettings: Encrypted: True KmsKeyId:abcd1234-ef56-gh78-ij90-abcd1234efgh5678
将红色文本文本中的项目替换为您自己的值。然后,创建一个使用您的Amazon KMS密钥在 Amazon EBS 中加密数据的集群。
Amazon EFS 和 Lustre 文件系统的 FSx 配置类似。
亚马逊 EFSSharedStorage
配置如下所示。
... SharedStorage: - MountDir: /shared/
efs1
Name:shared-efs1
StorageType: Efs EfsSettings: Encrypted: True KmsKeyId:abcd1234-ef56-gh78-ij90-abcd1234efgh5678
适用于 Lustre 的 FSxSharedStorage
配置如下所示。
... SharedStorage: - MountDir: /shared/
fsx1
Name:shared-fsx1
StorageType: FsxLustre FsxLustreSettings: StorageCapacity:1200
DeploymentType:PERSISTENT_1
PerUnitStorageThroughput:200
KmsKeyId:abcd1234-ef56-gh78-ij90-abcd1234efgh5678