Elastic Beanstalk

This post demonstrates how to create an Elastigroup integrated with Elastic Beanstalk using the Spotinst Terraform plugin.

This post assumes that you already have a Spotinst account and went through Spotinst Terraform Installation & Configuration.

Note: This feature is not officially released and is only available as a beta in the Official Provider Latest Features section of the Installation page.

Example Usage – Beanstalk Elastigroup

Create an elastigroup based on an existing beanstalk environment

resource "spotinst_beanstalk_elastigroup" "example_beanstalk_group" {
   name    = "beanstalk_elastigroup"
   region  = "us-east-1"
   product = "Linux/UNIX"

   min_size         = 0
   max_size         = 4
   desired_capacity = 2

   beanstalk_environment_name = "example-env-1"
   instance_types_spot        = ["t2.micro", "t2.small"]
   maintenance = "START"


Argument Reference

Parameter Type Description
name * String

The name of the elastigroup.

Example: "my_group"
region * String

The Beanstalk environment region.

Example: us-east-1
product * String

Operating system.

Example: Linux/UNIX
min_size * Integer

Minimal amount of instances in the group when scaling.

Example: 1
max_size * Integer

Maximum amount of instances in the group when scaling.

Example: 4
desired_capacity * Integer

Amount of instances to spin in the group.

Example: 2
instance_types_spot * Array<String>

A list of strings. Each is a spot instance type name.

Example: ["t2.micro", "t2.medium"]
beanstalk_environment_name * String

The Beanstalk environment name.

Example: Example-env-1
maintenance String

Send a signal to either start or end beanstalk maintenance mode. Can be "START", "END", or "SATUS"

Example: START

Attributes Reference

Attribute Type Description
id String

The elastigroup ID. This attribute is generated as a result of importing the beanstalk environment.

Example: sig-123456