選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

在 中管理 Amazon Redshift 命名空間的先決條件 AWS Glue Data Catalog

焦點模式
在 中管理 Amazon Redshift 命名空間的先決條件 AWS Glue Data Catalog - AWS Lake Formation

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

  1. 建立資料湖管理員 - 建立已獲授權接受命名空間邀請的 IAM 角色,並建立 AWS Glue Data Catalog 物件 (目錄、資料庫、資料表/檢視),並將 Lake Formation 許可授予其他使用者。

    如需建立資料湖管理員的step-by-step說明,請參閱建立資料湖管理員

  2. 更新資料湖管理員許可。

    除了資料湖管理員許可之外,資料湖管理員還需要下列許可,才能在 Lake Formation 中接受 Amazon Redshift 命名空間邀請、建立或更新 Data Catalog 資源,以及啟用資料湖存取:

    { "Version": "2012-10-17", "Id": "glue-enable-datalake-access", "Statement": [ { "Effect": "Allow", "Action": [ "redshift:AssociateDataShareConsumer", "redshift:DescribeDataSharesForConsumer", "redshift:DescribeDataShares", "redshift-serverless:CreateNamespace", "redshift-serverless:CreateWorkgroup", "redshift-serverless:DeleteNamespace", "redshift-serverless:DeleteWorkgroup", "ec2:DescribeAccountAttributes", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups", "ec2:DescribeAvailabilityZones", "s3:createBucket", "s3:deleteBucket", "s3:putBucketPolicy", "s3:putEncryptionConfiguration", "s3:putLifecycleConfiguration", "s3:putBucketVersioning", "iam:CreateRole" ], "Resource": "*" } ] } { "Action": [ "iam:PassRole" ], "Effect": "Allow", "Resource": "arn:aws:iam::*:role/data transfer role name", "Condition": { "StringLike": { "iam:PassedToService": [ "glue.amazonaws.com" ] } } }
  3. 如果用於建立聯合目錄的 IAM 角色不是資料湖管理員,您需要授予該角色Create catalog許可。

    建立目錄建立者
    1. 開啟 Lake Formation 主控台,網址為 https://console.aws.amazon.com/lakeformation/

    2. 在管理下選擇管理角色和任務

    3. 選擇 Grant (授予)。

    4. 授予許可畫面上,選擇 IAM 使用者或角色。

    5. 選取建立目錄許可。

    6. 您也可以選擇授予可授予的建立目錄許可。可授予的許可允許目錄建立者將Create catalog許可授予其他主體。

    7. 選擇 Grant (授予)。

    AWS CLI 授予建立聯合目錄許可的範例。

    aws lakeformation grant-permissions \ --cli-input-json \ '{ "Principal": { "DataLakePrincipalIdentifier":"arn:aws:iam::123456789012:role/Admin" }, "Resource": { "Catalog": { } }, "Permissions": [ "CREATE_CATALOG", "DESCRIBE" ] }'
  4. 建立唯讀管理員角色,以在 Amazon Redshift 查詢編輯器 v2 的資料目錄中探索 Amazon Redshift 聯合目錄。

    若要從 Amazon Redshift 查詢編輯器 v2 查詢聯合目錄中的 Amazon Redshift 資料表,請確定唯讀管理員角色政策包含 Amazon Redshift 服務連結角色的 ARNAWSServiceRoleForRedshift

    aws lakeformation put-data-lake-settings --region us-east-1 \ --data-lake-settings \ '{ "DataLakeAdmins": [{"DataLakePrincipalIdentifier":"arn:aws:iam::123456789012:role/Admin"}], "ReadOnlyAdmins":[{"DataLakePrincipalIdentifier":"arn:aws:iam::123456789012:role/aws-service-role/redshift.amazonaws.com/AWSServiceRoleForRedshift"}], "CreateDatabaseDefaultPermissions":[], "CreateTableDefaultPermissions":[], "Parameters":{"CROSS_ACCOUNT_VERSION":"4","SET_CONTEXT":"TRUE"} }'
  5. 建立 Amazon Redshift 可代表您擔任的資料傳輸角色,以往返 Amazon S3 儲存貯體傳輸資料。

    當您啟用 Apache Iceberg 相容查詢引擎的資料湖存取,例如 Athena、Amazon EC2 上的 Amazon EMR,以存取 Data Catalog 中的 Amazon Redshift 資源時,您需要建立具有必要許可的 IAM 角色,以執行往返 Amazon S3 儲存貯體的資料傳輸。

    { "Version": "2012-10-17", "Id": "glue-enable-datalake-access", "Statement": [{ "Sid": "DataTransferRole policy", "Effect": "Allow", "Action": [ "glue:GetCatalog", "glue:GetDatabase", "kms:GenerateDataKey", "kms:Decrypt"], "Resource": "*" } ] }
  6. 將下列信任政策新增至 AWS Glue 和 Amazon Redshift 服務的資料傳輸角色,以擔任角色來往返 Amazon S3 儲存貯體傳輸資料。

    { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "Service": [ "redshift.amazonaws.com", "glue.amazonaws.com" ] }, "Action": "sts:AssumeRole" }] }
  7. 如果您使用客戶受管金鑰來加密 Amazon Redshift 叢集/命名空間中的資料,請將下列金鑰政策新增至 AWS KMS 金鑰。將帳戶號碼取代為有效的 AWS 帳戶號碼,並指定資料傳輸角色名稱。根據預設,Amazon Redshift 叢集中的資料會使用 KMS 金鑰加密。Lake Formation 提供建立自訂 KMS 金鑰以進行加密的選項。如果您使用的是客戶受管金鑰,則必須將特定金鑰政策新增至金鑰。

    如需管理客戶受管金鑰許可的詳細資訊,請參閱客戶受管金鑰

    { "Version": "2012-10-17", "Id": "auto-redshift-3", "Statement": [ { "Sid": "Allow access through RedShift for all principals in the account that are authorized to use RedShift", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:CreateGrant", "kms:DescribeKey" ], "Resource": "*", "Condition": { "StringEquals": { "kms:CallerAccount": "123456789012", "kms:ViaService": "redshift.us-east-1.amazonaws.com" } } }, { "Sid": "Allow access through RedShift-Serverless for all principals in the account that are authorized to use RedShift-Serverless", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:CreateGrant", "kms:DescribeKey" ], "Resource": "*", "Condition": { "StringEquals": { "kms:CallerAccount": "123456789012", "kms:ViaService": "redshift-serverless.us-east-1.amazonaws.com" } } }, { "Sid": "Allow direct access to key metadata to the account", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:root" }, "Action": [ "kms:Describe*", "kms:Get*", "kms:List*", "kms:RevokeGrant" ], "Resource": "*" }, { "Sid": "Allow GenerateDataKey + Decrypt to the DataTransferRole via s3", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012 :role/data-transfer-role-name" }, "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": "*" }, "Condition": { "StringEquals": { "kms:ViaService": "s3.us-east-1.amazonaws.com" } } ] }
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。