{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ecs/json-schema/amazon-ecs-create-task-set-request-schema.json",
  "title": "CreateTaskSetRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ecs-task-set-api-openapi.yml#/components/schemas/CreateTaskSetRequest",
  "type": "object",
  "properties": {
    "service": {
      "type": "string",
      "description": "The short name or full Amazon Resource Name (ARN) of the service to create the task set in."
    },
    "cluster": {
      "type": "string",
      "description": "The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in."
    },
    "externalId": {
      "type": "string",
      "description": "An optional non-unique tag that identifies this task set in external systems. If the task set is associated with a service discovery registry, the tasks in this task set will have the ECS_TASK_SET_EXTERNAL_ID Cloud Map attribute set to the provided value."
    },
    "taskDefinition": {
      "type": "string",
      "description": "The task definition for the tasks in the task set to use. If a revision isn't specified, the latest ACTIVE revision is used."
    },
    "networkConfiguration": {
      "$ref": "#/$defs/NetworkConfiguration"
    },
    "loadBalancers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LoadBalancer"
      },
      "description": "A load balancer object representing the load balancer to use with the task set. The supported load balancer types are either an Application Load Balancer or a Network Load Balancer."
    },
    "serviceRegistries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceRegistry"
      },
      "description": "The details of the service discovery registries to assign to this task set. For more information, see Service discovery."
    },
    "launchType": {
      "type": "string",
      "enum": [
        "EC2",
        "FARGATE",
        "EXTERNAL",
        "MANAGED_INSTANCES"
      ],
      "description": "The launch type that new tasks in the task set uses. For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide. If a launchType is specified, the capacityProviderStrategy parameter must be omitted."
    },
    "capacityProviderStrategy": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CapacityProviderStrategyItem"
      },
      "description": "The capacity provider strategy to use for the task set. A capacity provider strategy consists of one or more capacity providers along with the base and weight to assign to them. A capacity provider must be associated with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders API is used to associate a capacity provider with a cluster. Only capacity providers with an ACTIVE or UPDATING status can be used. If a capacityProviderStrategy is specified, the launchType parameter must be omitted. If no capacityProviderStrategy or launchType is specified, the defaultCa"
    },
    "platformVersion": {
      "type": "string",
      "description": "The platform version that the tasks in the task set uses. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used."
    },
    "scale": {
      "$ref": "#/$defs/Scale"
    },
    "clientToken": {
      "type": "string",
      "description": "An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed."
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "The metadata that you apply to the task set to help you categorize and organize them. Each tag consists of a key and an optional value. You define both. When a service is deleted, the tags are deleted. The following basic restrictions apply to tags: Maximum number of tags per resource - 50 For each resource, each tag key must be unique, and each tag key can have only one value. Maximum key length - 128 Unicode characters in UTF-8 Maximum value length - 256 Unicode characters in UTF-8 If your tagging schema is used across multiple services and resources, remember that other services may have re"
    }
  },
  "required": [
    "service",
    "cluster",
    "taskDefinition"
  ],
  "$defs": {
    "AdvancedConfiguration": {
      "type": "object",
      "properties": {
        "alternateTargetGroupArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the alternate target group for Amazon ECS blue/green deployments."
        },
        "productionListenerRule": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) that that identifies the production listener rule (in the case of an Application Load Balancer) or listener (in the case for an Network Load Balancer) for routing production traffic."
        },
        "testListenerRule": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) that identifies ) that identifies the test listener rule (in the case of an Application Load Balancer) or listener (in the case for an Network Load Balancer) for routing test traffic."
        },
        "roleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role that grants Amazon ECS permission to call the Elastic Load Balancing APIs for you."
        }
      }
    },
    "AwsVpcConfiguration": {
      "type": "object",
      "properties": {
        "subnets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the subnets associated with the task or service. There's a limit of 16 subnets that can be specified. All specified subnets must be from the same VPC."
        },
        "securityGroups": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the security groups associated with the task or service. If you don't specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups that can be specified. All specified security groups must be from the same VPC."
        },
        "assignPublicIp": {
          "type": "string",
          "enum": [
            "ENABLED",
            "DISABLED"
          ],
          "description": "Whether the task's elastic network interface receives a public IP address. Consider the following when you set this value: When you use create-service or update-service, the default is DISABLED. When the service deploymentController is ECS, the value must be DISABLED."
        }
      },
      "required": [
        "subnets"
      ]
    },
    "CapacityProviderStrategyItem": {
      "type": "object",
      "properties": {
        "capacityProvider": {
          "type": "string",
          "description": "The short name of the capacity provider."
        },
        "weight": {
          "type": "integer",
          "description": "The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied. If no weight value is specified, the default value of 0 is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of 0 can't be used to place tasks. If you specify multiple capacity providers in a strategy that"
        },
        "base": {
          "type": "integer",
          "description": "The base value designates how many tasks, at a minimum, to run on the specified capacity provider for each service. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used. Base value characteristics: Only one capacity provider in a strategy can have a base defined The default value is 0 if not specified The valid range is 0 to 100,000 Base requirements are satisfied first before weight distribution"
        }
      },
      "required": [
        "capacityProvider"
      ]
    },
    "LoadBalancer": {
      "type": "object",
      "properties": {
        "targetGroupArn": {
          "type": "string",
          "description": "The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set. A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer. For services using the ECS deployment controller, you can specify one or multiple target groups. For more information, see Registering multiple target groups with a service in the Amazon Elastic Container Service Developer Guide. For services using the CODE_DEPLOY deployment controller, you're required to define two target groups for the load balancer. For more infor"
        },
        "loadBalancerName": {
          "type": "string",
          "description": "The name of the load balancer to associate with the Amazon ECS service or task set. If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter should be omitted."
        },
        "containerName": {
          "type": "string",
          "description": "The name of the container (as it appears in a container definition) to associate with the load balancer. You need to specify the container name when configuring the target group for an Amazon ECS load balancer."
        },
        "containerPort": {
          "type": "integer",
          "description": "The port on the container to associate with the load balancer. This port must correspond to a containerPort in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the hostPort of the port mapping."
        },
        "advancedConfiguration": {
          "$ref": "#/$defs/AdvancedConfiguration"
        }
      }
    },
    "NetworkConfiguration": {
      "type": "object",
      "properties": {
        "awsvpcConfiguration": {
          "$ref": "#/$defs/AwsVpcConfiguration"
        }
      }
    },
    "Scale": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "description": "The value, specified as a percent total of a service's desiredCount, to scale the task set. Accepted values are numbers between 0 and 100."
        },
        "unit": {
          "type": "string",
          "enum": [
            "PERCENT"
          ],
          "description": "The unit of measure for the scale value."
        }
      }
    },
    "ServiceRegistry": {
      "type": "object",
      "properties": {
        "registryArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is Cloud Map. For more information, see CreateService."
        },
        "port": {
          "type": "integer",
          "description": "The port value used if your service discovery service specified an SRV record. This field might be used if both the awsvpc network mode and SRV records are used."
        },
        "containerName": {
          "type": "string",
          "description": "The container name value to be used for your service discovery service. It's already specified in the task definition. If the task definition that your service task specifies uses the bridge or host network mode, you must specify a containerName and containerPort combination from the task definition. If the task definition that your service task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must specify either a containerName and containerPort combination or a port value. However, you can't specify both."
        },
        "containerPort": {
          "type": "integer",
          "description": "The port value to be used for your service discovery service. It's already specified in the task definition. If the task definition your service task specifies uses the bridge or host network mode, you must specify a containerName and containerPort combination from the task definition. If the task definition your service task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must specify either a containerName and containerPort combination or a port value. However, you can't specify both."
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values."
        },
        "value": {
          "type": "string",
          "description": "The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key)."
        }
      }
    }
  }
}