Show / Hide Table of Contents

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

}

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()
{
}

}
Inheritance
System.Object
Resource
CustomResource
Ocean
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.SpotInst.Aws
Assembly: Pulumi.SpotInst.dll
Syntax
public class Ocean : CustomResource

Constructors

View Source

Ocean(String, OceanArgs, CustomResourceOptions)

Create a Ocean resource with the given unique name, arguments, and options.

Declaration
public Ocean(string name, OceanArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

OceanArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AssociatePublicIpAddress

Configure public IP address allocation.

Declaration
public Output<bool?> AssociatePublicIpAddress { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Autoscaler

Declaration
public Output<OceanAutoscaler> Autoscaler { get; }
Property Value
Type Description
Output<OceanAutoscaler>
View Source

Blacklists

Instance types not allowed in the Ocean cluster. Cannot be configured if whitelist is configured.

Declaration
public Output<ImmutableArray<string>> Blacklists { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

ControllerId

The ocean cluster identifier. Example: ocean.k8s

Declaration
public Output<string> ControllerId { get; }
Property Value
Type Description
Output<System.String>
View Source

DesiredCapacity

The number of instances to launch and maintain in the cluster.

Declaration
public Output<int> DesiredCapacity { get; }
Property Value
Type Description
Output<System.Int32>
View Source

DrainingTimeout

The time in seconds, the instance is allowed to run while detached from the ELB. This is to allow the instance time to be drained from incoming TCP connections before terminating it, during a scale down operation.

Declaration
public Output<int?> DrainingTimeout { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

EbsOptimized

Enable EBS optimized for cluster. Flag will enable optimized capacity for high bandwidth connectivity to the EB service for non EBS optimized instance types. For instances that are EBS optimized this flag will be ignored.

Declaration
public Output<bool?> EbsOptimized { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

FallbackToOndemand

If not Spot instance markets are available, enable Ocean to launch On-Demand instances instead.

Declaration
public Output<bool?> FallbackToOndemand { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

GracePeriod

The amount of time, in seconds, after the instance has launched to start checking its health.

Declaration
public Output<int?> GracePeriod { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

IamInstanceProfile

The instance profile iam role.

Declaration
public Output<string> IamInstanceProfile { get; }
Property Value
Type Description
Output<System.String>
View Source

ImageId

ID of the image used to launch the instances.

Declaration
public Output<string> ImageId { get; }
Property Value
Type Description
Output<System.String>
View Source

KeyName

The key pair to attach the instances.

Declaration
public Output<string> KeyName { get; }
Property Value
Type Description
Output<System.String>
View Source

LoadBalancers

  • Array of load balancer objects to add to ocean cluster
Declaration
public Output<ImmutableArray<OceanLoadBalancer>> LoadBalancers { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<OceanLoadBalancer>>
View Source

MaxSize

The upper limit of instances the cluster can scale up to.

Declaration
public Output<int?> MaxSize { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MinSize

The lower limit of instances the cluster can scale down to.

Declaration
public Output<int> MinSize { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Monitoring

Enable detailed monitoring for cluster. Flag will enable Cloud Watch detailed detailed monitoring (one minute increments). Note: there are additional hourly costs for this service based on the region used.

Declaration
public Output<bool?> Monitoring { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Name

Required if type is set to CLASSIC

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Region

The region the cluster will run in.

Declaration
public Output<string> Region { get; }
Property Value
Type Description
Output<System.String>
View Source

RootVolumeSize

The size (in Gb) to allocate for the root volume. Minimum 20.

Declaration
public Output<int?> RootVolumeSize { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

ScheduledTasks

Declaration
public Output<ImmutableArray<OceanScheduledTask>> ScheduledTasks { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<OceanScheduledTask>>
View Source

SecurityGroups

One or more security group ids.

Declaration
public Output<ImmutableArray<string>> SecurityGroups { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

SpotPercentage

Declaration
public Output<double?> SpotPercentage { get; }
Property Value
Type Description
Output<System.Nullable<System.Double>>
View Source

SubnetIds

A comma-separated list of subnet identifiers for the Ocean cluster. Subnet IDs should be configured with auto assign public ip.

Declaration
public Output<ImmutableArray<string>> SubnetIds { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Tags

Optionally adds tags to instances launched in an Ocean cluster.

Declaration
public Output<ImmutableArray<OceanTag>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<OceanTag>>
View Source

UpdatePolicy

Declaration
public Output<OceanUpdatePolicy> UpdatePolicy { get; }
Property Value
Type Description
Output<OceanUpdatePolicy>
View Source

UserData

Base64-encoded MIME user data to make available to the instances.

Declaration
public Output<string> UserData { get; }
Property Value
Type Description
Output<System.String>
View Source

UtilizeReservedInstances

If Reserved instances exist, Ocean will utilize them before launching Spot instances.

Declaration
public Output<bool?> UtilizeReservedInstances { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Whitelists

Instance types allowed in the Ocean cluster. Cannot be configured if blacklist is configured.

Declaration
public Output<ImmutableArray<string>> Whitelists { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>

Methods

View Source

Get(String, Input<String>, OceanState, CustomResourceOptions)

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

Declaration
public static Ocean Get(string name, Input<string> id, OceanState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

OceanState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Ocean
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.