0

我正在RDS cluster同一个模板中创建一个策略,该策略具有一些权限以允许对该集群执行特定操作。

Statement:
  - Effect: Allow
    Actions:
      - 'rds-data:BatchExecuteStatement'
      - 'rds-data:ExecuteStatement'
    Resource: 'arn:aws:rds:us-east-1:1111111111:cluster:production-mycluster-rdscluster-no1yzvzs29sq'

问题是AWS::RDS::DBCluster不支持Fn::GetAtt ARN,并且由于 RDS 在 ARN 末尾添加了该随机字符串,因此在此示例中no1yzvzs29sq我不知道如何使用通配符之类的东西将名称的一部分“列入白名单”。

我想要类似的东西 arn:aws:rds:us-east-1:1111111111:cluster:production-mycluster-rdscluster-*

但它不起作用。我会很感激帮助!

4

2 回答 2

1

You can construct the ARN based on the Cluster name yourself.

For example:

Statement:
  - Effect: Allow
    Actions:
      - 'rds-data:BatchExecuteStatement'
      - 'rds-data:ExecuteStatement'
    Resource: !Sub 'arn:${AWS::Partition}:rds:${AWS::Region}:${AWS::AccountId}:cluster:${MyDBCluster}'

于 2020-06-16T21:55:03.983 回答
0
于 2020-06-16T21:48:28.560 回答