日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

ACS-ESS-RollingUpdateByReplaceSystemDiskInScalingGroup

模板名稱

ACS-ESS-RollingUpdateByReplaceSystemDiskInScalingGroup 通過更換系統(tǒng)盤的方式滾動(dòng)更新伸縮組內(nèi)的ECS實(shí)例

立即執(zhí)行

模板描述

通過更換系統(tǒng)盤的方式滾動(dòng)更新伸縮組內(nèi)的ECS實(shí)例

模板類型

自動(dòng)化

所有者

Alibaba Cloud

輸入?yún)?shù)

參數(shù)名稱

描述

類型

是否必填

默認(rèn)值

約束

invokeType

操作類型

String

scalingGroupId

伸縮組ID

String

enterProcess

執(zhí)行開始要暫停的伸縮組流程

List

['ScaleIn', 'ScaleOut', 'HealthCheck', 'AlarmNotification', 'ScheduledAction']

exitProcess

執(zhí)行結(jié)束要恢復(fù)的伸縮組流程

List

['ScaleIn', 'ScaleOut', 'HealthCheck', 'AlarmNotification', 'ScheduledAction']

lifecycleState

生命周期狀態(tài)

List

InService

imageId

用于更新的鏡像

String

""

sourceImageId

用于回滾的鏡像

String

""

sourceExecutionId

用于回滾的OOS執(zhí)行ID

String

""

scalingConfigurationId

伸縮配置ID

String

""

batchPauseOption

分批模式

String

Automatic

batchNumber

分批執(zhí)行的批次

Number

5

maxErrors

分批執(zhí)行的最大錯(cuò)誤次數(shù)

Number

0

OOSAssumeRole

OOS扮演的RAM角色

String

""

輸出參數(shù)

參數(shù)名稱

描述

類型

commandOutputs

List

執(zhí)行此模板需要的權(quán)限策略

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ess:DescribeScalingConfigurations",
                "ess:DescribeScalingGroups",
                "ess:DescribeScalingInstances",
                "ess:EnterStandby",
                "ess:ExitStandBy",
                "ess:ModifyScalingConfiguration",
                "ess:ResumeProcesses",
                "ess:SetInstancesProtection",
                "ess:SuspendProcesses"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ecs:DescribeDisks",
                "ecs:DescribeInstances",
                "ecs:DescribeLaunchTemplateVersions",
                "ecs:DescribeLaunchTemplates",
                "ecs:ModifyInstanceAttribute",
                "ecs:ReplaceSystemDisk",
                "ecs:StartInstance",
                "ecs:StopInstance",
                "ecs:TagResources"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:ListExecutions"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳情

ACS-ESS-RollingUpdateByReplaceSystemDiskInScalingGroup詳情

模板內(nèi)容

FormatVersion: OOS-2019-06-01
Description:
  en: Rolling update ECS instances that in scaling group by replace system disk
  zh-cn: 通過更換系統(tǒng)盤的方式滾動(dòng)更新伸縮組內(nèi)的ECS實(shí)例
  name-en: ACS-ESS-RollingUpdateByReplaceSystemDiskInScalingGroup
  name-zh-cn: 通過更換系統(tǒng)盤的方式滾動(dòng)更新伸縮組內(nèi)的ECS實(shí)例
  categories:
    - elastic_manage
