

 Amazon Redshift 將不再支援從修補程式 198 開始建立新的 Python UDFs。現有 Python UDF 將繼續正常運作至 2026 年 6 月 30 日。如需詳細資訊，請參閱[部落格文章](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

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

# 使用 IAM 政策管理資料共用 API 操作的存取
<a name="iam-policy"></a>

若要控制資料共用 API 操作的存取權，請使用 IAM 動作型政策。如需有關管理 IAM 政策的詳細資訊，請參閱《IAM 使用者指南》**中的[理 IAM 政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage.html)。

如需使用資料共用 API 操作所需許可的相關資訊，請參閱《Amazon Redshift 管理指南》**中的[使用資料共用 API 操作所需的權限](https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html)。

若要讓跨帳戶資料共用更安全，您可以使用條件式金鑰 `ConsumerIdentifier` 進行 `AuthorizeDataShare` 和 `DeauthorizeDataShare` API 操作。透過這樣做，您可以明確控制哪些 AWS 帳戶 可以呼叫兩個 API 操作。

對於不是您自己帳戶的取用者，您可以拒絕授權或取消授權資料共用。若要這樣做，請在 IAM 政策中指定 AWS 帳戶 號碼。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Deny",
            "Action": [
                "redshift:AuthorizeDataShare",
                "redshift:DeauthorizeDataShare"
            ],
            "Resource": "*",
            "Condition": {
                "StringNotEquals": {
                    "redshift:ConsumerIdentifier": "555555555555"
                }
            }
        }
    ]
}
```

------

您可以在 IAM 政策中允許具有 DataShareArn 的生產者與 111122223333 AWS 帳戶 的消費者**testshare2**明確共用。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "redshift:AuthorizeDataShare",
                "redshift:DeauthorizeDataShare"
            ],
            "Resource": "arn:aws:redshift:us-east-1:666666666666:datashare:af06285e-8a45-4ee9-b598-648c218c8ff1/testshare2",
            "Condition": {
                "StringEquals": {
                    "redshift:ConsumerIdentifier": "111122223333"
                }
            }
        }
    ]
}
```

------