Show / Hide Table of Contents

Class AutoProvisioningGroup

Provides a ECS auto provisioning group resource which is a solution that uses preemptive instances and pay_as_you_go instances to rapidly deploy clusters.

NOTE: Available in 1.79.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var name = config.Get("name") ?? "auto_provisioning_group";
    var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
    {
        AvailableDiskCategory = "cloud_efficiency",
        AvailableResourceCreation = "VSwitch",
    }));
    var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
    {
        CidrBlock = "172.16.0.0/16",
    });
    var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
    {
        AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
        CidrBlock = "172.16.0.0/24",
        VpcId = defaultNetwork.Id,
    });
    var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new AliCloud.Ecs.SecurityGroupArgs
    {
        VpcId = defaultNetwork.Id,
    });
    var defaultImages = Output.Create(AliCloud.Ecs.GetImages.InvokeAsync(new AliCloud.Ecs.GetImagesArgs
    {
        MostRecent = true,
        NameRegex = "^ubuntu_18.*64",
        Owners = "system",
    }));
    var template = new AliCloud.Ecs.LaunchTemplate("template", new AliCloud.Ecs.LaunchTemplateArgs
    {
        ImageId = defaultImages.Apply(defaultImages => defaultImages.Images[0].Id),
        InstanceType = "ecs.n1.tiny",
        SecurityGroupId = defaultSecurityGroup.Id,
    });
    var defaultAutoProvisioningGroup = new AliCloud.Ecs.AutoProvisioningGroup("defaultAutoProvisioningGroup", new AliCloud.Ecs.AutoProvisioningGroupArgs
    {
        LaunchTemplateConfigs = 
        {
            new AliCloud.Ecs.Inputs.AutoProvisioningGroupLaunchTemplateConfigArgs
            {
                InstanceType = "ecs.n1.small",
                VswitchId = defaultSwitch.Id,
            },
        },
        LaunchTemplateId = template.Id,
        PayAsYouGoTargetCapacity = "1",
        SpotTargetCapacity = "2",
        TotalTargetCapacity = "4",
    });
}

}

Block config

The config mapping supports the following:

  • instance_type - (Optional) The instance type of the Nth extended configurations of the launch template.
  • max_price - (Required) The maximum price of the instance type specified in the Nth extended configurations of the launch template.
  • vswitch_id - (Required) The ID of the VSwitch in the Nth extended configurations of the launch template.
  • weighted_capacity - (Optional) The weight of the instance type specified in the Nth extended configurations of the launch template.
  • priority - (Optional) The priority of the instance type specified in the Nth extended configurations of the launch template. A value of 0 indicates the highest priority.
Inheritance
System.Object
Resource
CustomResource
AutoProvisioningGroup
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.AliCloud.Ecs
Assembly: Pulumi.AliCloud.dll
Syntax
public class AutoProvisioningGroup : CustomResource

Constructors

View Source

AutoProvisioningGroup(String, AutoProvisioningGroupArgs, CustomResourceOptions)

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

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

The unique name of the resource

AutoProvisioningGroupArgs 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

AutoProvisioningGroupName

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

AutoProvisioningGroupType

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

DefaultTargetCapacityType

The type of supplemental instances. When the total value of PayAsYouGoTargetCapacity and SpotTargetCapacity is smaller than the value of TotalTargetCapacity, the auto provisioning group will create instances of the specified type to meet the capacity requirements. Valid values:PayAsYouGo: Pay-as-you-go instances; Spot: Preemptible instances, Default value: Spot.

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

Description

The description of the auto provisioning group.

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

ExcessCapacityTerminationPolicy

The shutdown policy for excess preemptible instances followed when the capacity of the auto provisioning group exceeds the target capacity. Valid values: no-termination and termination,Default value: no-termination.

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

LaunchTemplateConfigs

DataDisk mappings to attach to ecs instance. See Block config below for details.

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

LaunchTemplateId

The ID of the instance launch template associated with the auto provisioning group.

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

LaunchTemplateVersion

The version of the instance launch template associated with the auto provisioning group.

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

MaxSpotPrice

The global maximum price for preemptible instances in the auto provisioning group. If both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the maximum price is the lower value of the two.

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

PayAsYouGoAllocationStrategy

The scale-out policy for pay-as-you-go instances. Valid values: lowest-price and prioritized,Default value: lowest-price.

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

PayAsYouGoTargetCapacity

The target capacity of pay-as-you-go instances in the auto provisioning group.

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

SpotAllocationStrategy

The scale-out policy for preemptible instances. Valid values:lowest-price and diversified,Default value: lowest-price.

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

SpotInstanceInterruptionBehavior

The default behavior after preemptible instances are shut down. Value values: stop and terminate,Default value: stop.

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

SpotInstancePoolsToUseCount

This parameter takes effect when the SpotAllocationStrategy parameter is set to lowest-price. The auto provisioning group selects instance types of the lowest cost to create instances.

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

SpotTargetCapacity

The target capacity of preemptible instances in the auto provisioning group.

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

TerminateInstances

Specifies whether to release instances of the auto provisioning group. Valid values:false and true, default value: false.

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

TerminateInstancesWithExpiration

The shutdown policy for preemptible instances when the auto provisioning group expires. Valid values: false and true, default value: false.

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

TotalTargetCapacity

The total target capacity of the auto provisioning group. The target capacity consists of the following three parts:PayAsYouGoTargetCapacity,SpotTargetCapacity and the supplemental capacity besides PayAsYouGoTargetCapacity and SpotTargetCapacity.

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

ValidFrom

The time when the auto provisioning group is started. The period of time between this point in time and the point in time specified by the valid_until parameter is the effective time period of the auto provisioning group.By default, an auto provisioning group is immediately started after creation.

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

ValidUntil

The time when the auto provisioning group expires. The period of time between this point in time and the point in time specified by the valid_from parameter is the effective time period of the auto provisioning group.By default, an auto provisioning group never expires.

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

Methods

View Source

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

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

Declaration
public static AutoProvisioningGroup Get(string name, Input<string> id, AutoProvisioningGroupState 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.

AutoProvisioningGroupState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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