檢視資源型政策 - Amazon Aurora DSQL

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

檢視資源型政策

您可以檢視連接至叢集的資源型政策,以了解目前的存取控制。

檢視資源型政策
  1. 登入 AWS 管理主控台,並在 https://https://console.aws.amazon.com/dsql/ 開啟 Aurora DSQL 主控台。

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

  3. 選擇許可索引標籤。

  4. 在以資源為基礎的政策區段中檢視附加的政策

使用 get-cluster-policy命令來檢視叢集的資源型政策:

aws dsql get-cluster-policy --identifier your_cluster_id
Python
import boto3 import json client = boto3.client('dsql') response = client.get_cluster_policy( identifier='your_cluster_id' ) # Parse and pretty-print the policy policy = json.loads(response['policy']) print(json.dumps(policy, indent=2))
Java
import software.amazon.awssdk.services.dsql.DsqlClient; import software.amazon.awssdk.services.dsql.model.GetClusterPolicyRequest; import software.amazon.awssdk.services.dsql.model.GetClusterPolicyResponse; DsqlClient client = DsqlClient.create(); GetClusterPolicyRequest request = GetClusterPolicyRequest.builder() .identifier("your_cluster_id") .build(); GetClusterPolicyResponse response = client.getClusterPolicy(request); System.out.println("Policy: " + response.policy());