Beanstalk

Provides a Spotinst AWS group resource using Elastic Beanstalk.

Scheduled Tasks

Each scheduled_task supports the following:

  • task_type - (Required) The task type to run. Supported task types are: "scale", "backup_ami", "roll", "scaleUp", "percentageScaleUp", "scaleDown", "percentageScaleDown", "statefulUpdateCapacity".
  • cron_expression - (Optional; Required if not using frequency) A valid cron expression. The cron is running in UTC time zone and is in Unix cron format.
  • start_time - (Optional; Format: ISO 8601) Set a start time for one time tasks.
  • frequency - (Optional; Required if not using cron_expression) The recurrence frequency to run this task. Supported values are "hourly", "daily", "weekly" and "continuous".
  • scale_target_capacity - (Optional) The desired number of instances the group should have.
  • scale_min_capacity - (Optional) The minimum number of instances the group should have.
  • scale_max_capacity - (Optional) The maximum number of instances the group should have.
  • is_enabled - (Optional, Default: true) Setting the task to being enabled or disabled.
  • target_capacity - (Optional; Only valid for statefulUpdateCapacity) The desired number of instances the group should have.
  • min_capacity - (Optional; Only valid for statefulUpdateCapacity) The minimum number of instances the group should have.
  • max_capacity - (Optional; Only valid for statefulUpdateCapacity) The maximum number of instances the group should have.
  • batch_size_percentage - (Optional; Required when the task_type is "roll".) The percentage size of each batch in the scheduled deployment roll.
  • grace_period - (Optional) The period of time (seconds) to wait before checking a batch’s health after it’s deployment.
  • adjustment - (Optional; Min 1) The number of instances to add or remove.
  • adjustment_percentage - (Optional; Min 1) The percentage of instances to add or remove.

Usage:

import * as pulumi from "@pulumi/pulumi";
import pulumi
using Pulumi;

class MyStack : Stack
{
    public MyStack()
    {
    }

}

Example Usage

using Pulumi;
using SpotInst = Pulumi.SpotInst;

class MyStack : Stack
{
    public MyStack()
    {
        var elastigoup_aws_beanstalk = new SpotInst.Aws.Beanstalk("elastigoup-aws-beanstalk", new SpotInst.Aws.BeanstalkArgs
        {
            BeanstalkEnvironmentId = "e-example",
            BeanstalkEnvironmentName = "example-env",
            DeploymentPreferences = new SpotInst.Aws.Inputs.BeanstalkDeploymentPreferencesArgs
            {
                AutomaticRoll = true,
                BatchSizePercentage = 100,
                GracePeriod = 90,
                Strategy = 
                {
                    
                    {
                        { "action", "REPLACE_SERVER" },
                        { "shouldDrainInstances", true },
                    },
                },
            },
            DesiredCapacity = 0,
            InstanceTypesSpots = 
            {
                "t2.micro",
                "t2.medium",
                "t2.large",
            },
            ManagedActions = new SpotInst.Aws.Inputs.BeanstalkManagedActionsArgs
            {
                PlatformUpdate = new SpotInst.Aws.Inputs.BeanstalkManagedActionsPlatformUpdateArgs
                {
                    PerformAt = "timeWindow",
                    TimeWindow = "Mon:23:50-Tue:00:20",
                    UpdateLevel = "minorAndPatch",
                },
            },
            MaxSize = 1,
            MinSize = 0,
            Product = "Linux/UNIX",
            Region = "us-west-2",
        });
    }

}

Coming soon!

import pulumi
import pulumi_spotinst as spotinst

elastigoup_aws_beanstalk = spotinst.aws.Beanstalk("elastigoup-aws-beanstalk",
    beanstalk_environment_id="e-example",
    beanstalk_environment_name="example-env",
    deployment_preferences={
        "automaticRoll": True,
        "batchSizePercentage": 100,
        "grace_period": 90,
        "strategy": [{
            "action": "REPLACE_SERVER",
            "shouldDrainInstances": True,
        }],
    },
    desired_capacity=0,
    instance_types_spots=[
        "t2.micro",
        "t2.medium",
        "t2.large",
    ],
    managed_actions={
        "platformUpdate": {
            "performAt": "timeWindow",
            "timeWindow": "Mon:23:50-Tue:00:20",
            "updateLevel": "minorAndPatch",
        },
    },
    max_size=1,
    min_size=0,
    product="Linux/UNIX",
    region="us-west-2")
