fbpx

Allows you to create an Elastigroup based on the set up of an ASG. For full API docs check out Import ASG Docs. NOTE: if you want your Elastigroup to persist even after you delete the CloudFormation Stack add the section “DeletionPolicy”:”retain” to the JSON or YAML

Request - CloudFormation - JSON

Headers
  "SpotinstASG": {
    "Type": "Custom::importAsg",
    "Properties": {
      "ServiceToken": "!Sub arn:aws:lambda:${AWS::Region}:178579023202:function:spotinst-cloudformation",
      "accessToken": "YOUR SPOTINST API TOKEN",
      "accountId": "YOUR SPOTINST ACCOUNT ID",
      "asgName": "NAME OF THE ASG YOU WANT TO IMPORT",
      "region": "REGION WHERE ASG IS LOCATED",
      "group":{
        "product": "IMAGE TYPE",
        "spotInstanceTypes": [
        	"ARRAY OF INSTANCE TYPES"
        ],
        "name": "NAME OF NEW ELASTIGROUP TO CREATE"
      }
    }
  }
Request - CloudFormation - YAML

Headers
  SpotinstASG: 
    Type: Custom::importAsg
    Properties: 
      ServiceToken: !Sub arn:aws:lambda:${AWS::Region}:178579023202:function:spotinst-cloudformation
      accessToken: Your Spotinst API Token
      accountId: Your Spotinst Account ID
      asgName: Name of ASG to Import
      region: Region where ASG is located
      group:
        product: Image Type 
        spotInstanceTypes: 
			- Array of instance types 
        name: Name of New Elastigroup Created