---
title: "Create Stateful Node"
method: POST
path: "/aws/ec2/managedInstance"
tags: ["Stateful Node AWS"]
---

# Create Stateful Node

`POST /aws/ec2/managedInstance`

Create a new Stateful Node resource.

## Parameters

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

## Request body

- object
  - `managedInstance` object
    - `name` string, required — Stateful Node name
    - `description` string — Describe your Stateful Node resource
    - `region` string, required — The AWS region your resource will be created in.
    - `strategy` object
      - `lifeCycle` string — Set lifecycle, valid values: `spot`, `on_demand` Default: spot
      - `orientation` string — The strategy orientation. valid values: `costOriented`, `availabilityOriented`, `balanced`, `cheapest` Default: availabilityOriented
      - `drainingTimeout` integer — The time in seconds to allow the instance be drained from incoming TCP connections and detached from ELB before terminating it, during a scale down operation
      - `fallbackToOd` boolean — In case of no spots available, Stateful Node will launch an On-demand instance instead Default: true
      - `utilizeReservedInstances` boolean — In case of any available Reserved Instances, Stateful Node will utilize them before purchasing Spot instances Default: false
      - `utilizeCommitments` boolean — If there are available Reserved Instances or Savings Plans, Elastigroup will utilize them before using Spot instances
      - `optimizationWindows` string[] — When performAt is 'timeWindow': must specify a list of 'timeWindows' with at least one time window Each string is in the format of - ddd:hh:mm-ddd:hh:mm ddd = day of week = Sun | Mon | Tue | Wed | Thu | Fri | Sat hh = hour 24 = 0 -23 mm = minute = 0 - 59
      - `revertToSpot` object
        - `performAt` 'never' | 'always' | 'timeWindow' — Valid values: `always`, `never`, "timeWindow" Example: never Default: never
    - `compute` object
      - `subnetIds` string[], required — A comma-separated list of subnet identifiers for your instance.
      - `vpcId` string, required — VPC ID for your instance.
      - `elasticIp` string — Elastic IP Allocation Id to associate to the instance
      - `privateIp` string — Private IP Allocation Id to associate to the instance
      - `product` string — Operation system type. Possible values: Linux/UNIX, SUSE Linux, Windows, Red Hat Enterprise Linux In case of EC2 classic: Linux/UNIX (Amazon VPC), SUSE Linux (Amazon VPC), Windows (Amazon VPC), Red Hat Enterprise Linux (Amazon VPC)
      - `volumeAttachments` VolumeAttachments — unresolved $ref
      - `launchSpecification` object
        - `instanceTypes` object
          - `preferredType` string — Prioritized instance type. The instance type must be included in the selected instance types or meet the resource requirements if defined. Note: Either preferredType or preferredTypes can be defined, but not both.
          - `preferredTypes` string[] — Prioritized subset of instance types. The list must be a subset of the selected instance types or meet the resource requirements if defined. Note: Either preferredType or preferredTypes can be defined, but not both.
          - `types` string[] — Set instance types settings. Note: Cannot be defined if 'resourceRequirements' is defined.
          - `resourceRequirements` ResourceRequirements — unresolved $ref
        - `ebsOptimized` boolean — Enable EBS optimization for supported instance which is not enabled by default. Note - additional charges will be applied. Default: false
        - `monitoring` boolean — Describes whether instance Enhanced Monitoring is enabled. Default: false
        - `tenancy` string — Valid values: "default", "dedicated" Default: default
        - `iamRole` object
          - `name` string
          - `arn` string
        - `securityGroupIds` string[]
        - `imageId` string
        - `keyPair` string
        - `tags` object[]
          - `tagKey` string
          - `tagValue` string
        - `resourceTagSpecification` object — Optional field. User will specified which resources should be tagged with group tags.
          - `volumes` object — Optional field. Tag specification for Volume resources.
            - `shouldTag` boolean — Optional field. Volume resources will be tagged with group tags.
          - `snapshots` object — Optional field. Tag specification for Snapshot resources.
            - `shouldTag` boolean — Optional field. Snapshot resources will be tagged with group tags.
          - `enis` object — Optional field. Tag specification for ENI resources.
            - `shouldTag` boolean — Optional field. ENI resources will be tagged with group tags.
          - `amis` object — Optional field. Tag specification for AMI resources.
            - `shouldTag` boolean — Optional field. AMI resources will be tagged with group tags.
        - `userData` string
        - `shutdownScript` string
        - `creditSpecification` object
          - `cpuCredits` string
        - `networkInterfaces` object[]
          - `deviceIndex` integer
          - `associatePublicIpAddress` boolean
          - `associateIpv6Address` boolean
        - `blockDeviceMappings` object[]
          - `deviceName` string
          - `ebs` object
            - `iops` integer — Must be greater than or equal to 0
            - `throughput` integer — The amount of data transferred to or from a storage device per second, you can use this param just in a case that volumetype=‘gp3’.
            - `deleteOnTermination` boolean
            - `encrypted` boolean
            - `volumeSize` integer
            - `volumeType` string
            - `kmsKeyId` string
            - `snapshotId` string
        - `metadataOptions` object — Optional field. Used for IMDSv2.
          - `httpTokens` string, required — Required for IMDSv2. Can’t be null in Create or Update. Values can be "optional" or "required".
          - `httpPutResponseHopLimit` integer — An integer within 1,64 range (including). The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.
          - `instanceMetadataTags` 'Enabled' | 'Disabled' — Indicates whether access to instance tags from the instance metadata is enabled or disabled. Can’t be null.
    - `integrations` object
      - `loadBalancersConfig` object
        - `loadBalancers` object[]
          - `name` string
          - `arn` string
          - `type` string — The resource type. Valid Values: CLASSIC, TARGET_GROUP
      - `route53` object
        - `domains` object[]
          - `hostedZoneId` string
          - `recordSetType` string
          - `spotinstAccountId` string
          - `recordSets` object[]
            - `usePublicIp` boolean
            - `name` string
    - `scheduling` object
      - `tasks` object[]
        - `taskType` 'pause' | 'resume' | 'recycle' — The task type to run.
        - `startTime` string — DATETIME in ISO-8601 format. Sets a start time for scheduled actions. If `frequency` or `cronExpression` are not used - the task will run only once at the start time and will then be deleted from the group configuration
        - `cronExpression` string — A valid cron expression. For example : " * * * * * ". The cron is running in UTC time zone and is in Unix cron format Cron Expression Validator Script. Only one of ‘frequency' or ‘cronExpression' should be used at a time.
        - `isEnabled` boolean — Describes whether the task is enabled. When true the task should run when false it should not run.
        - `frequency` 'hourly' | 'daily' | 'weekly' — The recurrence frequency to run this task. Only one of `frequency` or `cronExpression` should be used at a time
    - `persistence` object — Persistence settings. Should omit at least one of the persist options below.
      - `blockDevicesMode` 'reattach' | 'onLaunch' — Determine the way we attach the data volumes to the data devices.
      - `persistRootDevice` boolean — Should the instance maintain its root device volumes
      - `persistBlockDevices` boolean — Should the instance maintain its Data volumes
      - `persistPrivateIp` boolean — Should the instance maintain its private IP
    - `healthCheck` object
      - `type` 'EC2' | 'ELB' | 'TARGET_GROUP' — The service to use for the health check.
      - `autoHealing` boolean — Enable the auto healing which auto replaces the instance in case the health check fails
      - `gracePeriod` integer — The amount of time, in seconds, after the instance has launched to starts and check its health.
      - `unhealthyDuration` integer — The amount of time, in seconds, an existing instance should remain active after becoming unhealthy.\ After the set time out the instance will be replaced

## Other responses

- `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)
