遇到不受支持的属性AutoScalingReplacingUpdate

时间:2020-04-09 08:52:12

标签: amazon-cloudformation

尝试启动包含以下Encountered unsupported property AutoScalingReplacingUpdate的堆栈时出现

AWS::AutoScaling::AutoScalingGroup错误:

   myAutoScalingGroup:
    Type: 'AWS::AutoScaling::AutoScalingGroup'
    CreationPolicy:
      AutoScalingReplacingUpdate:
        WillReplace: true
    Properties:
      HealthCheckType: ELB
      HealthCheckGracePeriod: 300
      AvailabilityZones:
        - eu-west-1a
        - eu-west-1b
        - eu-west-1c
      VPCZoneIdentifier:
        - 'Fn::ImportValue': !Sub '${vpcId1}'
        - 'Fn::ImportValue': !Sub '${vpcId2}'
        - 'Fn::ImportValue': !Sub '${vpcId3}'
      MetricsCollection:
        - Granularity: 1Minute
          Metrics:
            - GroupMinSize
            - GroupMaxSize
            - GroupInServiceInstances
            - GroupPendingInstances
            - GroupTerminatingInstances
      MinSize: !Ref AutoScalingGroupWSMinSize
      MaxSize: !Ref AutoScalingGroupWSMaxSize
      LaunchConfigurationName: !Ref myLaunchConfig
      TargetGroupARNs:
        - !Ref myTargetGroup

我发现了一个(不需要的)解决方法,但是我真的不想依靠它。解决方法如下:

  1. 评论

    CreationPolicy:
      AutoScalingReplacingUpdate:
        WillReplace: true
    
  2. 启动模板
  3. 通过取消注释以上内容来更新成功启动的堆栈 行

这很糟糕,我不想这样做,因为我的目标是使基础架构自动化。

1 个答案:

答案 0 :(得分:1)

属性CreationPolicy没有AutoScalingReplacingUpdate属性

CreationPolicy:
  AutoScalingCreationPolicy:
    MinSuccessfulInstancesPercent: Integer
  ResourceSignal: 
    Count: Integer
    Timeout: String

属性UpdatePolicy是具有属性AutoScalingReplacingUpdate的属性:

UpdatePolicy:
  AutoScalingReplacingUpdate:
  WillReplace: Boolean