Show / Hide Table of Contents

Namespace Pulumi.SpotInst.Aws

Classes

Beanstalk

Provides a Spotinst AWS group resource using Elastic Beanstalk.

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",
    });
}

}

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:

using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

BeanstalkArgs

BeanstalkState

Elastigroup

ElastigroupArgs

ElastigroupState

ManagedInstance

Provides a Spotinst AWS ManagedInstance resource.

Network Interface - (Optional) List of network interfaces in an EC2 instance.

  • device_index - (Optional) The position of the network interface in the attachment order. A primary network interface has a device index of 0. If you specify a network interface when launching an instance, you must specify the device index.
  • associate_public_ip_address - (Optional) Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true.
  • associate_ipv6_address - (Optional) Indicates whether to assign an IPv6 address. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. Default: false

Usage:

using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

<a id="scheduled-task"></a>

Scheduled Tasks

Each scheduled_task supports the following:

  • is_enabled - (Optional) Describes whether the task is enabled. When true the task should run when false it should not run.
  • frequency - (Optional) Set frequency for the task. Valid values: "hourly", "daily", "weekly", "continuous".
  • start_time - (Optional) DATETIME in ISO-8601 format. Sets a start time for scheduled actions. If "frequency" or "cronExpression" are not used - the task will run only once at the start time and will then be deleted from the instance configuration. Example: 2019-05-23T10:55:09Z
  • cron_expression - (Optional) A valid cron expression. For example : " * * * * * ". The cron is running in UTC time zone and is in Unix cron format Cron Expression Validator Script. Only one of ‘frequency’ or ‘cronExpression’ should be used at a time. Example: 0 1 * * *
  • task_type- (Required) The task type to run. Valid Values: "pause", "resume", "recycle".

Usage:

using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

<a id="load-balancers"></a>

Load Balancers

  • loadBalancersConfig - (Optional) LB integration object.
    • load_balancers - (Optional) List of load balancers configs. * name - The AWS resource name. Required for Classic Load Balancer. Optional for Application Load Balancer. * arn - The AWS resource ARN (Required only for ALB target groups). * balancer_id - The Multai load balancer ID. Default: lb-123456 * target_set_id - The Multai load target set ID. Default: ts-123456 * auto_weight - “Auto Weight” will automatically provide a higher weight for instances that are larger as appropriate. For example, if you have configured your Elastigroup with m4.large and m4.xlarge instances the m4.large will have half the weight of an m4.xlarge. This ensures that larger instances receive a higher number of MLB requests. * zone_awareness - “AZ Awareness” will ensure that instances within the same AZ are using the corresponding MLB runtime instance in the same AZ. This feature reduces multi-zone data transfer fees. * type - The resource type. Valid Values: CLASSIC, TARGET_GROUP, MULTAI_TARGET_SET.

Usage:

load_balancers {
   arn  = &quot;arn&quot;
   type = &quot;CLASSIC&quot;
   balancer_id   = &quot;lb-123&quot;
   target_set_id = &quot;ts-123&quot;
   auto_weight   = &quot;true&quot;
   az_awareness = &quot;true&quot;
 }

<a id="route53"></a>

ManagedInstanceArgs

ManagedInstanceState

MrScalar

MrScalarArgs

MrScalarState

Ocean

Provides a Spotinst Ocean AWS resource.

Example Usage

using Pulumi;
using SpotInst = Pulumi.SpotInst;

class MyStack : Stack
{
public MyStack()
{
    var example = new SpotInst.Aws.Ocean(&quot;example&quot;, new SpotInst.Aws.OceanArgs
    {
        AssociatePublicIpAddress = true,
        ControllerId = &quot;fakeClusterId&quot;,
        DesiredCapacity = 2,
        DrainingTimeout = 120,
        EbsOptimized = true,
        FallbackToOndemand = true,
        GracePeriod = 600,
        IamInstanceProfile = &quot;iam-profile&quot;,
        ImageId = &quot;ami-123456&quot;,
        KeyName = &quot;fake key&quot;,
        LoadBalancers = 
        {
            new SpotInst.Aws.Inputs.OceanLoadBalancerArgs
            {
                Arn = &quot;arn:aws:elasticloadbalancing:us-west-2:fake-arn&quot;,
                Type = &quot;TARGET_GROUP&quot;,
            },
            new SpotInst.Aws.Inputs.OceanLoadBalancerArgs
            {
                Name = &quot;AntonK&quot;,
                Type = &quot;CLASSIC&quot;,
            },
        },
        MaxSize = 2,
        MinSize = 1,
        Monitoring = true,
        Region = &quot;us-west-2&quot;,
        RootVolumeSize = 20,
        SecurityGroups = 
        {
            &quot;sg-987654321&quot;,
        },
        SubnetIds = 
        {
            &quot;subnet-123456789&quot;,
        },
        Tags = 
        {
            new SpotInst.Aws.Inputs.OceanTagArgs
            {
                Key = &quot;fakeKey&quot;,
                Value = &quot;fakeValue&quot;,
            },
        },
        UserData = &quot;echo hello world&quot;,
        UtilizeReservedInstances = false,
        Whitelists = 
        {
            &quot;t1.micro&quot;,
            &quot;m1.small&quot;,
        },
    });
}

}

