This page documents the language specification for the spotinst package. If you're looking for help working with the inputs, outputs, or functions of spotinst resources in a Pulumi program, please see the resource documentation for examples and API reference.

azure

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-spotinst repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-spotinst repo.

class pulumi_spotinst.azure.Elastigroup(resource_name, opts=None, custom_data=None, desired_capacity=None, health_check=None, images=None, integration_kubernetes=None, integration_multai_runtime=None, load_balancers=None, login=None, low_priority_sizes=None, managed_service_identities=None, max_size=None, min_size=None, name=None, network=None, od_sizes=None, product=None, region=None, resource_group_name=None, scaling_down_policies=None, scaling_up_policies=None, scheduled_tasks=None, shutdown_script=None, strategy=None, update_policy=None, user_data=None, __props__=None, __name__=None, __opts__=None)

Provides a Spotinst elastigroup Azure resource.

import pulumi
import pulumi_spotinst as spotinst

test_azure_group = spotinst.azure.Elastigroup("testAzureGroup",
    desired_capacity=1,
    health_check={
        "auto_healing": True,
        "grace_period": 120,
        "health_check_type": "INSTANCE_STATE",
    },
    images=[{
        "marketplace": [{
            "offer": "UbuntuServer",
            "publisher": "Canonical",
            "sku": "16.04-LTS",
        }],
    }],
    load_balancers=[{
        "autoWeight": True,
        "balancer_id": "lb-1ee2e3q",
        "target_set_id": "ts-3eq",
        "type": "MULTAI_TARGET_SET",
    }],
    login={
        "sshPublicKey": "33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==",
        "userName": "admin",
    },
    low_priority_sizes=[
        "standard_a1_v1",
        "standard_a1_v2",
    ],
    managed_service_identities=[{
        "name": "example-identity",
        "resource_group_name": "spotinst-azure",
    }],
    max_size=1,
    min_size=0,
    network={
        "assignPublicIp": True,
        "resource_group_name": "subnetResourceGroup",
        "subnetName": "my-subnet-name",
        "virtualNetworkName": "vname",
    },
    od_sizes=[
        "standard_a1_v1",
        "standard_a1_v2",
    ],
    product="Linux",
    region="eastus",
    resource_group_name="spotinst-azure",
    scaling_down_policies=[{
        "actionType": "adjustment",
        "adjustment": "MIN(5,10)",
        "cooldown": 60,
        "dimensions": [{
            "name": "name-1",
            "value": "value-1",
        }],
        "evaluationPeriods": "10",
        "metricName": "CPUUtilization",
        "namespace": "Microsoft.Compute",
        "operator": "gt",
        "period": "60",
        "policyName": "policy-name",
        "statistic": "average",
        "threshold": 10,
        "unit": "percent",
    }],
    scaling_up_policies=[{
        "actionType": "setMinTarget",
        "cooldown": 60,
        "dimensions": [
            {
                "name": "resourceName",
                "value": "resource-name",
            },
            {
                "name": "resourceGroupName",
                "value": "resource-group-name",
            },
        ],
        "evaluationPeriods": "10",
        "metricName": "CPUUtilization",
        "minTargetCapacity": 1,
        "namespace": "Microsoft.Compute",
        "operator": "gt",
        "period": "60",
        "policyName": "policy-name",
        "statistic": "average",
        "threshold": 10,
        "unit": "percent",
    }],
    scheduled_tasks=[{
        "adjustment": 2,
        "adjustmentPercentage": 50,
        "batchSizePercentage": 33,
        "cronExpression": "* * * * *",
        "grace_period": 300,
        "isEnabled": True,
        "scaleMaxCapacity": 8,
        "scaleMinCapacity": 5,
        "scaleTargetCapacity": 6,
        "taskType": "scale",
    }],
    shutdown_script="",
    strategy={
        "draining_timeout": 300,
        "odCount": 1,
    },
    user_data="")
  • load_balancers - (Required) Describes a set of one or more classic load balancer target groups and/or Multai load balancer target sets.

  • type - (Required) The resource type. Valid values: CLASSIC, TARGET_GROUP, MULTAI_TARGET_SET.

  • balancer_id - (Required) The balancer ID.

  • target_set_id - (Required) The scale set ID associated with the load balancer.

  • auto_weight - (Optional, Default: false)

