

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

# 移除資源型政策
<a name="rbp-remove-policy"></a>

您可以從叢集移除資源型政策，以變更存取控制。

**重要**  
當您從叢集移除所有資源型政策時，存取權將完全由 IAM 身分型政策控制。

## AWS 管理主控台
<a name="rbp-remove-console"></a>

**移除以資源為基礎的政策**

1. 登入 AWS 管理主控台，並在 https：//[https://console.aws.amazon.com/dsql/](https://console.aws.amazon.com/dsql) 開啟 Aurora DSQL 主控台。

1. 從叢集清單中選擇叢集，以開啟叢集詳細資訊頁面。

1. 選擇**許可**索引標籤。

1. 在**資源型政策**區段中，選擇**刪除**。

1. 在確認對話方塊中，輸入 **confirm** 以確認刪除。

1. 選擇 **刪除**。

## AWS CLI
<a name="rbp-remove-cli"></a>

使用 `delete-cluster-policy`命令從叢集中移除政策：

```
aws dsql delete-cluster-policy --identifier your_cluster_id
```

## AWS SDKs
<a name="rbp-remove-sdk"></a>

------
#### [ Python ]

```
import boto3

client = boto3.client('dsql')

response = client.delete_cluster_policy(
    identifier='your_cluster_id'
)

print("Policy deleted successfully")
```

------
#### [ Java ]

```
import software.amazon.awssdk.services.dsql.DsqlClient;
import software.amazon.awssdk.services.dsql.model.DeleteClusterPolicyRequest;

DsqlClient client = DsqlClient.create();

DeleteClusterPolicyRequest request = DeleteClusterPolicyRequest.builder()
    .identifier("your_cluster_id")
    .build();

client.deleteClusterPolicy(request);
System.out.println("Policy deleted successfully");
```

------