Auto Scaler

  • autoscaler - (Optional) Describes the Ocean Kubernetes autoscaler.
  • autoscale_is_enabled - (Optional, Default: true) Enable the Ocean Kubernetes autoscaler.
  • autoscale_is_auto_config - (Optional, Default: true) Automatically configure and optimize headroom resources.
  • autoscale_cooldown - (Optional, Default: null) Cooldown period between scaling actions.
  • auto_headroom_percentage - (Optional) Set the auto headroom percentage (a number in the range [0, 200]) which controls the percentage of headroom from the cluster. Relevant only when isAutoConfig toggled on.
  • autoscale_headroom - (Optional) Spare resource capacity management enabling fast assignment of Pods without waiting for new resources to launch.
  • cpu_per_unit - (Optional) Optionally configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU.
  • gpu_per_unit - (Optional) Optionally configure the number of GPUS to allocate the headroom.
  • memory_per_unit - (Optional) Optionally configure the amount of memory (MB) to allocate the headroom.
  • num_of_units - (Optional) The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.
  • autoscale_down - (Optional) Auto Scaling scale down operations.
  • max_scale_down_percentage - (Optional) Would represent the maximum % to scale-down. Number between 1-100.
  • resource_limits - (Optional) Optionally set upper and lower bounds on the resource usage of the cluster.
  • max_vcpu - (Optional) The maximum cpu in vCPU units that can be allocated to the cluster.
  • max_memory_gib - (Optional) The maximum memory in GiB units that can be allocated to the cluster.
using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

<a id="update-policy"></a>

Update Policy

  • update_policy - (Optional)
  • should_roll - (Required) Enables the roll.
  • roll_config - (Required) While used, you can control whether the group should perform a deployment after an update to the configuration.
    • batch_size_percentage - (Required) Sets the percentage of the instances to deploy in each batch.
using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

<a id="scheduled-task"></a>

scheduled task

  • scheduled_task - (Optional) Set scheduling object.
  • shutdown_hours - (Optional) Set shutdown hours for cluster object.
    • is_enabled - (Optional) Flag to enable / disable the shutdown hours. Example: True
    • time_windows - (Required) Set time windows for shutdown hours. specify a list of 'timeWindows' with at least one time window Each string is in the format of - ddd:hh:mm-ddd:hh:mm ddd = day of week = Sun | Mon | Tue | Wed | Thu | Fri | Sat hh = hour 24 = 0 -23 mm = minute = 0 - 59. Time windows should not overlap. required on cluster.scheduling.isEnabled = True. API Times are in UTC Example: Fri:15:30-Wed:14:30
  • tasks - (Optional) The scheduling tasks for the cluster.
    • is_enabled - (Required) Describes whether the task is enabled. When true the task should run when false it should not run. Required for cluster.scheduling.tasks object.
    • cron_expression - (Required) A valid cron expression. For example : " * * * * * ".The cron is running in UTC time zone and is in Unix cron format Cron Expression Validator Script. Only one of ‘frequency’ or ‘cronExpression’ should be used at a time. Required for cluster.scheduling.tasks object Example: 0 1 * * *
    • task_type - (Required) Valid values: "clusterRoll". Required for cluster.scheduling.tasks object Example: clusterRoll
using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

OceanArgs

OceanLaunchSpec

Provides a custom Spotinst Ocean AWS Launch Spec resource.

Example Usage

using Pulumi;
using SpotInst = Pulumi.SpotInst;

class MyStack : Stack
{
public MyStack()
{
    var example = new SpotInst.Aws.OceanLaunchSpec(&quot;example&quot;, new SpotInst.Aws.OceanLaunchSpecArgs
    {
        AutoscaleHeadrooms = 
        {
            new SpotInst.Aws.Inputs.OceanLaunchSpecAutoscaleHeadroomArgs
            {
                CpuPerUnit = 1000,
                GpuPerUnit = 0,
                MemoryPerUnit = 2048,
                NumOfUnits = 5,
            },
        },
        ElasticIpPools = 
        {
            new SpotInst.Aws.Inputs.OceanLaunchSpecElasticIpPoolArgs
            {
                TagSelector = new SpotInst.Aws.Inputs.OceanLaunchSpecElasticIpPoolTagSelectorArgs
                {
                    TagKey = &quot;key&quot;,
                    TagValue = &quot;value&quot;,
                },
            },
        },
        IamInstanceProfile = &quot;iam-profile&quot;,
        ImageId = &quot;ami-123456&quot;,
        Labels = 
        {
            new SpotInst.Aws.Inputs.OceanLaunchSpecLabelArgs
            {
                Key = &quot;fakeKey&quot;,
                Value = &quot;fakeValue&quot;,
            },
        },
        OceanId = &quot;o-123456&quot;,
        RootVolumeSize = 30,
        SecurityGroups = 
        {
            &quot;sg-987654321&quot;,
        },
        SubnetIds = 
        {
            &quot;subnet-1234&quot;,
        },
        Tags = 
        {
            new SpotInst.Aws.Inputs.OceanLaunchSpecTagArgs
            {
                Key = &quot;Env&quot;,
                Value = &quot;production&quot;,
            },
        },
        Taints = 
        {
            new SpotInst.Aws.Inputs.OceanLaunchSpecTaintArgs
            {
                Effect = &quot;NoExecute&quot;,
                Key = &quot;taint key updated&quot;,
                Value = &quot;taint value updated&quot;,
            },
        },
        UserData = &quot;echo hello world&quot;,
    });
}

}

OceanLaunchSpecArgs

OceanLaunchSpecState

OceanState

Back to top Copyright 2016-2020, Pulumi Corporation.