{
  "typeName" : "AWS::ECS::CapacityProvider",
  "description" : "Resource Type definition for AWS::ECS::CapacityProvider.",
  "definitions" : {
    "ManagedScaling" : {
      "description" : "The managed scaling settings for the Auto Scaling group capacity provider.",
      "type" : "object",
      "properties" : {
        "MinimumScalingStepSize" : {
          "type" : "integer"
        },
        "MaximumScalingStepSize" : {
          "type" : "integer"
        },
        "Status" : {
          "type" : "string",
          "enum" : [ "DISABLED", "ENABLED" ]
        },
        "TargetCapacity" : {
          "type" : "integer"
        },
        "InstanceWarmupPeriod" : {
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    },
    "AutoScalingGroupProvider" : {
      "type" : "object",
      "properties" : {
        "AutoScalingGroupArn" : {
          "type" : "string"
        },
        "ManagedScaling" : {
          "$ref" : "#/definitions/ManagedScaling"
        },
        "ManagedTerminationProtection" : {
          "type" : "string",
          "enum" : [ "DISABLED", "ENABLED" ]
        }
      },
      "required" : [ "AutoScalingGroupArn" ],
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1
        },
        "Value" : {
          "type" : "string",
          "minLength" : 1
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "AutoScalingGroupProvider" : {
      "$ref" : "#/definitions/AutoScalingGroupProvider"
    },
    "Name" : {
      "type" : "string"
    },
    "Tags" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/Name" ],
  "createOnlyProperties" : [ "/properties/AutoScalingGroupProvider/AutoScalingGroupArn", "/properties/Name" ],
  "propertyTransform" : {
    "/properties/AutoScalingGroupProvider/AutoScalingGroupArn" : "$split(AutoScalingGroupProvider.AutoScalingGroupArn, \"autoScalingGroupName/\")[-1]"
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "autoscaling:CreateOrUpdateTags", "ecs:CreateCapacityProvider", "ecs:DescribeCapacityProviders" ]
    },
    "delete" : {
      "permissions" : [ "ecs:DescribeCapacityProviders", "ecs:DeleteCapacityProvider" ]
    },
    "read" : {
      "permissions" : [ "ecs:DescribeCapacityProviders" ]
    },
    "update" : {
      "permissions" : [ "ecs:UpdateCapacityProvider", "ecs:DescribeCapacityProviders", "ecs:ListTagsForResource", "ecs:TagResource", "ecs:UntagResource" ]
    },
    "list" : {
      "permissions" : [ "ecs:DescribeCapacityProviders" ]
    }
  },
  "required" : [ "AutoScalingGroupProvider" ]
}