{
 "allOf": [
  {
   "if": {
    "properties": {
     "Type": {
      "const": "AWS::AutoScaling::AutoScalingGroup"
     }
    },
    "required": [
     "Type"
    ]
   },
   "then": {
    "additionalProperties": true,
    "properties": {
     "UpdatePolicy": {
      "$ref": "#/definitions/AutoScalingGroupUpdatePolicy"
     }
    }
   }
  },
  {
   "if": {
    "properties": {
     "Type": {
      "const": "AWS::Lambda::Alias"
     }
    },
    "required": [
     "Type"
    ]
   },
   "then": {
    "additionalProperties": true,
    "properties": {
     "UpdatePolicy": {
      "$ref": "#/definitions/LambdaAliasUpdatePolicy"
     }
    }
   }
  },
  {
   "if": {
    "properties": {
     "Type": {
      "enum": [
       "AWS::Elasticsearch::Domain",
       "AWS::OpenSearchService::Domain"
      ]
     }
    },
    "required": [
     "Type"
    ]
   },
   "then": {
    "additionalProperties": true,
    "properties": {
     "UpdatePolicy": {
      "$ref": "#/definitions/SearchUpdatePolicy"
     }
    }
   }
  },
  {
   "if": {
    "properties": {
     "Type": {
      "const": "AWS::ElastiCache::ReplicationGroup"
     }
    },
    "required": [
     "Type"
    ]
   },
   "then": {
    "additionalProperties": true,
    "properties": {
     "UpdatePolicy": {
      "$ref": "#/definitions/ElastiCacheReplicationGroupUpdatePolicy"
     }
    }
   }
  },
  {
   "if": {
    "properties": {
     "Type": {
      "const": "AWS::AppStream::Fleet"
     }
    },
    "required": [
     "Type"
    ]
   },
   "then": {
    "additionalProperties": true,
    "properties": {
     "UpdatePolicy": {
      "$ref": "#/definitions/AppStreamFleetUpdatePolicy"
     }
    }
   }
  },
  {
   "else": {
    "additionalProperties": true,
    "properties": {
     "UpdatePolicy": false
    }
   },
   "if": {
    "properties": {
     "Type": {
      "enum": [
       "AWS::AppStream::Fleet",
       "AWS::ElastiCache::ReplicationGroup",
       "AWS::Elasticsearch::Domain",
       "AWS::OpenSearchService::Domain",
       "AWS::Lambda::Alias",
       "AWS::AutoScaling::AutoScalingGroup"
      ]
     }
    },
    "required": [
     "Type"
    ]
   }
  }
 ],
 "definitions": {
  "AppStreamFleetUpdatePolicy": {
   "additionalProperties": false,
   "properties": {
    "StartAfterUpdate": {
     "$ref": "#/definitions/AppStreamFleetUpdateType"
    },
    "StopBeforeUpdate": {
     "$ref": "#/definitions/AppStreamFleetUpdateType"
    }
   },
   "type": "object"
  },
  "AppStreamFleetUpdateType": {
   "additionalProperties": false,
   "properties": {
    "Type": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "AutoScalingGroupUpdatePolicy": {
   "additionalProperties": false,
   "properties": {
    "AutoScalingReplacingUpdate": {
     "$ref": "#/definitions/AutoScalingReplacingUpdate"
    },
    "AutoScalingRollingUpdate": {
     "$ref": "#/definitions/AutoScalingRollingUpdate"
    },
    "AutoScalingScheduledAction": {
     "$ref": "#/definitions/AutoScalingScheduledAction"
    }
   },
   "type": "object"
  },
  "AutoScalingReplacingUpdate": {
   "additionalProperties": false,
   "properties": {
    "WillReplace": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "AutoScalingRollingUpdate": {
   "additionalProperties": false,
   "properties": {
    "MaxBatchSize": {
     "type": "integer"
    },
    "MinActiveInstancesPercent": {
     "type": "integer"
    },
    "MinInstancesInService": {
     "type": "integer"
    },
    "MinSuccessfulInstancesPercent": {
     "type": "integer"
    },
    "PauseTime": {
     "type": "string"
    },
    "SuspendProcesses": {
     "items": {
      "enum": [
       "Launch",
       "Terminate",
       "AddToLoadBalancer",
       "AlarmNotification",
       "AZRebalance",
       "HealthCheck",
       "InstanceRefresh",
       "ReplaceUnhealthy",
       "ScheduledActions"
      ],
      "type": "string"
     },
     "type": "array"
    },
    "WaitOnResourceSignals": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "AutoScalingScheduledAction": {
   "additionalProperties": false,
   "properties": {
    "IgnoreUnmodifiedGroupSizeProperties": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "CodeDeployLambdaAliasUpdate": {
   "additionalProperties": false,
   "properties": {
    "AfterAllowTrafficHook": {
     "type": "string"
    },
    "ApplicationName": {
     "type": "string"
    },
    "BeforeAllowTrafficHook": {
     "type": "string"
    },
    "DeploymentGroupName": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ElastiCacheReplicationGroupUpdatePolicy": {
   "additionalProperties": false,
   "properties": {
    "UseOnlineResharding": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "LambdaAliasUpdatePolicy": {
   "properties": {
    "CodeDeployLambdaAliasUpdate": {
     "$ref": "#/definitions/CodeDeployLambdaAliasUpdate"
    }
   },
   "type": "object"
  },
  "SearchUpdatePolicy": {
   "additionalProperties": false,
   "properties": {
    "EnableVersionUpgrade": {
     "type": "boolean"
    }
   },
   "type": "object"
  }
 }
}
