【问题标题】:cloudformation template errorcloudformation模板错误
【发布时间】:2018-08-28 13:14:47
【问题描述】:

我收到一个错误提示

2018 年 3 月 19 日下午 4:40:25 - 模板包含错误。:模板错误:参数“LifecycleConfiguration”MaxLength 必须位于字符串类型的参数上

这是我的代码。

AWSTemplateFormatVersion: 2010-09-09
Description: S3 Bucket Template for cloudformation
Metadata:
  Copyright:
    - 'Copyrights 2018, All rights reserved'
  Comments:
    - !Ref Description
Parameters:
  S3BucketName:
    Description: Name of the S3 Bucket
    Type: String
    ConstraintDescription: S3 BucketName must be between 3 and 63 characters in length.
    MinLength: 3
    MaxLength: 63
  LifecycleConfiguration:
    Description: >-
      Specify a number of days to keep files in the bucket, a value of 0 keeps
      the files in the s3
    Type: Number
    MinValue: '0'
    MaxLength: '365'
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: !Ref S3BucketName
      LifecycleConfiguration:
        Rules:
          - Id: GlacierRule
            Prefix: glacier
            Status: Enabled
            ExpirationInDays: '365'
            Transitions:
              - TransitionInDays: '1'
                StorageClass: Glacier

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation


    【解决方案1】:
     LifecycleConfiguration:
        Description: >-
          Specify a number of days to keep files in the bucket, a value of 0 keeps
          the files in the s3
        Type: Number
        MinValue: '0'
        MaxLength: '365'
    

    使用MaxValue: 365 而不是MaxLength: 365

    【讨论】:

      猜你喜欢
      • 2017-08-13
      • 2016-12-03
      • 2018-06-03
      • 2016-07-11
      • 2018-06-03
      • 1970-01-01
      • 2021-05-24
      • 1970-01-01
      • 2017-04-05
      相关资源
      最近更新 更多