fbpx
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
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{	
	"launchSpec": {
		"imageId": "ecsOptimize",
		"name": "mySpecLauncher",
		"securityGroupIds" : ["sg1", "sg2", "sg3"],
		"userData" : "dXNlcmJhc2g2NGVuY29kZWQ=",
		"iamInstanceProfile": {
			"arn":"arn:aws:iam::842422002533:instance-profile"
		},
		"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

launchSpelaunchSpec.attributes.name * String

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

Response - 200

Body
Copied!
Downloaded!
{
    "request": {
        "id": "cd9b5722-5c99-4d72-bf6b-0f74e0b0dfb1",
        "url": "/ocean/aws/ecs/launchSpec/ols-9bd1be93",
        "method": "PUT",
        "timestamp": "2019-06-15T10:50:11.555Z"
    },
    "response": {
        "status": {
            "code": 200,
            "message": "OK"
        },
        "kind": "spotinst:ocean:aws:ecs",
        "items": [
            {
                "id": "ols-9bd1be93",
                "oceanId": "o-89693f32",
                "name": "mySpecLauncher",
                "imageId": "ecsOptimize",
                "userData": "dXNlcmJhc2g2NGVuY29kZWQ=",
                "securityGroupIds": [
                    "sg1",
                    "sg2",
                    "sg3"
                ],
                "iamInstanceProfile": {
                    "arn": "arn:aws:iam::842422002533:instance-profile"
                },
                "attributes": [
                    {
                        "key": "key1",
                        "value": "v1"
                    },
                    {
                        "key": "key2",
                        "value": "v2"
                    }
                ],
                "createdAt": "2019-06-15T10:48:38.000Z",
                "updatedAt": "2019-06-15T10:48:38.000Z"
            }
        ],
        "count": 1
    }
}