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

Create a beanstalk elastigroup with the following steps:

  1. Get the beanstalk configuration to JSON format
  2. Modify required parameters and post the JSON as a body to create a new elastigroup

URL Parameters

ParameterTypeDescription
ACCOUNT_ID String

Your account id in spotinst

Example: act-12345
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "group": {
    "name": "e-hhsttckq9a group",
    "description": "Linked to environment: e-hhsttckq9a",
    "capacity": {
      "minimum": 0,
      "maximum": 1,
      "target": 0
    },
    "strategy": {
      "risk": 100
    },
    "compute": {
      "instanceTypes": {
        "ondemand": "t2.micro",
        "spot": [
          "t2.micro"
        ]
      },
      "product": "Linux/UNIX",
      "availabilityZones": [
        {
          "name": "us-west-2a"
        },
        {
          "name": "us-west-2b"
        },
        {
          "name": "us-west-2c"
        }
      ],
      "launchSpecification": {
        "loadBalancersConfig": {
          "loadBalancers": [
            {
              "name": "awseb-AWSEB-G5V9TY95NPBJ",
              "arn": "arn:aws:elasticloadbalancing:us-west-2:842422002533:targetgroup/awseb-AWSEB-G5V9TY95NPBJ/245f20215d9ba7fc",
              "type": "TARGET_GROUP"
            }
          ]
        },
        "healthCheckType": "EC2",
        "securityGroupIds": [
          "sg-a36644df"
        ],
        "monitoring": false,
        "imageId": "ami-8760caff",
        "iamRole": {
          "name": "aws-elasticbeanstalk-ec2-role"
        },
        "userData": "Q29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5PSI9PT09PT09PT09PT09PT01MTg5MDY1Mzc3MjIyODk4NDA3PT0iCk1JTUUtVmVyc2lvbjogMS4wCgotLT09PT09PT09PT09PT09PTUxODkwNjUzNzcyMjI4OTg0MDc9PQpDb250ZW50LVR5cGU6IHRleHQvY2xvdWQtY29uZmlnOyBjaGFyc2V0PSJ1cy1hc2NpaSIKTUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UcmF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2txOWEtc3RhY2svMWEyNTQ4MzAtZjQ4OC0xMWU3LThhMDEtNTAzYWM5ZWMyNGQxJyAgICAndXMtd2VzdC0yJyAgICAnMTljYWI5NDRiN2Y4JyAgICAnYzk4ZjliMmItYmExNy00MTdhLTljMGEtZTM1YmI2NjY3ZDc4JyAgICAnJyAgICAnbmdpbngnICAgICcnICAgICYmIAogICAgZXhpdCAwICAKICBmaSAKZG9uZQoKLS09PT09PT09PT09PT09PT01MTg5MDY1Mzc3MjIyODk4NDA3PT0tLSA=",
        "tags": [
          {
            "tagKey": "Creator",
            "tagValue": "Snir"
          },
          {
            "tagKey": "Name",
            "tagValue": "SnirALB-dev"
          },
          {
            "tagKey": "elasticbeanstalk:environment-id",
            "tagValue": "e-hhsttckq9a"
          },
          {
            "tagKey": "elasticbeanstalk:environment-name",
            "tagValue": "SnirALB-dev"
          }
        ]
      }
    },
    "scaling": {
      "up": [
        {
          "policyName": "awseb-e-hhsttckq9a-stack-AWSEBCloudwatchAlarmHigh-56QPITB3WUFM",
          "metricName": "NetworkOut",
          "statistic": "average",
          "unit": "bytes",
          "threshold": 6000000,
          "namespace": "AWS/EC2",
          "source": "cloudWatch",
          "period": 300,
          "evaluationPeriods": 1,
          "cooldown": 360,
          "dimensions": [
            {
              "name": "InstanceId"
            }
          ],
          "action": {
            "type": "adjustment",
            "adjustment": "1"
          },
          "operator": "gte"
        }
      ],
      "down": [
        {
          "policyName": "awseb-e-hhsttckq9a-stack-AWSEBCloudwatchAlarmLow-UNGVBRKT0EHP",
          "metricName": "NetworkOut",
          "statistic": "average",
          "unit": "bytes",
          "threshold": 2000000,
          "namespace": "AWS/EC2",
          "source": "cloudWatch",
          "period": 300,
          "evaluationPeriods": 1,
          "cooldown": 360,
          "dimensions": [
            {
              "name": "InstanceId"
            }
          ],
          "action": {
            "type": "adjustment",
            "adjustment": "1"
          },
          "operator": "lte"
        }
      ]
    },
    "thirdPartiesIntegration": {
      "elasticBeanstalk": {
        "environmentId": "e-hhsttckq9a"
      }
    }
  }
}

Body Parameters

ParameterTypeDescription
compute.product * String

Operation system type.

Example: Linux/UNIX, SUSE Linux, Windows, Linux/UNIX (Amazon VPC), SUSE Linux (Amazon VPC), Windows (Amazon VPC)
compute.instanceTypes.spot * Array

Your spot types

Example: ["t2.micro"]
compute.instanceTypes.ondemand * String

Your on-demand type

Example: "t2.micro"
Response - 200

Headers
{
    "Content-Type": "application/json"
}