import pulumi

  • image - (Required) Image of a VM. An image is a template for creating new VMs. Choose from Azure image catalogue (marketplace) or use a custom image.

  • publisher - (Optional) Image publisher. Required if resource_group_name is not specified.

  • offer - (Optional) Name of the image to use. Required if publisher is specified.

  • sku - (Optional) Image’s Stock Keeping Unit, which is the specific version of the image. Required if publisher is specified.

  • resource_group_name - (Optional) Name of Resource Group for custom image. Required if publisher not specified.

  • image_name - (Optional) Name of the custom image. Required if resource_group_name is specified.

import pulumi

  • health_check - (Optional) Describes the health check configuration.

  • health_check_type - (Optional) Health check used to validate VM health. Valid values: “INSTANCE_STATE”.

  • grace_period - (Optional) Period of time (seconds) to wait for VM to reach healthiness before monitoring for unhealthiness.

  • auto_healing - (Optional) Enable auto-healing of unhealthy VMs.

import pulumi

  • network - (Required) Defines the Virtual Network and Subnet for your Elastigroup.

  • virtual_network_name - (Required) Name of Vnet.

  • subnet_name - (Required) ID of subnet.

  • resource_group_name - (Required) Vnet Resource Group Name.

  • assign_public_up - (Optional, Default: false) Assign a public IP to each VM in the Elastigroup.

  • additional_ip_configs - (Optional) Array of additional IP configuration objects.

  • name - (Required) The IP configuration name.

  • private_ip_version - (Optional) Available from Azure Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Valid values: IPv4, IPv6.

import pulumi

import pulumi

  • login - (Required) Describes the login configuration.

  • user_name - (Required) Set admin access for accessing your VMs.

  • ssh_public_key - (Optional) SSH for admin access to Linux VMs. Required for Linux product types.

  • password - (Optional) Password for admin access to Windows VMs. Required for Windows product types.

import pulumi

  • scheduled_task - (Optional) Describes the configuration of one or more scheduled tasks.

  • is_enabled - (Optional, Default: true) Describes whether the task is enabled. When true the task should run when false it should not run.

  • cron_expression - (Required) A valid cron expression (* * * * *). The cron is running in UTC time zone and is in Unix cron format Cron Expression Validator Script.

  • task_type - (Required) The task type to run. Valid Values: backup_ami, scale, scaleUp, roll, statefulUpdateCapacity, statefulRecycle.

  • scale_min_capacity - (Optional) The min capacity of the group. Should be used when choosing ‘task_type’ of ‘scale’.

  • scale_max_capacity - (Optional) The max capacity of the group. Required when ‘task_type’ is ‘scale’.

  • scale_target_capacity - (Optional) The target capacity of the group. Should be used when choosing ‘task_type’ of ‘scale’.

  • adjustment - (Optional) The number of instances to add/remove to/from the target capacity when scale is needed.

  • adjustment_percentage - (Optional) The percent of instances to add/remove to/from the target capacity when scale is needed.

  • batch_size_percentage - (Optional) The percentage size of each batch in the scheduled deployment roll. Required when the ‘task_type’ is ‘roll’.

  • grace_period - (Optional) The time to allow instances to become healthy.

import pulumi

  • update_policy - (Optional)

    • should_roll - (Required) Sets the enablement of the roll option.

    • 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.

      • health_check_type - (Optional) Sets the health check type to use. Valid values: "INSTANCE_STATE", "NONE".

      • grace_period - (Optional) Sets the grace period for new instances to become healthy.

import pulumi

  • integration_kubernetes - (Optional) Describes the Kubernetes integration.

    • cluster_identifier - (Required) The cluster ID.

Usage:

import pulumi
  • integration_multai_runtime - (Optional) Describes the Multai Runtime integration.

    • deployment_id - (Optional) The deployment id you want to get

Usage:

import pulumi
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • desired_capacity (pulumi.Input[float]) – The desired number of instances the group should have at any time.

  • low_priority_sizes (pulumi.Input[list]) – Available Low-Priority sizes.

  • max_size (pulumi.Input[float]) – The maximum number of instances the group should have at any time.

  • min_size (pulumi.Input[float]) – The minimum number of instances the group should have at any time.

  • name (pulumi.Input[str]) – The name of the managed identity.

  • od_sizes (pulumi.Input[list]) – Available On-Demand sizes

  • product (pulumi.Input[str]) – Operation system type. Valid values: "Linux", "Windows".

  • region (pulumi.Input[str]) – The region your Azure group will be created in.

  • resource_group_name (pulumi.Input[str]) – The Resource Group that the user-assigned managed identity resides in.

  • shutdown_script (pulumi.Input[str]) – Shutdown script for the group. Value should be passed as a string encoded at Base64 only.

  • strategy (pulumi.Input[dict]) – Describes the deployment strategy.

  • user_data (pulumi.Input[str]) – Base64-encoded MIME user data to make available to the instances.

