PUThttps://api.spotinst.io/ocean/aws/ecs/launchSpec/{OCEAN_LAUNCH_SPEC_ID}?accountId={ACCOUNT_ID}

Update Ocean ECS cluster launch specification.

Each one of the fields below can be updated separately or together.

URL Parameters

Parameter Type Description
OCEAN_LAUNCH_SPEC_ID * String

Ocean cluster launchSpec ID.

ACCOUNT_ID * String

The Spotinst accountId associated with your token.

Example: act-123abc
Request

Headers
Copied!
Downloaded!
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{	
	"launchSpec": {
		"attributes": [
			{
				"key":"key1",
				"value":"v1"
            },
			{
				"key":"key2",
				"value":"v2"
			}
		]
	}
}

Body Attributes


Attribute Type Description
launchSpec * Object

launchSpec.name String

Update launch specifications name

launchSpec.sourceImage String

Update image ID

launchSpec.securityGroupIds Array<String>

Update security groups. Each element in array should be security group ID

launchSpec.userData Base64

Base64-encoded MIME user data to make available to the instances.

launchSpec.iamInstanceProfile Object

The instance profile iamRole object

launchSpec.iamInstanceProfile.arn String

The iamRole arn. If set - do not set launchSpec.iamInstanceProfile.name

launchSpec.iamInstanceProfile.name String

The iamRole name. If set - do not set launchSpec.iamInstanceProfile.arn

launchSpec.attributes Array<Object>

Update attributes on cluster

launchSpec.attributes.key * String

Set attribute's key. Required on launchSpec.attributes object

launchSpec.attributes.name * String

Set attribute's name. Required on launchSpec.attributes object

launchSpec.autoScale Object

launchSpec.autoScale.headrooms Array<Object>

Set custom headroom per launch spec. provide list of launchSpec.autoscale.headrooms object

launchSpec.autoScale.headrooms.cpuPerUnit Integer

configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU

Example: 1024
launchSpec.autoScale.headrooms.memoryPerUnit Integer

Configure the amount of memory (MiB) to allocate the headroom.

Example: 512
launchSpec.autoScale.headrooms.numOfUnits Integer

The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.

Example: 2
launchSpec.tags Array<Object>

List of kay-value pairs of tags

launchSpec.tags.tagKey String

Set the tag key

launchSpec.tags.tagValue String

Set the tag value

launchSpec.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 spec at the same time. This parameter can be null, but if not null, it must contain at least one block device.

launchSpec.blockDeviceMappings.deviceName String

Set device name.

Example: /dev/xvda
launchSpec.blockDeviceMappings.ebs.volumeType String

Set volume type.

Example: gp2
launchSpec.blockDeviceMappings.ebs.deleteOnTermination Boolean

Flag to delete the EBS on instance termination.

Example: true
launchSpec.blockDeviceMappings.ebs.encrypted Boolean

Example: false
launchSpec.blockDeviceMappings.ebs.iops Integer

Must be greater than or equal to 0.

Example: 1
launchSpec.blockDeviceMappings.ebs.kmsKeyId String

Example: alias/aws/ebs
launchSpec.blockDeviceMappings.ebs.snapshotId String

Example: snap-abcdefghi111110
launchSpec.blockDeviceMappings.ebs.volumeSize String

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 or equal than the size configured in the AMI.

launchSpec.blockDeviceMappings.ebs.dynamicVolumeSize Object

Set dynamic volume size properties. When using this object, you cannot use volumeSize. You must use one or the other.

launchSpec.blockDeviceMappings.ebs.dynamicVolumeSize.baseSize * Integer

Initial size for volume.

Example: 50
launchSpec.blockDeviceMappings.ebs.dynamicVolumeSize.resource * String

Valid values: "CPU"

Example: CPU
launchSpec.blockDeviceMappings.ebs.dynamicVolumeSize.sizePerResourceUnit * Integer

Additional size per resource unit (in GB). For example: if baseSize=50, and sizePerResourceUnit=20, and an instance with 2 CPU is launched - its disk size will be: 90GB

Example: 20
Response - 200

Body
Copied!
Downloaded!
{
  "request": {
    "id": "c77fd005-04b3-4e8b-93a9-bb48e9cf44b9",
    "url": "/ocean/aws/ecs/launchSpec?spotinstAccountId=act-7461862f",
    "method": "POST",
    "timestamp": "2019-06-15T10:48:38.242Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:ocean:aws:ecs",
    "items": [
      {
        "id": "ols-9bd1be93",
        "oceanId": "o-89693f32",
        "name": "mySpecLauncher",
        "imageId": "img2",
        "userData": "dXNlcmJhc2g2NGVuY29kZWQ=",
        "securityGroupIds": [
          "sg1",
          "sg3"
        ],
        "iamInstanceProfile": {
          "arn": "arn:aws:iam::842422002533:instance-profile"
        },
        "attributes": [
          {
            "key": "key1",
            "value": "v1"
          },
          {
            "key": "key2",
            "value": "v2"
          }
        ],
        "autoscale": {
          "headrooms": [
            {
              "cpuPerUnit": 1024,
              "memoryPerUnit": 512,
              "numOfUnits": 2
            }
          ]
        },
        "tags": [
          {
            "tagKey": "Creator",
            "tagValue": "John Doe"
          },
          {
            "tagKey": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup",
            "tagValue": "nodes"
          },
          {
            "tagKey": "k8s.io/role/node",
            "tagValue": "1"
          },
          {
            "tagKey": "KubernetesCluster",
            "tagValue": "from2.ek8s.com"
          },
          {
            "tagKey": "kops.k8s.io/instancegroup",
            "tagValue": "nodes"
          }
        ],
        "blockDeviceMappings": [
      	{
            "deviceName": "/dev/xvda",
            "ebs": {
                "deleteOnTermination": false,
                "encrypted": "false",
                "iops": 1,
                "kmsKeyId": "alias/aws/ebs",
                "snapshotId": "snap-abcdefghi111110"
                "dynamicVolumeSize": {
                  "baseSize": 10,
                  "resource": "CPU",
                  "sizePerResourceUnit": 1
            	 },
            	"volumeType": "gp2"
             }
        }
    ]
        "createdAt": "2019-06-15T10:48:38.065Z",
        "updatedAt": "2019-06-15T10:48:38.065Z"
      }
    ],
    "count": 1
  }
}