Parameters:
  invokeType:
    Label:
      en: InvokeType
      zh-cn: 操作類型
    Type: String
    AllowedValues:
      - invoke
      - rollback
  scalingGroupId:
    Label:
      en: ScalingGroupId
      zh-cn: 伸縮組ID
    Type: String
  enterProcess:
    Label:
      en: EnterProcess
      zh-cn: 執(zhí)行開始要暫停的伸縮組流程
    Type: List
    Default:
      - ScaleIn
      - ScaleOut
      - HealthCheck
      - AlarmNotification
      - ScheduledAction
  exitProcess:
    Label:
      en: ExitProcess
      zh-cn: 執(zhí)行結(jié)束要恢復(fù)的伸縮組流程
    Type: List
    Default:
      - ScaleIn
      - ScaleOut
      - HealthCheck
      - AlarmNotification
      - ScheduledAction
  lifecycleState:
    Label:
      en: LifecycleState
      zh-cn: 生命周期狀態(tài)
    Description:
      en: The lifecycle state of the ECS instance to be upgraded
      zh-cn: 要升級(jí)的ECS實(shí)例所處的生命周期狀態(tài)
    Type: List
    AllowedValues:
      - InService
      - Protected
    Default: InService
  imageId:
    Label:
      en: InvokeImageId
      zh-cn: 用于更新的鏡像
    Type: String
    Default: ''
  sourceImageId:
    Label:
      en: RollbackImageId
      zh-cn: 用于回滾的鏡像
    Type: String
    Default: ''
  sourceExecutionId:
    Label:
      en: SourceExecutionId
      zh-cn: 用于回滾的OOS執(zhí)行ID
    Type: String
    Default: ''
  scalingConfigurationId:
    Label:
      en: ScalingConfigurationId
      zh-cn: 伸縮配置ID
    Type: String
    Default: ''
  batchPauseOption:
    Label:
      en: BatchPauseOption
      zh-cn: 分批模式
    Type: String
    AllowedValues:
      - Automatic
      - FirstBatchPause
      - EveryBatchPause
    Default: Automatic
  batchNumber:
    Label:
      en: BatchNumber
      zh-cn: 分批執(zhí)行的批次
    Type: Number
    MinValue: 1
    MaxValue: 100
    Default: 5
  maxErrors:
    Label:
      en: MaxErrors
      zh-cn: 分批執(zhí)行的最大錯(cuò)誤次數(shù)
    Type: Number
    Default: 0
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: choiceNextTask
    Action: 'ACS::Choice'
    Description:
      en: Choose next task by invoke type
      zh-cn: 根據(jù)執(zhí)行類型選擇任務(wù)
    Properties:
      DefaultTask: getInstance
      Choices:
        - When:
            'Fn::Equals':
              - rollback
              - '{{ invokeType }}'
          NextTask: getExecutionInstanceIds
  - Name: getInstance
    Description:
      en: Views the ECS instances
      zh-cn: 獲取ECS實(shí)例
    Action: 'ACS::ExecuteApi'
    Properties:
      Service: ESS
      API: DescribeScalingInstances
      Parameters:
        ScalingGroupId: '{{ scalingGroupId }}'
        LifecycleStates: '{{ lifecycleState }}'
        CreationTypes:
          - AutoCreated
          - Attached
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'ScalingInstances.ScalingInstance | map({"InstanceId": (.InstanceId), "LifecycleState": (.LifecycleState)})[]'
  - Name: whetherTheScalingGroupInstanceIsEmpty
    Action: 'ACS::Choice'
    Description:
      en: Check whether the instances in the services in the scaling group are empty
      zh-cn: 檢查伸縮組內(nèi)服務(wù)中的實(shí)例是否為空
    Properties:
      DefaultTask: whetherTosuspendProcess
      Choices:
        - When:
            'Fn::Equals':
              - [ ]
              - '{{ getInstance.instanceIds }}'
          NextTask: 'ACS::END'
  - Name: whetherTosuspendProcess
    Action: 'ACS::Choice'
    Description:
      en: Choose next task by process
      zh-cn: 根據(jù)流程值判斷是否暫停流程
    Properties:
      DefaultTask: suspendProcess
      Choices:
        - When:
            'Fn::Equals':
              - []
              - '{{ enterProcess }}'
          NextTask: whetherToModifyScalingConfiguration
  - Name: suspendProcess
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Suspend process
      zh-cn: 暫停伸縮組流程
    Properties:
      Service: ESS
      API: SuspendProcesses
      Parameters:
        ScalingGroupId: '{{ scalingGroupId }}'
        Process: '{{ enterProcess }}'
  - Name: whetherToModifyScalingConfiguration
    Action: 'ACS::Choice'
    Description:
      en: Choose next task by ScalingConfigurationId
      zh-cn: 根據(jù)伸縮配置ID判斷是否修改伸縮配置
    Properties:
      DefaultTask: modifyScalingConfiguration
      Choices:
        - When:
            'Fn::Equals':
              - ''
              - '{{ scalingConfigurationId }}'
          NextTask: invokeByReplaceImage
  - Name: modifyScalingConfiguration
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Modify scaling configuration
      zh-cn: 修改伸縮配置
    Properties:
      Service: ESS
      API: ModifyScalingConfiguration
      Parameters:
        ScalingConfigurationId: '{{ scalingConfigurationId }}'
        ImageId: '{{ imageId }}'
  - Name: invokeByReplaceImage
    Action: 'ACS::ESS::ReplaceSystemDisk'
    Description:
      en: Replaces the system disk of ECS instances
      zh-cn: 更換系統(tǒng)盤
    Properties:
      instanceId:
        Fn::Select:
          - 'InstanceId'
          - '{{ ACS::TaskLoopItem }}'
      lifecycleState:
        Fn::Select:
          - 'LifecycleState'
          - '{{ ACS::TaskLoopItem }}'
      imageId: '{{ imageId }}'
      scalingGroupId: '{{ scalingGroupId }}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      BatchPauseOption: '{{ batchPauseOption }}'
      MaxErrors: '{{ maxErrors }}'
      Concurrency:
        'Fn::CalculateBatch':
          - '{{ batchNumber }}'
          - '{{ getInstance.instanceIds }}'
      Outputs:
        newSystemDiskIds:
          AggregateType: 'Fn::ListJoin'
          AggregateField: newSystemDiskId
    Outputs:
      newSystemDiskId:
        Type: String
        ValueSelector: newSystemDiskId
  - Name: tagInstance
    Action: ACS::ExecuteApi
    Description:
      en: Creates and attaches tag to ECS instance
      zh-cn: 創(chuàng)建并掛載標(biāo)簽到ECS實(shí)例
    Properties:
      Service: ECS
      API: TagResources
      Parameters:
        ResourceIds:
          - Fn::Select:
              - 'InstanceId'
              - '{{ ACS::TaskLoopItem }}'
        ResourceType: Instance
        Tags:
        - Key: 'ess:rollingupdate'
          Value: 'oos:{{ ACS::ExecutionId }}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  - Name: whetherToResumeProcesses
    Action: 'ACS::Choice'
    Description:
      en: Choose next task by process
      zh-cn: 根據(jù)流程值判斷是否恢復(fù)流程
    Properties:
      DefaultTask: resumeProcesses
      Choices:
        - When:
            'Fn::Equals':
              - []
              - '{{ exitProcess }}'
          NextTask: 'ACS::END'
  - Name: resumeProcesses
    Action: 'ACS::ExecuteAPI'
    OnSuccess: 'ACS::END'
    Description:
      en: Resume process
      zh-cn: 恢復(fù)伸縮組流程
    Properties:
      Service: ESS
      API: ResumeProcesses
      Parameters:
        ScalingGroupId: '{{ scalingGroupId }}'
        Process: '{{ exitProcess }}'
  - Name: getExecutionInstanceIds
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Get the instance that has been executed
      zh-cn: 獲取已經(jīng)執(zhí)行過執(zhí)行腳本的實(shí)例
    Properties:
      Service: OOS
      API: ListExecutions
      Parameters:
        ParentExecutionId: '{{ sourceExecutionId }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Executions[].Parameters.instanceId'
      lifecycleStates:
        Type: List
        ValueSelector: '.Executions | map({"InstanceId": (.Parameters.instanceId), "LifecycleState": (.Parameters.lifecycleState)})[]'
  - Name: getExistInstanceIds
    Description:
      en: Views the ECS instances
      zh-cn: 獲取ECS實(shí)例
    Action: ACS::SelectTargets
    Properties:
      ResourceType: ALIYUN::ECS::Instance
      Filters:
        - Type: ResourceIds
          ResourceIds: '{{ getExecutionInstanceIds.instanceIds }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: Instances.Instance[].InstanceId
  - Name: getRollbackProcess
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Views resource parameters
      zh-cn: 獲取源執(zhí)行的參數(shù)
    Properties:
      Service: OOS
      API: ListExecutions
      Parameters:
        ExecutionId: '{{ sourceExecutionId }}'
    Outputs:
      enterProcess:
        Type: List
        ValueSelector: 'Executions[].Parameters.enterProcess[]'
      exitProcess:
        Type: List
        ValueSelector: 'Executions[].Parameters.exitProcess[]'
  - Name: suspendProcessWithRollBack
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Suspend process
      zh-cn: 暫停伸縮組流程
    Properties:
      Service: ESS
      API: SuspendProcesses
      Parameters:
        ScalingGroupId: '{{ scalingGroupId }}'
        Process: '{{ getRollbackProcess.enterProcess }}'
  - Name: rollbackByReplaceImage
    Action: 'ACS::ESS::ReplaceSystemDisk'
    Description:
      en: Replaces the system disk of ECS instances
      zh-cn: 更換系統(tǒng)盤
    Properties:
      instanceId: '{{ ACS::TaskLoopItem }}'
      lifecycleState:
        Fn::Jq:
          - First
          - '.[] | select(.InstanceId == "{{ ACS::TaskLoopItem }}") | .LifecycleState'
          - '{{ getExecutionInstanceIds.lifecycleStates }}'
      imageId: '{{ sourceImageId }}'
      scalingGroupId: '{{ scalingGroupId }}'
      rollBack: 'true'
    Loop:
      Items: '{{ getExistInstanceIds.instanceIds }}'
      BatchPauseOption: '{{ batchPauseOption }}'
      MaxErrors: '{{ maxErrors }}'
      Concurrency:
        'Fn::CalculateBatch':
          - '{{ batchNumber }}'
          - '{{ getExistInstanceIds.instanceIds }}'
      Outputs:
        newSystemDiskIds:
          AggregateType: 'Fn::ListJoin'
          AggregateField: newSystemDiskId
    Outputs:
      newSystemDiskId:
        Type: String
        ValueSelector: newSystemDiskId
  - Name: whetherToResumeProcessesWithRollback
    Action: 'ACS::Choice'
    Description:
      en: Choose next task by process
      zh-cn: 根據(jù)流程值判斷是否恢復(fù)流程
    Properties:
      DefaultTask: resumeProcessesWithRollback
      Choices:
        - When:
            'Fn::Equals':
              - []
              - '{{ getRollbackProcess.exitProcess }}'
          NextTask: 'ACS::END'
  - Name: resumeProcessesWithRollback
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Resume process
      zh-cn: 恢復(fù)伸縮組流程
    Properties:
      Service: ESS
      API: ResumeProcesses
      Parameters:
        ScalingGroupId: '{{ scalingGroupId }}'
        Process: '{{ getRollbackProcess.exitProcess }}'
Outputs:
  commandOutputs:
    Type: List
    Value:
      'Fn::If':
        - 'Fn::Equals':
            - invoke
            - '{{ invokeType }}'
        - '{{ invokeByReplaceImage.newSystemDiskIds }}'
        - '{{ rollbackByReplaceImage.newSystemDiskIds }}'