The health_check object supports the following:

  • auto_healing (pulumi.Input[bool])

  • grace_period (pulumi.Input[float])

  • health_check_type (pulumi.Input[str])

The images object supports the following:

  • customs (pulumi.Input[list])

    • imageName (pulumi.Input[str])

    • resource_group_name (pulumi.Input[str]) - The Resource Group that the user-assigned managed identity resides in.

  • marketplaces (pulumi.Input[list])

    • offer (pulumi.Input[str])

    • publisher (pulumi.Input[str])

    • sku (pulumi.Input[str])

The integration_kubernetes object supports the following:

  • clusterIdentifier (pulumi.Input[str])

The integration_multai_runtime object supports the following:

  • deployment_id (pulumi.Input[str])

The load_balancers object supports the following:

  • autoWeight (pulumi.Input[bool])

  • balancer_id (pulumi.Input[str])

  • target_set_id (pulumi.Input[str])

  • type (pulumi.Input[str])

The login object supports the following:

  • password (pulumi.Input[str])

  • sshPublicKey (pulumi.Input[str])

  • userName (pulumi.Input[str])

The managed_service_identities object supports the following:

  • name (pulumi.Input[str]) - The name of the managed identity.

  • resource_group_name (pulumi.Input[str]) - The Resource Group that the user-assigned managed identity resides in.

The network object supports the following:

  • additionalIpConfigs (pulumi.Input[list])

    • name (pulumi.Input[str]) - The name of the managed identity.

    • privateIpVersion (pulumi.Input[str])

  • assignPublicIp (pulumi.Input[bool])

  • resource_group_name (pulumi.Input[str]) - The Resource Group that the user-assigned managed identity resides in.

  • subnetName (pulumi.Input[str])

  • virtualNetworkName (pulumi.Input[str])

The scaling_down_policies object supports the following:

  • actionType (pulumi.Input[str])

  • adjustment (pulumi.Input[str])

  • cooldown (pulumi.Input[float])

  • dimensions (pulumi.Input[list])

    • name (pulumi.Input[str]) - The name of the managed identity.

    • value (pulumi.Input[str])

  • evaluationPeriods (pulumi.Input[float])

  • maxTargetCapacity (pulumi.Input[str])

  • maximum (pulumi.Input[str])

  • metricName (pulumi.Input[str])

  • minTargetCapacity (pulumi.Input[str])

  • minimum (pulumi.Input[str])

  • namespace (pulumi.Input[str])

  • operator (pulumi.Input[str])

  • period (pulumi.Input[float])

  • policyName (pulumi.Input[str])

  • statistic (pulumi.Input[str])

  • target (pulumi.Input[str])

  • threshold (pulumi.Input[float])

  • unit (pulumi.Input[str])

The scaling_up_policies object supports the following:

  • actionType (pulumi.Input[str])

  • adjustment (pulumi.Input[str])

  • cooldown (pulumi.Input[float])

  • dimensions (pulumi.Input[list])

    • name (pulumi.Input[str]) - The name of the managed identity.

    • value (pulumi.Input[str])

  • evaluationPeriods (pulumi.Input[float])

  • maxTargetCapacity (pulumi.Input[str])

  • maximum (pulumi.Input[str])

  • metricName (pulumi.Input[str])

  • minTargetCapacity (pulumi.Input[str])

  • minimum (pulumi.Input[str])

  • namespace (pulumi.Input[str])

  • operator (pulumi.Input[str])

  • period (pulumi.Input[float])

  • policyName (pulumi.Input[str])

  • statistic (pulumi.Input[str])

  • target (pulumi.Input[str])

  • threshold (pulumi.Input[float])

  • unit (pulumi.Input[str])

The scheduled_tasks object supports the following:

  • adjustment (pulumi.Input[str])

  • adjustmentPercentage (pulumi.Input[str])

  • batchSizePercentage (pulumi.Input[str])

  • cronExpression (pulumi.Input[str])

  • grace_period (pulumi.Input[str])

  • isEnabled (pulumi.Input[bool])

  • scaleMaxCapacity (pulumi.Input[str])

  • scaleMinCapacity (pulumi.Input[str])

  • scaleTargetCapacity (pulumi.Input[str])

  • taskType (pulumi.Input[str])

