fbpx
PUThttps://api.spotinst.io/aws/ec2/group/{GROUP_ID}?accountId={ACCOUNT_ID}

Update one or more attributes in your Elastigroup. This API supports partial updates, so only specific fields can be updated separately.

Optional: You can add the shouldResumeStateful=true Query param to the URL. This will apply resuming action for Stateful instances in the Elastigroup upon scale up/ capacity changes. URL Example: aws/ec2/group/{groupId}?shouldResumeStateful=true

 

URL Parameters

Parameter Type Description
GROUP_ID * String

The Elastigroup id you want to update

Example: sig-12345
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc
Request - Example #1 - Update Capacity Attribute

Headers
{
	"Content-Type": "application/json",
	"Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "group": {
    "capacity": {
      "target": 0,
      "minimum": 0,
      "maximum": 0
    }
  }
}
Request - Example #2 - Update AMI

Headers
{
	"Content-Type": "application/json",
	"Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "group": {
    "compute": {
      "launchSpecification": {
        "imageId": "ami-1ecae776"
      }
    }
  }
}
Request - Example #3 - Update a Security Group

Headers
{
	"Content-Type": "application/json",
	"Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "group": {
    "compute": {
      "launchSpecification": {
        "securityGroupIds": [
          "sg-c6e031a3"
        ]
      }
    }
  }
}
Response - 200

Body
Copied!
Downloaded!
{
	"Content-Type": "application/json"
}
Response - 400 bad request - Group could not be updated due to an active roll

Headers
{
  "request": {
    "id": "989720c5-1757-416d-a170-9855ed34bf47",
    "url": "/ec2/group/sig-126bd7a1",
    "method": "PUT",
    "timestamp": "2018-03-08T09:21:39.857Z"
  },
  "response": {
    "status": {
      "code": 400,
      "message": "Bad Request"
    },
    "errors": [
      {
        "code": "CANT_UPDATE_GROUP",
        "message": "Group could not be updated due to an active roll."
      }
    ]
  }
}