import * as pulumi from "@pulumi/pulumi";
import * as spotinst from "@pulumi/spotinst";

const elastigoup_aws_beanstalk = new spotinst.aws.Beanstalk("elastigoup-aws-beanstalk", {
    beanstalkEnvironmentId: "e-example",
    beanstalkEnvironmentName: "example-env",
    deploymentPreferences: {
        automaticRoll: true,
        batchSizePercentage: 100,
        gracePeriod: 90,
        strategies: [{
            action: "REPLACE_SERVER",
            shouldDrainInstances: true,
        }],
    },
    desiredCapacity: 0,
    instanceTypesSpots: [
        "t2.micro",
        "t2.medium",
        "t2.large",
    ],
    managedActions: {
        platformUpdate: {
            performAt: "timeWindow",
            timeWindow: "Mon:23:50-Tue:00:20",
            updateLevel: "minorAndPatch",
        },
    },
    maxSize: 1,
    minSize: 0,
    product: "Linux/UNIX",
    region: "us-west-2",
});

Create a Beanstalk Resource

def Beanstalk(resource_name, opts=None, beanstalk_environment_id=None, beanstalk_environment_name=None, deployment_preferences=None, desired_capacity=None, instance_types_spots=None, maintenance=None, managed_actions=None, max_size=None, min_size=None, name=None, product=None, region=None, scheduled_tasks=None, __props__=None);
func NewBeanstalk(ctx *Context, name string, args BeanstalkArgs, opts ...ResourceOption) (*Beanstalk, error)
public Beanstalk(string name, BeanstalkArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args BeanstalkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BeanstalkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BeanstalkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Beanstalk Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Beanstalk resource accepts the following input properties:

DesiredCapacity int

The desired number of instances the group should have at any time.

InstanceTypesSpots List<string>

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

MaxSize int

The maximum number of instances the group should have at any time.

MinSize int

The minimum number of instances the group should have at any time.

Product string

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

Region string

The AWS region your group will be created in. Cannot be changed after the group has been created.

BeanstalkEnvironmentId string

The id of an existing Beanstalk environment.

BeanstalkEnvironmentName string

The name of an existing Beanstalk environment.

DeploymentPreferences Pulumi.SpotInst.Aws.Inputs.BeanstalkDeploymentPreferencesArgs

Preferences when performing a roll

Maintenance string
ManagedActions Pulumi.SpotInst.Aws.Inputs.BeanstalkManagedActionsArgs

Managed Actions parameters

Name string

The group name.

ScheduledTasks List<Pulumi.SpotInst.Aws.Inputs.BeanstalkScheduledTaskArgs>
DesiredCapacity int

The desired number of instances the group should have at any time.

InstanceTypesSpots []string

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

MaxSize int

The maximum number of instances the group should have at any time.

MinSize int

The minimum number of instances the group should have at any time.

Product string

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

Region string

The AWS region your group will be created in. Cannot be changed after the group has been created.

BeanstalkEnvironmentId string

The id of an existing Beanstalk environment.

BeanstalkEnvironmentName string

The name of an existing Beanstalk environment.

DeploymentPreferences BeanstalkDeploymentPreferences

Preferences when performing a roll

Maintenance string
ManagedActions BeanstalkManagedActions

Managed Actions parameters

Name string

The group name.

ScheduledTasks []BeanstalkScheduledTask
desiredCapacity number

The desired number of instances the group should have at any time.

instanceTypesSpots string[]

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

maxSize number

The maximum number of instances the group should have at any time.

minSize number

The minimum number of instances the group should have at any time.

product string

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

region string

The AWS region your group will be created in. Cannot be changed after the group has been created.

beanstalkEnvironmentId string

The id of an existing Beanstalk environment.

beanstalkEnvironmentName string

The name of an existing Beanstalk environment.

deploymentPreferences BeanstalkDeploymentPreferences

Preferences when performing a roll

maintenance string
managedActions BeanstalkManagedActions

Managed Actions parameters

name string

The group name.

scheduledTasks BeanstalkScheduledTask[]
desired_capacity float

The desired number of instances the group should have at any time.

instance_types_spots List[str]

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

max_size float

The maximum number of instances the group should have at any time.

min_size float

The minimum number of instances the group should have at any time.

product str

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

region str

The AWS region your group will be created in. Cannot be changed after the group has been created.

beanstalk_environment_id str

The id of an existing Beanstalk environment.

beanstalk_environment_name str

The name of an existing Beanstalk environment.

deployment_preferences Dict[BeanstalkDeploymentPreferences]

Preferences when performing a roll

maintenance str
managed_actions Dict[BeanstalkManagedActions]

Managed Actions parameters

name str

The group name.

scheduled_tasks List[BeanstalkScheduledTask]

Outputs

All input properties are implicitly available as output properties. Additionally, the Beanstalk resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Beanstalk Resource

Get an existing Beanstalk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BeanstalkState, opts?: CustomResourceOptions): Beanstalk
static get(resource_name, id, opts=None, beanstalk_environment_id=None, beanstalk_environment_name=None, deployment_preferences=None, desired_capacity=None, instance_types_spots=None, maintenance=None, managed_actions=None, max_size=None, min_size=None, name=None, product=None, region=None, scheduled_tasks=None, __props__=None);
func GetBeanstalk(ctx *Context, name string, id IDInput, state *BeanstalkState, opts ...ResourceOption) (*Beanstalk, error)
public static Beanstalk Get(string name, Input<string> id, BeanstalkState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

BeanstalkEnvironmentId string

The id of an existing Beanstalk environment.

BeanstalkEnvironmentName string

The name of an existing Beanstalk environment.

DeploymentPreferences Pulumi.SpotInst.Aws.Inputs.BeanstalkDeploymentPreferencesArgs

Preferences when performing a roll

DesiredCapacity int

The desired number of instances the group should have at any time.

InstanceTypesSpots List<string>

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

Maintenance string
ManagedActions Pulumi.SpotInst.Aws.Inputs.BeanstalkManagedActionsArgs

Managed Actions parameters

MaxSize int

The maximum number of instances the group should have at any time.

MinSize int

The minimum number of instances the group should have at any time.

Name string

The group name.

Product string

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

Region string

The AWS region your group will be created in. Cannot be changed after the group has been created.

ScheduledTasks List<Pulumi.SpotInst.Aws.Inputs.BeanstalkScheduledTaskArgs>
BeanstalkEnvironmentId string

The id of an existing Beanstalk environment.

BeanstalkEnvironmentName string

The name of an existing Beanstalk environment.

DeploymentPreferences BeanstalkDeploymentPreferences

Preferences when performing a roll

DesiredCapacity int

The desired number of instances the group should have at any time.

InstanceTypesSpots []string

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

Maintenance string
ManagedActions BeanstalkManagedActions

Managed Actions parameters

MaxSize int

The maximum number of instances the group should have at any time.

MinSize int

The minimum number of instances the group should have at any time.

Name string

The group name.

Product string

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

Region string

The AWS region your group will be created in. Cannot be changed after the group has been created.

ScheduledTasks []BeanstalkScheduledTask
beanstalkEnvironmentId string

The id of an existing Beanstalk environment.

beanstalkEnvironmentName string

The name of an existing Beanstalk environment.

deploymentPreferences BeanstalkDeploymentPreferences

Preferences when performing a roll

desiredCapacity number

The desired number of instances the group should have at any time.

instanceTypesSpots string[]

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

maintenance string
managedActions BeanstalkManagedActions

Managed Actions parameters

maxSize number

The maximum number of instances the group should have at any time.

minSize number

The minimum number of instances the group should have at any time.

name string

The group name.

product string

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

region string

The AWS region your group will be created in. Cannot be changed after the group has been created.

scheduledTasks BeanstalkScheduledTask[]
beanstalk_environment_id str

The id of an existing Beanstalk environment.

beanstalk_environment_name str

The name of an existing Beanstalk environment.

deployment_preferences Dict[BeanstalkDeploymentPreferences]

Preferences when performing a roll

desired_capacity float

The desired number of instances the group should have at any time.

instance_types_spots List[str]

One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.

maintenance str
managed_actions Dict[BeanstalkManagedActions]

Managed Actions parameters

max_size float

The maximum number of instances the group should have at any time.

min_size float

The minimum number of instances the group should have at any time.

name str

The group name.

product str

Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

region str

The AWS region your group will be created in. Cannot be changed after the group has been created.

scheduled_tasks List[BeanstalkScheduledTask]

Supporting Types

BeanstalkDeploymentPreferences

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AutomaticRoll bool

Should roll perform automatically

BatchSizePercentage int

Percent size of each batch

GracePeriod int

Amount of time to wait between batches

Strategies List<Pulumi.SpotInst.Aws.Inputs.BeanstalkDeploymentPreferencesStrategyArgs>

Strategy parameters

AutomaticRoll bool

Should roll perform automatically

BatchSizePercentage int

Percent size of each batch

GracePeriod int

Amount of time to wait between batches

Strategies []BeanstalkDeploymentPreferencesStrategy

Strategy parameters

automaticRoll boolean

Should roll perform automatically

batchSizePercentage number

Percent size of each batch

gracePeriod number

Amount of time to wait between batches

strategies BeanstalkDeploymentPreferencesStrategy[]

Strategy parameters

automaticRoll bool

Should roll perform automatically

batchSizePercentage float

Percent size of each batch

grace_period float

Amount of time to wait between batches

strategies List[BeanstalkDeploymentPreferencesStrategy]

Strategy parameters

BeanstalkDeploymentPreferencesStrategy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Action string

Action to take

ShouldDrainInstances bool

Bool value if to wait to drain instance

Action string

Action to take

ShouldDrainInstances bool

Bool value if to wait to drain instance

action string

Action to take

shouldDrainInstances boolean

Bool value if to wait to drain instance

action str

Action to take

shouldDrainInstances bool

Bool value if to wait to drain instance

BeanstalkManagedActions

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

PlatformUpdate Pulumi.SpotInst.Aws.Inputs.BeanstalkManagedActionsPlatformUpdateArgs

Platform Update parameters

PlatformUpdate BeanstalkManagedActionsPlatformUpdate

Platform Update parameters

platformUpdate BeanstalkManagedActionsPlatformUpdate

Platform Update parameters

platformUpdate Dict[BeanstalkManagedActionsPlatformUpdate]

Platform Update parameters

BeanstalkManagedActionsPlatformUpdate

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

PerformAt string

Actions to perform (options: timeWindow, never)

TimeWindow string

Time Window for when action occurs ex. Mon:23:50-Tue:00:20

UpdateLevel string
  • Level to update
PerformAt string

Actions to perform (options: timeWindow, never)

TimeWindow string

Time Window for when action occurs ex. Mon:23:50-Tue:00:20

UpdateLevel string
  • Level to update
performAt string

Actions to perform (options: timeWindow, never)

timeWindow string

Time Window for when action occurs ex. Mon:23:50-Tue:00:20

updateLevel string
  • Level to update
performAt str

Actions to perform (options: timeWindow, never)

timeWindow str

Time Window for when action occurs ex. Mon:23:50-Tue:00:20

updateLevel str
  • Level to update

BeanstalkScheduledTask

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

TaskType string
Adjustment string
AdjustmentPercentage string
BatchSizePercentage string

Percent size of each batch

CronExpression string
Frequency string
GracePeriod string

Amount of time to wait between batches

IsEnabled bool
MaxCapacity string
MinCapacity string
ScaleMaxCapacity string
ScaleMinCapacity string
ScaleTargetCapacity string
StartTime string
TargetCapacity string
TaskType string
Adjustment string
AdjustmentPercentage string
BatchSizePercentage string

Percent size of each batch

CronExpression string
Frequency string
GracePeriod string

Amount of time to wait between batches

IsEnabled bool
MaxCapacity string
MinCapacity string
ScaleMaxCapacity string
ScaleMinCapacity string
ScaleTargetCapacity string
StartTime string
TargetCapacity string
taskType string
adjustment string
adjustmentPercentage string
batchSizePercentage string

Percent size of each batch

cronExpression string
frequency string
gracePeriod string

Amount of time to wait between batches

isEnabled boolean
maxCapacity string
minCapacity string
scaleMaxCapacity string
scaleMinCapacity string
scaleTargetCapacity string
startTime string
targetCapacity string
taskType str
adjustment str
adjustmentPercentage str
batchSizePercentage str

Percent size of each batch

cronExpression str
frequency str
grace_period str

Amount of time to wait between batches

isEnabled bool
maxCapacity str
minCapacity str
scaleMaxCapacity str
scaleMinCapacity str
scaleTargetCapacity str
startTime str
targetCapacity str

Package Details

Repository
https://github.com/pulumi/pulumi-spotinst
License
Apache-2.0
Notes
This Pulumi package is based on the spotinst Terraform Provider.