AWS SAM可选/条件资源策略

时间:2020-03-02 20:32:11

标签: amazon-web-services serverless-application-model

我想确保使用此语法的所有语法不会丢失任何东西,或者此属性是否仅不支持条件。

这是我模板的相关部分。

Resources:
    MyApi:
        Type: AWS::Serverless::Api
        Properties:
          ...
          Auth:
            ResourcePolicy:
              IpRangeWhitelist: !If [IsProd, ["some.ip.add.ress", "some.other.ip.address"], AWS::NoValue]
Conditions:
  IsProd: !Equals [prod, !Ref Env]

我已经独立测试了两个值,它们都可以正常工作,但是在条件内,我会收到此错误;

Invalid policy document. Please check the policy syntax and ensure that Principals are valid (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException;    

0 个答案:

没有答案