如何向委托人生成 "all principals" - "AWS": "*"

How to produce "all principals" to principal - "AWS": "*"

当我编写如下代码时:

const somePolicy: PolicyStatement = new PolicyStatement({
      effect: Effect.ALLOW,
      resources: ["someData/*"],
      actions: ["es:*"],
      principals: [
        new ArnPrincipal("*")
      ],
      conditions: {
        IpAddress: {
          SourceIp: ["*"]
        }
      }

    });

我在弹性域中收到以下访问策略:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "es:*",
      "Resource": "someData/*",
      "Condition": {
        "IpAddress": {
          "SourceIp": "*"
        }
      }
    }
  ]
}

我的目标是得到这个校长:

"Principal": {
        "AWS": "*"
 },

我怎样才能用 cdk 接收这个?

谢谢

"Principal": "*"same"Principal": {"AWS": "*"}。所以不管你怎么写。 CDK 使用第一个选项,因为没有理由让它比需要的更长。