The strategy object supports the following:

  • draining_timeout (pulumi.Input[float]) - Time (seconds) to allow the instance to be drained from incoming TCP connections and detached from MLB before terminating it during a scale-down operation.

  • lowPriorityPercentage (pulumi.Input[float]) - Percentage of Low Priority instances to maintain. Required if od_count is not specified.

  • odCount (pulumi.Input[float]) - Number of On-Demand instances to maintain. Required if low_priority_percentage is not specified.

The update_policy object supports the following:

  • rollConfig (pulumi.Input[dict])

    • batchSizePercentage (pulumi.Input[float])

    • grace_period (pulumi.Input[float])

    • health_check_type (pulumi.Input[str])

  • shouldRoll (pulumi.Input[bool])

desired_capacity: pulumi.Output[float] = None

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

low_priority_sizes: pulumi.Output[list] = None

Available Low-Priority sizes.

max_size: pulumi.Output[float] = None

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

min_size: pulumi.Output[float] = None

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

name: pulumi.Output[str] = None

The name of the managed identity.

od_sizes: pulumi.Output[list] = None

Available On-Demand sizes

product: pulumi.Output[str] = None

Operation system type. Valid values: "Linux", "Windows".

region: pulumi.Output[str] = None

The region your Azure group will be created in.

resource_group_name: pulumi.Output[str] = None

The Resource Group that the user-assigned managed identity resides in.

shutdown_script: pulumi.Output[str] = None

Shutdown script for the group. Value should be passed as a string encoded at Base64 only.

strategy: pulumi.Output[dict] = None

Describes the deployment strategy.

  • draining_timeout (float) - Time (seconds) to allow the instance to be drained from incoming TCP connections and detached from MLB before terminating it during a scale-down operation.

  • lowPriorityPercentage (float) - Percentage of Low Priority instances to maintain. Required if od_count is not specified.

  • odCount (float) - Number of On-Demand instances to maintain. Required if low_priority_percentage is not specified.

user_data: pulumi.Output[str] = None

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

