---
title: "Create Cluster"
method: POST
path: "/ocean/aws/ecs/cluster"
tags: ["Ocean ECS"]
---

# Create Cluster

`POST /ocean/aws/ecs/cluster`

Create a new Ocean ECS cluster in the specified account.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref

## Request body

- object
  - `cluster` object, required
    - `id` string — Ocean cluster identifier.
    - `name` string, required — Add a name for the Ocean cluster.
    - `clusterName` string, required — ECS cluster name.
    - `autoScaler` object — The Ocean ECS Autoscaler.
      - `isEnabled` boolean — Enable the Ocean ECS Autoscaler.
      - `cooldown` integer — Cooldown period between scaling actions. Value should be cooldown period in seconds, greater than 180.
      - `resourceLimits` object — Optionally set upper and lower bounds on the resource usage of the cluster.
        - `maxMemoryGib` integer — The maximum memory in GiB units that can be allocated to the cluster. Minimum value: 1.
        - `maxVCpu` integer — The maximum CPU in vCPU units that can be allocated to the cluster. Minimum value: 1.
      - `down` object — Autoscaling scale down operations.
        - `evaluationPeriods` integer
        - `maxScaleDownPercentage` integer — The maximum portion (as a %) of nodes that will be scaled down at once out of the total number of potential nodes to scale down. Example: If there are 10 nodes to scale down and the parameter is 50%, then only 5 nodes will be scaled down at once. The other 5 nodes will be scaled down in the next autoscaling iteration.
      - `headroom` object — Spare resource capacity management enabling fast assignment of pods without waiting for new resources to launch.
        - `cpuPerUnit` integer — Optionally configure the number of CPUs to allocate per headroom unit. CPUs are denoted in CPU units, where 1024 units = 1 vCPU.
        - `memoryPerUnit` integer — Optionally configure the amount of memory (MiB) to allocate per headroom unit.
        - `numOfUnits` integer — The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.
      - `isAutoConfig` boolean — Use automatic headroom. When set to true, the values under cluster.autoScaler.headroom are not effective, as Ocean configures and optimizes headroom automatically. The auto headroom is calculated based on the service with the most changed task in the cluster, not taking the Virtual Node Group's settings into consideration.
      - `autoHeadroomPercentage` integer — Optionally set the auto-headroom percentage. Set a number between 0-200 to control the headroom % of the cluster. Relevant when isAutoConfig=true.
      - `shouldScaleDownNonServiceTasks` boolean — Option to scale down non-service tasks. If not set, Ocean does not scale down standalone tasks.
      - `enableAutomaticAndManualHeadroom` boolean — When set to true, both automatic and per custom Virtual Node Group manual headroom to be saved concurrently and independently in the cluster. prerequisite: isAutoConfig must be true
    - `region` string, required — Select the region for the Ocean cluster to run in.
    - `capacity` object — Capacity specifications for the Ocean cluster.
      - `minimum` integer — The bottom limit of instances that the cluster can scale down to.
      - `maximum` integer — The upper limit of instances that the cluster can scale up to.
      - `target` integer — Number of instances to launch and maintain in cluster.h
    - `strategy` object — Strategy Configuration of the Ocean cluster.
      - `utilizeReservedInstances` boolean — If reserved instances exist, Ocean will use them before launching spot instances.
      - `fallbackToOd` boolean — If no spot instance markets are available, enable Ocean to launch on-demand instances instead.
      - `spotPercentage` integer
      - `drainingTimeout` integer — The draining timeout (in seconds) before terminating the instance. If no draining timeout is defined, the default draining timeout will be used.
      - `utilizeCommitments` boolean — If savings plans commitment has available capacity, Ocean will utilize them alongside RIs (if exist) to maximize cost efficiency.
      - `clusterOrientation` object
        - `availabilityVsCost` 'costOriented' | 'balanced' | 'cheapest' — You can control the approach that Ocean takes while launching nodes by configuring this value.
    - `compute` object
      - `subnetIds` string[], required — A comma-separated list of subnet identifiers for the Ocean cluster. Subnet identifiers should be configured with auto-assign public IP.
      - `instanceTypes` object — The type of instances that may or may not be a part of the Ocean cluster.
        - `filters` Filters — unresolved $ref
        - `whitelist` string[] — Instance types allowed in the Ocean cluster. Cannot be configured if a deny list is configured.
        - `blacklist` string[] — Instance types to avoid launching in the Ocean cluster. Cannot be configured if a permit list is configured.
      - `launchSpecification` object, required — The default specification for container instances in the cluster. Used as a template for custom Virtual Node Groups to inherit values which are not explicitly defined in them, and as a default VNG when no other VNGs exist or match the workload’s requirements.
        - `associatePublicIpAddress` boolean — Configure public IP address allocation.
        - `associateIpv6Address` boolean — Configure IPv6 address allocation.
        - `imageId` string, required
        - `securityGroupIds` string[], required — One or more security group identifiers.
        - `iamInstanceProfile` object — The instance profile iamRole.
          - `arn` string — The iamRole ARN.
        - `blockDeviceMappings` object[] — Block devices that are exposed to the instance. You can specify virtual devices and EBS volumes.\ This parameter and rootVolumeSize cannot be in the specification at the same time.\ This parameter can be null. If not null, it must contain at least one block device.
          - `deviceName` string — Set device name.
          - `ebs` object — Set EBS properties.
            - `throughput` integer — The amount of data transferred to or from a storage device per second. You can use this parameter only if volumetype=‘gp3’.
            - `deleteOnTermination` boolean — Flag to delete the EBS on instance termination.
            - `encrypted` boolean
            - `iops` integer — Must be greater than or equal to 0.
            - `kmsKeyId` string
            - `snapshotId` string
            - `volumeType` string — Set volume type.
            - `volumeSize` integer — Set volume size (in GB). When using this property, you cannot use dynamicVolumeSize. You must use one of the other. Volume size should be greater than or equal to the size configured in the AMI.
            - `dynamicVolumeSize` object — Set dynamic volume size properties. When using this object, you cannot use volumeSize. You must use one or the other.
              - …
        - `instanceMetadataOptions` InstanceMetadataOptions — unresolved $ref
        - `userData` string, byte — The base 64 encoded MIME user data to make available to the instances.
        - `useAsTemplateOnly` boolean — The configuration specified on the Ocean object will function only as a template for virtual node groups.
        - `monitoring` boolean — Enable detailed monitoring for cluster.
        - `ebsOptimized` boolean — Enable EBS optimization for the cluster. A flag will enable optimized capacity for high bandwidth connectivity to the EB service for non EBS optimized instance types. For instances that are EBS optimized, this flag will be ignored.
        - `tags` object[] — List of kay-value pairs of tags.
          - `tagKey` string — Set the tag key.
          - `tagValue` string — Set the tag value.
      - `optimizeImages` object
        - `shouldOptimizeEcsAmi` boolean, required
        - `performAt` string — Must be one of the following values: never, always, timeWindow. If performAt = timeWindow, the time window array should contain at least one time window.
        - `timeWindows` string[] — Restrict to time window regex.
    - `scheduling` object — An object used to define times for a task such as a shutdown to be activated.
      - `tasks` object[] — The actions in the cluster to be scheduled.
        - `isEnabled` boolean, required — Describes whether the task is enabled. When true, the task will run. When false, it does not run. Required for the object cluster.scheduling.tasks.
        - `cronExpression` string, required — A valid cron expression, for example " * * * * * ". The cron runs in the UTC time zone and is in Unix cron format [Cron Expression Validator Script](https://www.unix.com/man-page/linux/5/crontab/). Only one of ‘frequency' or ‘cronExpression' should be used at a time. Required for cluster.scheduling.tasks.
        - `taskType` 'clusterRoll', required — Valid values: "clusterRoll". Required for cluster.scheduling.tasks.
        - `parameters` object
          - `clusterRoll` object
            - `batchSizePercentage` integer — Value as a percent to set the size of a batch in a roll. Valid values are 0-100.
            - `comment` string — Add a comment description for the roll. The comment is limited to 256 chars
            - `batchMinHealthyPercentage` integer — Indicates the threshold of minimum healthy instances in single batch. If the amount of healthy instances in single batch is under the threshold, the cluster roll will fail. If exists, the parameter value will be in range of 1-100. In case of null as value, the default value in the backend will be 50%. Value of param should represent the number in percentage (%) of the batch.
      - `shutdownHours` object
        - `timeWindows` string[], required
        - `isEnabled` boolean — Flag to enable / disable the shutdown hours mechanism. When turned to false, the mechanism is deactivated and the cluster remains in its current state.
    - `logging` object
      - `export` object
        - `s3` object — Exports your cluster's logs to the S3 bucket and subdir configured on the S3 [data integration](/#operation/DataIntegrationCreate) given. Each file contains logs of 3 minutes where each log is separated by a new line and saved as a JSON. The file formats are `subdir`/`accountId`_`oceanId`_`oceanName`_`startTime`.log If no subdir was configured, the files will be saved in the root of the bucket.
          - `id` string, required — The identifier of The S3 data integration to export the logs to.
    - `createdAt` string, date-time — A timestamp of the Ocean creation.
    - `updatedAt` string, date-time — A timestamp of the latest Ocean update.

## Other responses

- `200` — unresolved $ref
- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
