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

Resources

Others

Resources

Resource Elastigroup

class Elastigroup extends CustomResource

Provides a Spotinst elastigroup Azure resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as spotinst from "@pulumi/spotinst";

const testAzureGroup = new spotinst.azure.Elastigroup("testAzureGroup", {
    desiredCapacity: 1,
    // --- HEALTH-CHECKS -------------------------------------------------
    healthCheck: {
        autoHealing: true,
        gracePeriod: 120,
        healthCheckType: "INSTANCE_STATE",
    },
    // --- IMAGE ---------------------------------------------------------
    images: [{
        marketplaces: [{
            offer: "UbuntuServer",
            publisher: "Canonical",
            sku: "16.04-LTS",
        }],
    }],
    // --- LOAD BALANCERS ------------------------------------------------
    loadBalancers: [{
        autoWeight: true,
        balancerId: "lb-1ee2e3q",
        targetSetId: "ts-3eq",
        type: "MULTAI_TARGET_SET",
    }],
    // --- LOGIN ---------------------------------------------------------
    login: {
        sshPublicKey: "33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==",
        userName: "admin",
    },
    lowPrioritySizes: [
        "standardA1V1",
        "standardA1V2",
    ],
    managedServiceIdentities: [{
        name: "example-identity",
        resourceGroupName: "spotinst-azure",
    }],
    maxSize: 1,
    // --- CAPACITY ------------------------------------------------------
    minSize: 0,
    // --- NETWORK -------------------------------------------------------
    network: {
        assignPublicIp: true,
        resourceGroupName: "subnetResourceGroup",
        subnetName: "my-subnet-name",
        virtualNetworkName: "vname",
    },
    // --- INSTANCE TYPES ------------------------------------------------
    odSizes: [
        "standardA1V1",
        "standardA1V2",
    ],
    product: "Linux",
    region: "eastus",
    resourceGroupName: "spotinst-azure",
    scalingDownPolicies: [{
        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 POLICIES ----------------------------------------------
    scalingUpPolicies: [{
        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 TASK ------------------------------------------------
    scheduledTasks: [{
        adjustment: "2",
        adjustmentPercentage: "50",
        batchSizePercentage: "33",
        cronExpression: "* * * * *",
        gracePeriod: "300",
        isEnabled: true,
        scaleMaxCapacity: "8",
        scaleMinCapacity: "5",
        scaleTargetCapacity: "6",
        taskType: "scale",
    }],
    shutdownScript: "",
    // --- STRATEGY ------------------------------------------------------
    strategy: {
        drainingTimeout: 300,
        odCount: 1,
    },
    userData: "",
});

Load Balancers

  • loadBalancers - (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.
  • balancerId - (Required) The balancer ID.
  • targetSetId - (Required) The scale set ID associated with the load balancer.
  • autoWeight - (Optional, Default: false)
import * as pulumi from "@pulumi/pulumi";

Image

  • 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 resourceGroupName 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.
  • resourceGroupName - (Optional) Name of Resource Group for custom image. Required if publisher not specified.
  • imageName - (Optional) Name of the custom image. Required if resourceGroupName is specified.
import * as pulumi from "@pulumi/pulumi";

Health Check

  • healthCheck - (Optional) Describes the health check configuration.
  • healthCheckType - (Optional) Health check used to validate VM health. Valid values: “INSTANCE_STATE”.
  • gracePeriod - (Optional) Period of time (seconds) to wait for VM to reach healthiness before monitoring for unhealthiness.
  • autoHealing - (Optional) Enable auto-healing of unhealthy VMs.
import * as pulumi from "@pulumi/pulumi";

Network

  • network - (Required) Defines the Virtual Network and Subnet for your Elastigroup.
  • virtualNetworkName - (Required) Name of Vnet.
  • subnetName - (Required) ID of subnet.
  • resourceGroupName - (Required) Vnet Resource Group Name.
  • assignPublicUp - (Optional, Default: false) Assign a public IP to each VM in the Elastigroup.
  • additionalIpConfigs - (Optional) Array of additional IP configuration objects.
  • name - (Required) The IP configuration name.
  • privateIpVersion - (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 * as pulumi from "@pulumi/pulumi";

Login

import * as pulumi from "@pulumi/pulumi";

Login

  • login - (Required) Describes the login configuration.
  • userName - (Required) Set admin access for accessing your VMs.
  • sshPublicKey - (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 * as pulumi from "@pulumi/pulumi";

Scheduling

  • scheduledTask - (Optional) Describes the configuration of one or more scheduled tasks.
  • isEnabled - (Optional, Default: true) Describes whether the task is enabled. When true the task should run when false it should not run.
  • cronExpression - (Required) A valid cron expression (* * * * *). The cron is running in UTC time zone and is in Unix cron format Cron Expression Validator Script.
  • taskType - (Required) The task type to run. Valid Values: backupAmi, scale, scaleUp, roll, statefulUpdateCapacity, statefulRecycle.
  • scaleMinCapacity - (Optional) The min capacity of the group. Should be used when choosing ‘task_type’ of ‘scale’.
  • scaleMaxCapacity - (Optional) The max capacity of the group. Required when ‘task_type’ is ‘scale’.
  • scaleTargetCapacity - (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.
  • adjustmentPercentage - (Optional) The percent of instances to add/remove to/from the target capacity when scale is needed.
  • batchSizePercentage - (Optional) The percentage size of each batch in the scheduled deployment roll. Required when the ‘task_type’ is ‘roll’.
  • gracePeriod - (Optional) The time to allow instances to become healthy.
import * as pulumi from "@pulumi/pulumi";

Update Policy

  • updatePolicy - (Optional)

    • shouldRoll - (Required) Sets the enablement of the roll option.
    • rollConfig - (Required) While used, you can control whether the group should perform a deployment after an update to the configuration.
      • batchSizePercentage - (Required) Sets the percentage of the instances to deploy in each batch.
      • healthCheckType - (Optional) Sets the health check type to use. Valid values: "INSTANCE_STATE", "NONE".
      • gracePeriod - (Optional) Sets the grace period for new instances to become healthy.
import * as pulumi from "@pulumi/pulumi";

Third-Party Integrations

  • integrationKubernetes - (Optional) Describes the Kubernetes integration.
    • clusterIdentifier - (Required) The cluster ID.

Usage:

import * as pulumi from "@pulumi/pulumi";
  • integrationMultaiRuntime - (Optional) Describes the Multai Runtime integration.
    • deploymentId - (Optional) The deployment id you want to get

Usage:

import * as pulumi from "@pulumi/pulumi";

constructor

new Elastigroup(name: string, args: ElastigroupArgs, opts?: pulumi.CustomResourceOptions)

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

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ElastigroupState, opts?: pulumi.CustomResourceOptions): Elastigroup

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is Elastigroup

Returns true if the given object is an instance of Elastigroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property customData

public customData: pulumi.Output<string | undefined>;

property desiredCapacity

public desiredCapacity: pulumi.Output<number | undefined>;

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

property healthCheck

public healthCheck: pulumi.Output<ElastigroupHealthCheck | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property images

public images: pulumi.Output<ElastigroupImage[] | undefined>;

property integrationKubernetes

public integrationKubernetes: pulumi.Output<ElastigroupIntegrationKubernetes | undefined>;

property integrationMultaiRuntime

public integrationMultaiRuntime: pulumi.Output<ElastigroupIntegrationMultaiRuntime | undefined>;

property loadBalancers

public loadBalancers: pulumi.Output<ElastigroupLoadBalancer[] | undefined>;

property login

public login: pulumi.Output<ElastigroupLogin | undefined>;

property lowPrioritySizes

public lowPrioritySizes: pulumi.Output<string[]>;

Available Low-Priority sizes.

property managedServiceIdentities

public managedServiceIdentities: pulumi.Output<ElastigroupManagedServiceIdentity[] | undefined>;

property maxSize

public maxSize: pulumi.Output<number>;

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

property minSize

public minSize: pulumi.Output<number>;

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

property name

public name: pulumi.Output<string>;

The name of the managed identity.

property network

public network: pulumi.Output<ElastigroupNetwork>;

property odSizes

public odSizes: pulumi.Output<string[]>;

Available On-Demand sizes

property product

public product: pulumi.Output<string>;

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

property region

public region: pulumi.Output<string>;

The region your Azure group will be created in.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property scalingDownPolicies

public scalingDownPolicies: pulumi.Output<ElastigroupScalingDownPolicy[] | undefined>;

property scalingUpPolicies

public scalingUpPolicies: pulumi.Output<ElastigroupScalingUpPolicy[] | undefined>;

property scheduledTasks

public scheduledTasks: pulumi.Output<ElastigroupScheduledTask[] | undefined>;

property shutdownScript

public shutdownScript: pulumi.Output<string | undefined>;

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

property strategy

public strategy: pulumi.Output<ElastigroupStrategy>;

Describes the deployment strategy.

property updatePolicy

public updatePolicy: pulumi.Output<ElastigroupUpdatePolicy | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property userData

public userData: pulumi.Output<string | undefined>;

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

Others

interface ElastigroupArgs

interface ElastigroupArgs

The set of arguments for constructing a Elastigroup resource.

property customData

customData?: pulumi.Input<string>;

property desiredCapacity

desiredCapacity?: pulumi.Input<number>;

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

property healthCheck

healthCheck?: pulumi.Input<ElastigroupHealthCheck>;

property images

images?: pulumi.Input<pulumi.Input<ElastigroupImage>[]>;

property integrationKubernetes

integrationKubernetes?: pulumi.Input<ElastigroupIntegrationKubernetes>;

property integrationMultaiRuntime

integrationMultaiRuntime?: pulumi.Input<ElastigroupIntegrationMultaiRuntime>;

property loadBalancers

loadBalancers?: pulumi.Input<pulumi.Input<ElastigroupLoadBalancer>[]>;

property login

login?: pulumi.Input<ElastigroupLogin>;

property lowPrioritySizes

lowPrioritySizes: pulumi.Input<pulumi.Input<string>[]>;

Available Low-Priority sizes.

property managedServiceIdentities

managedServiceIdentities?: pulumi.Input<pulumi.Input<ElastigroupManagedServiceIdentity>[]>;

property maxSize

maxSize?: pulumi.Input<number>;

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

property minSize

minSize?: pulumi.Input<number>;

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

property name

name?: pulumi.Input<string>;

The name of the managed identity.

property network

network: pulumi.Input<ElastigroupNetwork>;

property odSizes

odSizes: pulumi.Input<pulumi.Input<string>[]>;

Available On-Demand sizes

property product

product: pulumi.Input<string>;

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

property region

region: pulumi.Input<string>;

The region your Azure group will be created in.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property scalingDownPolicies

scalingDownPolicies?: pulumi.Input<pulumi.Input<ElastigroupScalingDownPolicy>[]>;

property scalingUpPolicies

scalingUpPolicies?: pulumi.Input<pulumi.Input<ElastigroupScalingUpPolicy>[]>;

property scheduledTasks

scheduledTasks?: pulumi.Input<pulumi.Input<ElastigroupScheduledTask>[]>;

property shutdownScript

shutdownScript?: pulumi.Input<string>;

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

property strategy

strategy: pulumi.Input<ElastigroupStrategy>;

Describes the deployment strategy.

property updatePolicy

updatePolicy?: pulumi.Input<ElastigroupUpdatePolicy>;

property userData

userData?: pulumi.Input<string>;

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

interface ElastigroupState

interface ElastigroupState

Input properties used for looking up and filtering Elastigroup resources.

property customData

customData?: pulumi.Input<string>;

property desiredCapacity

desiredCapacity?: pulumi.Input<number>;

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

property healthCheck

healthCheck?: pulumi.Input<ElastigroupHealthCheck>;

property images

images?: pulumi.Input<pulumi.Input<ElastigroupImage>[]>;

property integrationKubernetes

integrationKubernetes?: pulumi.Input<ElastigroupIntegrationKubernetes>;

property integrationMultaiRuntime

integrationMultaiRuntime?: pulumi.Input<ElastigroupIntegrationMultaiRuntime>;

property loadBalancers

loadBalancers?: pulumi.Input<pulumi.Input<ElastigroupLoadBalancer>[]>;

property login

login?: pulumi.Input<ElastigroupLogin>;

property lowPrioritySizes

lowPrioritySizes?: pulumi.Input<pulumi.Input<string>[]>;

Available Low-Priority sizes.

property managedServiceIdentities

managedServiceIdentities?: pulumi.Input<pulumi.Input<ElastigroupManagedServiceIdentity>[]>;

property maxSize

maxSize?: pulumi.Input<number>;

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

property minSize

minSize?: pulumi.Input<number>;

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

property name

name?: pulumi.Input<string>;

The name of the managed identity.

property network

network?: pulumi.Input<ElastigroupNetwork>;

property odSizes

odSizes?: pulumi.Input<pulumi.Input<string>[]>;

Available On-Demand sizes

property product

product?: pulumi.Input<string>;

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

property region

region?: pulumi.Input<string>;

The region your Azure group will be created in.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property scalingDownPolicies

scalingDownPolicies?: pulumi.Input<pulumi.Input<ElastigroupScalingDownPolicy>[]>;

property scalingUpPolicies

scalingUpPolicies?: pulumi.Input<pulumi.Input<ElastigroupScalingUpPolicy>[]>;

property scheduledTasks

scheduledTasks?: pulumi.Input<pulumi.Input<ElastigroupScheduledTask>[]>;

property shutdownScript

shutdownScript?: pulumi.Input<string>;

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

property strategy

strategy?: pulumi.Input<ElastigroupStrategy>;

Describes the deployment strategy.

property updatePolicy

updatePolicy?: pulumi.Input<ElastigroupUpdatePolicy>;

property userData

userData?: pulumi.Input<string>;

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