static get(resource_name, id, opts=None, custom_data=None, desired_capacity=None, health_check=None, images=None, integration_kubernetes=None, integration_multai_runtime=None, load_balancers=None, login=None, low_priority_sizes=None, managed_service_identities=None, max_size=None, min_size=None, name=None, network=None, od_sizes=None, product=None, region=None, resource_group_name=None, scaling_down_policies=None, scaling_up_policies=None, scheduled_tasks=None, shutdown_script=None, strategy=None, update_policy=None, user_data=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • desired_capacity (pulumi.Input[float]) – The desired number of instances the group should have at any time.

  • low_priority_sizes (pulumi.Input[list]) – Available Low-Priority sizes.

  • max_size (pulumi.Input[float]) – The maximum number of instances the group should have at any time.

  • min_size (pulumi.Input[float]) – The minimum number of instances the group should have at any time.

  • name (pulumi.Input[str]) – The name of the managed identity.

  • od_sizes (pulumi.Input[list]) – Available On-Demand sizes

  • product (pulumi.Input[str]) – Operation system type. Valid values: "Linux", "Windows".

  • region (pulumi.Input[str]) – The region your Azure group will be created in.

  • resource_group_name (pulumi.Input[str]) – The Resource Group that the user-assigned managed identity resides in.

  • shutdown_script (pulumi.Input[str]) – Shutdown script for the group. Value should be passed as a string encoded at Base64 only.

  • strategy (pulumi.Input[dict]) – Describes the deployment strategy.

  • user_data (pulumi.Input[str]) – Base64-encoded MIME user data to make available to the instances.

The health_check object supports the following:

  • auto_healing (pulumi.Input[bool])

  • grace_period (pulumi.Input[float])

  • health_check_type (pulumi.Input[str])

The images object supports the following:

  • customs (pulumi.Input[list])

    • imageName (pulumi.Input[str])

    • resource_group_name (pulumi.Input[str]) - The Resource Group that the user-assigned managed identity resides in.

  • marketplaces (pulumi.Input[list])

    • offer (pulumi.Input[str])

    • publisher (pulumi.Input[str])

    • sku (pulumi.Input[str])

The integration_kubernetes object supports the following:

  • clusterIdentifier (pulumi.Input[str])

The integration_multai_runtime object supports the following:

  • deployment_id (pulumi.Input[str])

The load_balancers object supports the following:

  • autoWeight (pulumi.Input[bool])

  • balancer_id (pulumi.Input[str])

  • target_set_id (pulumi.Input[str])

  • type (pulumi.Input[str])

The login object supports the following:

  • password (pulumi.Input[str])

  • sshPublicKey (pulumi.Input[str])

  • userName (pulumi.Input[str])

The managed_service_identities object supports the following:

  • name (pulumi.Input[str]) - The name of the managed identity.

  • resource_group_name (pulumi.Input[str]) - The Resource Group that the user-assigned managed identity resides in.

The network object supports the following:

  • additionalIpConfigs (pulumi.Input[list])

    • name (pulumi.Input[str]) - The name of the managed identity.

    • privateIpVersion (pulumi.Input[str])

  • assignPublicIp (pulumi.Input[bool])

  • resource_group_name (pulumi.Input[str]) - The Resource Group that the user-assigned managed identity resides in.

  • subnetName (pulumi.Input[str])

  • virtualNetworkName (pulumi.Input[str])

The scaling_down_policies object supports the following:

  • actionType (pulumi.Input[str])

  • adjustment (pulumi.Input[str])

  • cooldown (pulumi.Input[float])

  • dimensions (pulumi.Input[list])

    • name (pulumi.Input[str]) - The name of the managed identity.

    • value (pulumi.Input[str])

  • evaluationPeriods (pulumi.Input[float])

  • maxTargetCapacity (pulumi.Input[str])

  • maximum (pulumi.Input[str])

  • metricName (pulumi.Input[str])

  • minTargetCapacity (pulumi.Input[str])

  • minimum (pulumi.Input[str])

  • namespace (pulumi.Input[str])

  • operator (pulumi.Input[str])

  • period (pulumi.Input[float])

  • policyName (pulumi.Input[str])

  • statistic (pulumi.Input[str])

  • target (pulumi.Input[str])

  • threshold (pulumi.Input[float])

  • unit (pulumi.Input[str])

The scaling_up_policies object supports the following:

  • actionType (pulumi.Input[str])

  • adjustment (pulumi.Input[str])

  • cooldown (pulumi.Input[float])

  • dimensions (pulumi.Input[list])

    • name (pulumi.Input[str]) - The name of the managed identity.

    • value (pulumi.Input[str])

  • evaluationPeriods (pulumi.Input[float])

  • maxTargetCapacity (pulumi.Input[str])

  • maximum (pulumi.Input[str])

  • metricName (pulumi.Input[str])

  • minTargetCapacity (pulumi.Input[str])

  • minimum (pulumi.Input[str])

  • namespace (pulumi.Input[str])

  • operator (pulumi.Input[str])

  • period (pulumi.Input[float])

  • policyName (pulumi.Input[str])

  • statistic (pulumi.Input[str])

  • target (pulumi.Input[str])

  • threshold (pulumi.Input[float])

  • unit (pulumi.Input[str])

The scheduled_tasks object supports the following:

  • adjustment (pulumi.Input[str])

  • adjustmentPercentage (pulumi.Input[str])

  • batchSizePercentage (pulumi.Input[str])

  • cronExpression (pulumi.Input[str])

  • grace_period (pulumi.Input[str])

  • isEnabled (pulumi.Input[bool])

  • scaleMaxCapacity (pulumi.Input[str])

  • scaleMinCapacity (pulumi.Input[str])

  • scaleTargetCapacity (pulumi.Input[str])

  • taskType (pulumi.Input[str])

The strategy object supports the following:

  • draining_timeout (pulumi.Input[float]) - Time (seconds) to allow the instance to be drained from incoming TCP connections and detached from MLB before terminating it during a scale-down operation.

  • lowPriorityPercentage (pulumi.Input[float]) - Percentage of Low Priority instances to maintain. Required if od_count is not specified.

  • odCount (pulumi.Input[float]) - Number of On-Demand instances to maintain. Required if low_priority_percentage is not specified.

The update_policy object supports the following:

  • rollConfig (pulumi.Input[dict])

    • batchSizePercentage (pulumi.Input[float])

    • grace_period (pulumi.Input[float])

    • health_check_type (pulumi.Input[str])

  • shouldRoll (pulumi.Input[bool])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str