Skip to main content

Use Existing Environment

AttributeTypeDescription
beanstalkElastigroup.beanstalk.environmentId *StringThe beanstalk environment ID
Example: e-12345
beanstalkElastigroup.beanstalk.managedActionsObjectmanagedActions schema
beanstalkElastigroup.beanstalk.managedActions.platformUpdateObjectplatformUpdate schema
beanstalkElastigroup.beanstalk.managedActions.platformUpdate.performAtStringEither never or timeWindow. If set to timeWindow then timeWindow parameter must be set
beanstalkElastigroup.beanstalk.managedActions.platformUpdate.timeWindowStringTime window range
Example: ddd:hh:mm-ddd:hh:mm
beanstalkElastigroup.beanstalk.managedActions.platformUpdate.updateLevelStringCan be either patch or minorAndPatch (default)
beanstalkElastigroup.beanstalk.managedActions.platformUpdate.instanceRefreshEnabledBooleanIf the flag is set to true and at the end of the time window there is no available update, the group will be rolled
beanstalkElastigroup.beanstalk.deploymentPreferencesStringdeploymentPreferences schema
beanstalkElastigroup.beanstalk.deploymentPreferences.automaticRollStringShould roll automatically
beanstalkElastigroup.beanstalk.deploymentPreferences.batchSizePercentageStringSize of patch for roll as a percent
beanstalkElastigroup.beanstalk.deploymentPreferences.gracePeriodStringAmount of time between each batch in a roll
beanstalkElastigroup.beanstalk.deploymentPreferences.strategyStringStrategy schema
beanstalkElastigroup.beanstalk.deploymentPreferences.strategy.actionStringAction type
Example: REPLACE_SERVER, RESTART_SERVER
beanstalkElastigroup.beanstalk.deploymentPreferences.strategy.shouldDrainInstancesStringShould instances be drained while rolling
beanstalkElastigroup.ignoreInitHealthChecksStringDetermines whether Elasitgroup should wait for the instances to be healthy in order to complete the group's creation
Example: False
beanstalkElastigroup.name *StringThe name to give the Spot Elastigroup
Example: MyBeanstalkEG
beanstalkElastigroup.region *StringThe region of the existing Beanstalk environment. The new Elastigroup will be created in the same region.
Example: us-west-2
beanstalkElastigroup.healthCheckTypeStringHow Elastigroup will perform health checks. Valid values: TARGET_GROUP, ELB, EC2, NONE
beanstalkElastigroup.healthCheckGracePeriodIntegerTime to wait before starting health checks on the instances in the Elastigroup.
Example: 600
beanstalkElastigroup.capacity.target *IntegerThe number of instances the Elastigroup will launch.
Example: 2
beanstalkElastigroup.capacity.minimum *IntegerThe minimum number of instances allowed in the Elastigroup.
Example: 1
beanstalkElastigroup.capacity.maximum *IntegerThe maximum number of instances allowed in the Elastigorup.
Example: 3
beanstalkElastigroup.product *StringA valid AWS product type.
Example: Linux/UNIX
beanstalkElastigroup.spotInstanceTypes *ArrayA list of EC2 instance types that the Elastigroup is allowed to choose from.
Example: ["m3.large", "m4.large"]
beanstalkElastigroup.groupConfigObjectAdditional Elastigroup properties that will be merged with the imported Beanstalk configuration. Valid parameters include those listed in the official Elastigroup API, found here: AWS Elastigroup Definition
Example: {"scheduling": { "tasks": [{"taskType": "roll", "cronExpression": "0 0 * * 0", "batchSizePercentage": 20 } ] } }

Request

{
"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-3tkmbj7hzc",
"managedActions": {
"platformUpdate": {
"performAt": "timeWindow",
"timeWindow": "Sun:01:00-Sun:02:00",
"updateLevel": "minorAndPatch",
"instanceRefreshEnabled": true
}
},
"deploymentPreferences": {
"automaticRoll": true,
"batchSizePercentage": 100,
"gracePeriod": 0,
"strategy": {
"action": "REPLACE_SERVER",
"shouldDrainInstances": false
}
}
},
"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": {}
}
}
}
}
}