AWS策略错误-资源数量大于允许的最大值

时间:2020-05-25 04:19:22

标签: amazon-web-services amazon-s3 amazon-cloudformation aws-policies

下面是我添加策略的代码,但不确定调用CloudateTemplate操作时发生的错误(ValidationError),这是因为运行云形成时givng错误是什么:模板格式错误:资源数量201大于最大值允许,200 \ n“,” stdout“:”“,” stdout_lines“:[]}

AWSTemplateFormatVersion: 2010-09-09
Description: ''
Resources:
  PSEJenkinsS3Policy:
    Type: 'AWS::IAM::ManagedPolicy'
    Properties:
      ManagedPolicyName: pse-jenkins-s3-policy
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
            - s3:GetObject
            - s3:ListBucket
            - s3:ListAllMyBuckets
            - s3:PutObject
            - s3:PutObjectTagging
            Resource:
            - arn:aws:s3:::pase-*/*

Outputs:
  PSEJenkinsS3PolicyOutput:
    Value: !Ref PSEJenkinsS3Policy
    Export:
      Name: PSEJenkinsS3Policy

2 个答案:

答案 0 :(得分:0)

一切正常...但是CloudFormation限制每200个资源堆栈的资源数量。在这里https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html

描述:您可以在AWS CloudFormation模板中声明的最大资源数量。

值:200种资源

解决方案:将堆栈分成两部分...

答案 1 :(得分:0)

这正是错误的含义,每个cloudformation堆栈AWS Docs仅允许200个资源。如果您在使用上述模板时遇到此错误,我只能假设您使用的编译器在部署cloudformation堆栈时会将模块化的较小Yaml资源组合到单个文件中?