fbpx
Parameter Type Description
beanstalkElastigroup.beanstalk.environmentId * String

the beanstalk environment ID

Example: e-12345
beanstalkElastigroup.ignoreInitHealthChecks String

determines whether Elasitgroup should wait for the instances to be healthy in order to complete the group's creation

Example: false
beanstalkElastigroup.name * String

The name to give the Spotinst Elastigroup

Example: MyBeanstalkEG
beanstalkElastigroup.region * String

The region of the existing Beanstalk environment. The new Elastigroup will be created in the same region.

Example: us-west-2
beanstalkElastigroup.healthCheckType String

How Sposting Elastigroup will preform health checks. Valid values: TARGET_GROUP | ELB | EC2 | NONE

beanstalkElastigroup.healthCheckGracePeriod Integer

Time to wait before starting health checks on the instances in the Elastigroup.

Example: 600
beanstalkElastigroup.capacity.target * Integer

The number of instances the Elastigroup will launch.

Example: 2
beanstalkElastigroup.capacity.minimum * Integer

The minimum number of instances allowed in the Elastigroup.

Example: 1
beanstalkElastigroup.capacity.maximum * Integer

The maximum number of instances allowed in the Elastigorup.

Example: 3
beanstalkElastigroup.product * String

A valid AWS product type.

Example: Linux/UNIX
beanstalkElastigroup.spotInstanceTypes * Array

A list of EC2 instance types that the Elastigroup is allowed to choose from.

Example: ["m3.large", "m4.large"]
beanstalkElastigroup.groupConfig Object

Additional Elastigroup properties that will be merged with the imported Beanstalk configuration. Valid parameters include those listed in the official Elastigroup API, found here: https://api.spotinst.com/spotinst-api/elastigroup/amazon-web-services/create/

Example: {"scheduling": { "tasks": [{"taskType": "roll", "cronExpression": "0 0 * * 0", "batchSizePercentage": 20 } ] } }
Request

Body
Copied!
Downloaded!
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Template Example For Creating an Elastigroup in an Existing Beanstalk environment ",
  "Parameters": {
    "ignoreInitHealthChecks": {
      "Type": "String",
      "Default": "false",
      "AllowedValues": [
        "false",
        "true"
      ],
      "Description": "Should wait for instances to be healthy on group create"
    }
  },
  "Resources": {
    "SampleSpotinstElastigroup": {
      "Type": "Custom::beanstalkElastigroup",
      "Properties": {
        "ServiceToken": "arn:aws:lambda:us-west-1:178579023202:function:spotinst-cloudformation",
        "accessToken": "YOUR_TOKEN_HERE",
        "accountId": "act-12345",
        "createPolicy": {
          "ignoreInitHealthChecks": {
            "Ref": "ignoreInitHealthChecks"
          }
        },
        "beanstalkElastigroup": {
          "beanstalk": {
            "environmentId": "e-12345"
          },
          "name": "beanstalk-test",
          "region": "us-west-1",
          "healthCheckType": "TARGET_GROUP",
          "healthCheckGracePeriod": 600,
          "capacity": {
            "target": 1,
            "minimum": 1,
            "maximum": 1
          },
          "product": "Linux/UNIX",
          "spotInstanceTypes": [
            "m3.large",
            "m4.large"
          ],
          "groupConfig": {}
        }
      }
    }
  }
}