查看基于资源的策略 - Amazon Aurora DSQL

查看基于资源的策略

您可以查看附加到集群的基于资源的策略,以了解当前已实施的访问控制。

查看基于资源的策略
  1. 登录 AWS 管理控制台并打开 Aurora DSQL 控制台,网址为 https://console.aws.amazon.com/dsql/

  2. 从集群列表中选择集群以打开集群详细信息页面。

  3. 选择 Permissions(权限)选项卡。

  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());