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 usingfrequency) 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 usingcron_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 thetask_typeis"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 pulumiusing 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
new Beanstalk(name: string, args: BeanstalkArgs, opts?: CustomResourceOptions);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:
- Desired
Capacity int The desired number of instances the group should have at any time.
- Instance
Types List<string>Spots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- Max
Size int The maximum number of instances the group should have at any time.
- Min
Size 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.
- Beanstalk
Environment stringId The id of an existing Beanstalk environment.
- Beanstalk
Environment stringName The name of an existing Beanstalk environment.
- Deployment
Preferences Pulumi.Spot Inst. Aws. Inputs. Beanstalk Deployment Preferences Args Preferences when performing a roll
- Maintenance string
- Managed
Actions Pulumi.Spot Inst. Aws. Inputs. Beanstalk Managed Actions Args Managed Actions parameters
- Name string
The group name.
- Scheduled
Tasks List<Pulumi.Spot Inst. Aws. Inputs. Beanstalk Scheduled Task Args>
- Desired
Capacity int The desired number of instances the group should have at any time.
- Instance
Types []stringSpots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- Max
Size int The maximum number of instances the group should have at any time.
- Min
Size 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.
- Beanstalk
Environment stringId The id of an existing Beanstalk environment.
- Beanstalk
Environment stringName The name of an existing Beanstalk environment.
- Deployment
Preferences BeanstalkDeployment Preferences Preferences when performing a roll
- Maintenance string
- Managed
Actions BeanstalkManaged Actions Managed Actions parameters
- Name string
The group name.
- Scheduled
Tasks []BeanstalkScheduled Task
- desired
Capacity number The desired number of instances the group should have at any time.
- instance
Types string[]Spots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- max
Size number The maximum number of instances the group should have at any time.
- min
Size 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.
- beanstalk
Environment stringId The id of an existing Beanstalk environment.
- beanstalk
Environment stringName The name of an existing Beanstalk environment.
- deployment
Preferences BeanstalkDeployment Preferences Preferences when performing a roll
- maintenance string
- managed
Actions BeanstalkManaged Actions Managed Actions parameters
- name string
The group name.
- scheduled
Tasks BeanstalkScheduled Task[]
- desired_
capacity float The desired number of instances the group should have at any time.
- instance_
types_ List[str]spots 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_ strid The id of an existing Beanstalk environment.
- beanstalk_
environment_ strname The name of an existing Beanstalk environment.
- deployment_
preferences Dict[BeanstalkDeployment Preferences] Preferences when performing a roll
- maintenance str
- managed_
actions Dict[BeanstalkManaged Actions] Managed Actions parameters
- name str
The group name.
- scheduled_
tasks List[BeanstalkScheduled Task]
Outputs
All input properties are implicitly available as output properties. Additionally, the Beanstalk resource produces the following output properties:
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): Beanstalkstatic 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:
- Beanstalk
Environment stringId The id of an existing Beanstalk environment.
- Beanstalk
Environment stringName The name of an existing Beanstalk environment.
- Deployment
Preferences Pulumi.Spot Inst. Aws. Inputs. Beanstalk Deployment Preferences Args Preferences when performing a roll
- Desired
Capacity int The desired number of instances the group should have at any time.
- Instance
Types List<string>Spots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- Maintenance string
- Managed
Actions Pulumi.Spot Inst. Aws. Inputs. Beanstalk Managed Actions Args Managed Actions parameters
- Max
Size int The maximum number of instances the group should have at any time.
- Min
Size 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.
- Scheduled
Tasks List<Pulumi.Spot Inst. Aws. Inputs. Beanstalk Scheduled Task Args>
- Beanstalk
Environment stringId The id of an existing Beanstalk environment.
- Beanstalk
Environment stringName The name of an existing Beanstalk environment.
- Deployment
Preferences BeanstalkDeployment Preferences Preferences when performing a roll
- Desired
Capacity int The desired number of instances the group should have at any time.
- Instance
Types []stringSpots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- Maintenance string
- Managed
Actions BeanstalkManaged Actions Managed Actions parameters
- Max
Size int The maximum number of instances the group should have at any time.
- Min
Size 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.
- Scheduled
Tasks []BeanstalkScheduled Task
- beanstalk
Environment stringId The id of an existing Beanstalk environment.
- beanstalk
Environment stringName The name of an existing Beanstalk environment.
- deployment
Preferences BeanstalkDeployment Preferences Preferences when performing a roll
- desired
Capacity number The desired number of instances the group should have at any time.
- instance
Types string[]Spots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- maintenance string
- managed
Actions BeanstalkManaged Actions Managed Actions parameters
- max
Size number The maximum number of instances the group should have at any time.
- min
Size 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.
- scheduled
Tasks BeanstalkScheduled Task[]
- beanstalk_
environment_ strid The id of an existing Beanstalk environment.
- beanstalk_
environment_ strname The name of an existing Beanstalk environment.
- deployment_
preferences Dict[BeanstalkDeployment Preferences] Preferences when performing a roll
- desired_
capacity float The desired number of instances the group should have at any time.
- instance_
types_ List[str]spots One or more instance types. To maximize the availability of Spot instances, select as many instance types as possible.
- maintenance str
- managed_
actions Dict[BeanstalkManaged Actions] 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[BeanstalkScheduled Task]
Supporting Types
BeanstalkDeploymentPreferences
- Automatic
Roll bool Should roll perform automatically
- Batch
Size intPercentage Percent size of each batch
- Grace
Period int Amount of time to wait between batches
- Strategies
List<Pulumi.
Spot Inst. Aws. Inputs. Beanstalk Deployment Preferences Strategy Args> Strategy parameters
- Automatic
Roll bool Should roll perform automatically
- Batch
Size intPercentage Percent size of each batch
- Grace
Period int Amount of time to wait between batches
- Strategies
[]Beanstalk
Deployment Preferences Strategy Strategy parameters
- automatic
Roll boolean Should roll perform automatically
- batch
Size numberPercentage Percent size of each batch
- grace
Period number Amount of time to wait between batches
- strategies
Beanstalk
Deployment Preferences Strategy[] Strategy parameters
- automatic
Roll bool Should roll perform automatically
- batch
Size floatPercentage Percent size of each batch
- grace_
period float Amount of time to wait between batches
- strategies
List[Beanstalk
Deployment Preferences Strategy] Strategy parameters
BeanstalkDeploymentPreferencesStrategy
- Action string
Action to take
- Should
Drain boolInstances Bool value if to wait to drain instance
- Action string
Action to take
- Should
Drain boolInstances Bool value if to wait to drain instance
- action string
Action to take
- should
Drain booleanInstances Bool value if to wait to drain instance
- action str
Action to take
- should
Drain boolInstances Bool value if to wait to drain instance
BeanstalkManagedActions
- Platform
Update Pulumi.Spot Inst. Aws. Inputs. Beanstalk Managed Actions Platform Update Args Platform Update parameters
- Platform
Update BeanstalkManaged Actions Platform Update Platform Update parameters
- platform
Update BeanstalkManaged Actions Platform Update Platform Update parameters
- platform
Update Dict[BeanstalkManaged Actions Platform Update] Platform Update parameters
BeanstalkManagedActionsPlatformUpdate
- Perform
At string Actions to perform (options: timeWindow, never)
- Time
Window string Time Window for when action occurs ex. Mon:23:50-Tue:00:20
- Update
Level string - Level to update
- Perform
At string Actions to perform (options: timeWindow, never)
- Time
Window string Time Window for when action occurs ex. Mon:23:50-Tue:00:20
- Update
Level string - Level to update
- perform
At string Actions to perform (options: timeWindow, never)
- time
Window string Time Window for when action occurs ex. Mon:23:50-Tue:00:20
- update
Level string - Level to update
- perform
At str Actions to perform (options: timeWindow, never)
- time
Window str Time Window for when action occurs ex. Mon:23:50-Tue:00:20
- update
Level str - Level to update
BeanstalkScheduledTask
- Task
Type string - Adjustment string
- Adjustment
Percentage string - Batch
Size stringPercentage Percent size of each batch
- Cron
Expression string - Frequency string
- Grace
Period string Amount of time to wait between batches
- Is
Enabled bool - Max
Capacity string - Min
Capacity string - Scale
Max stringCapacity - Scale
Min stringCapacity - Scale
Target stringCapacity - Start
Time string - Target
Capacity string
- Task
Type string - Adjustment string
- Adjustment
Percentage string - Batch
Size stringPercentage Percent size of each batch
- Cron
Expression string - Frequency string
- Grace
Period string Amount of time to wait between batches
- Is
Enabled bool - Max
Capacity string - Min
Capacity string - Scale
Max stringCapacity - Scale
Min stringCapacity - Scale
Target stringCapacity - Start
Time string - Target
Capacity string
- task
Type string - adjustment string
- adjustment
Percentage string - batch
Size stringPercentage Percent size of each batch
- cron
Expression string - frequency string
- grace
Period string Amount of time to wait between batches
- is
Enabled boolean - max
Capacity string - min
Capacity string - scale
Max stringCapacity - scale
Min stringCapacity - scale
Target stringCapacity - start
Time string - target
Capacity string
- task
Type str - adjustment str
- adjustment
Percentage str - batch
Size strPercentage Percent size of each batch
- cron
Expression str - frequency str
- grace_
period str Amount of time to wait between batches
- is
Enabled bool - max
Capacity str - min
Capacity str - scale
Max strCapacity - scale
Min strCapacity - scale
Target strCapacity - start
Time str - target
Capacity str
Package Details
- Repository
- https://github.com/pulumi/pulumi-spotinst
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
spotinstTerraform Provider.