fbpx
POSThttps://api.spotinst.io/aws/ec2/group/autoScalingGroup/import?region={REGION}&accountId={ACCOUNT_ID}&autoScalingGroupName={ASG_NAME}&dryRun=false

Create a new Elastigroup – this Elastigroup will have the same configuration of the imported Autoscaling group.

URL Parameters

Parameter Type Description
ASG_NAME * String

The ASG name

Example: MyASG
REGION * String

The AWS region for the ASG

Example: us-east-1
ACCOUNT_ID String

Your account id in spotinst

Example: act-12345
dryRun Boolean

When `dryRun` is set to `true`, the API call will return the Elastigroup configuration without actually performing any action.

Example: true
Default: false

Available Body Attributes


Attribute Type Description
group Object

Holding the Group configuration

group.product String

Operation system type. Possible values: Linux/UNIX | SUSE | Linux Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)

Example: Linux/UNIX (Amazon VPC)
group.spotInstanceTypes Array<String>

An Array holding the types of instances to be used in the Elastigroup

Example: [“m3.large”,“m4.large”]
group.name String

Specify the actual auto scaling group name that the configuration will be imported from

Example: MyEG
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "group": {
    "product": "Linux/UNIX",
    "spotInstanceTypes": [
      "c3.large",
      "m4.large"
    ],
    "name": "My Group"
  }
}
Response - 200

Headers
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "621df94c-c634-4d6c-a162-0102d9652b86",
    "url": "/aws/ec2/group/autoScalingGroup/import?region=us-west-2&TESTING_ASG",
    "method": "POST",
    "timestamp": "2018-02-18T13:56:09.469Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:aws:ec2:group",
    "items": [
      {
        "id": "sig-e2927aac",
        "name": "TESTING_ASG",
        "description": "Imported from auto scaling group: TESTING_ASG",
        "capacity": {
          "minimum": 0,
          "maximum": 0,
          "target": 0,
          "unit": "instance"
        },
        "strategy": {
          "risk": 100,
          "drainingTimeout": 0
        },
        "compute": {
          "instanceTypes": {
            "ondemand": "m3.medium",
            "spot": [
              "c3.large"
            ]
          },
          "availabilityZones": [
            {
              "name": "us-west-2b",
              "subnetId": "subnet-2e967065",
              "subnetIds": [
                "subnet-2e967065"
              ]
            }
          ],
          "product": "Linux/UNIX",
          "launchSpecification": {
            "loadBalancersConfig": {
              "loadBalancers": [
                {
                  "name": "TESTING_ASG",
                  "type": "CLASSIC"
                }
              ]
            },
            "healthCheckType": "EC2",
            "healthCheckGracePeriod": 600,
            "securityGroupIds": [
              "sg-451f8b3a"
            ],
            "monitoring": false,
            "imageId": "ami-485eef30",
            
            "ebsOptimized": true,
            "blockDeviceMappings": [
            {
            "deviceName": "/dev/sda1",
            "ebs": {
            "deleteOnTermination": true,
            "volumeSize": 30,
            "volumeType": "gp2"
            }
            }
            ]
          }
        },
        "scaling": {},
        "createdAt": "2018-02-18T13:56:09.449+0000",
        "updatedAt": "2018-02-18T13:56:09.449+0000"
      }
    ],
    "count": 1
  }
}