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 whenisAutoConfigtoggled 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: Truetime_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()
{
}
}
Inherited Members
Namespace: Pulumi.SpotInst.Aws
Assembly: Pulumi.SpotInst.dll
Syntax
public class Ocean : CustomResource
Constructors
View SourceOcean(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 SourceAssociatePublicIpAddress
Configure public IP address allocation.
Declaration
public Output<bool?> AssociatePublicIpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Autoscaler
Declaration
public Output<OceanAutoscaler> Autoscaler { get; }
Property Value
| Type | Description |
|---|---|
| Output<OceanAutoscaler> |
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>> |
ControllerId
The ocean cluster identifier. Example: ocean.k8s
Declaration
public Output<string> ControllerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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>> |
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>> |
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>> |
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>> |
IamInstanceProfile
The instance profile iam role.
Declaration
public Output<string> IamInstanceProfile { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ImageId
ID of the image used to launch the instances.
Declaration
public Output<string> ImageId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KeyName
The key pair to attach the instances.
Declaration
public Output<string> KeyName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
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>> |
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> |
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>> |
Name
Required if type is set to CLASSIC
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The region the cluster will run in.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
ScheduledTasks
Declaration
public Output<ImmutableArray<OceanScheduledTask>> ScheduledTasks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<OceanScheduledTask>> |
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>> |
SpotPercentage
Declaration
public Output<double?> SpotPercentage { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Double>> |
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>> |
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>> |
UpdatePolicy
Declaration
public Output<OceanUpdatePolicy> UpdatePolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<OceanUpdatePolicy> |
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> |
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>> |
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 SourceGet(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 |