alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.ess.SuspendProcess

Suspend/Resume processes to a specified scaling group.

For information about scaling group suspend process, see SuspendProcesses.

NOTE: Available in v1.166.0+

Example Usage

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.alb.ServerGroup;
import com.pulumi.alicloud.alb.ServerGroupArgs;
import com.pulumi.alicloud.ess.ScalingGroup;
import com.pulumi.alicloud.ess.ScalingGroupArgs;
import com.pulumi.alicloud.ess.ScalingConfiguration;
import com.pulumi.alicloud.ess.ScalingConfigurationArgs;
import com.pulumi.alicloud.alb.inputs.ServerGroupHealthCheckConfigArgs;
import com.pulumi.alicloud.alb.inputs.ServerGroupStickySessionConfigArgs;
import com.pulumi.alicloud.ess.SuspendProcess;
import com.pulumi.alicloud.ess.SuspendProcessArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("testAccEssSuspendProcess");
        final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
            .availableDiskCategory("cloud_efficiency")
            .availableResourceCreation("VSwitch")
            .build());

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
            .cidrBlock("172.16.0.0/16")
            .build());

        var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
            .vpcId(defaultNetwork.id())
            .cidrBlock("172.16.0.0/24")
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .build());

        var defaultServerGroup = new ServerGroup("defaultServerGroup", ServerGroupArgs.builder()        
            .loadBalancerId(alicloud_slb_load_balancer.default().id())
            .name("test")
            .build());

        var defaultScalingGroup = new ScalingGroup("defaultScalingGroup", ScalingGroupArgs.builder()        
            .minSize("2")
            .maxSize("2")
            .scalingGroupName(name)
            .vswitchIds(defaultSwitch.id())
            .build());

        var defaultScalingConfiguration = new ScalingConfiguration("defaultScalingConfiguration", ScalingConfigurationArgs.builder()        
            .scalingGroupId(defaultScalingGroup.id())
            .imageId(data.alicloud_images().default().images()[0].id())
            .instanceType(data.alicloud_instance_types().default().instance_types()[0].id())
            .securityGroupId(alicloud_security_group.default().id())
            .forceDelete(true)
            .active(true)
            .enable(true)
            .build());

        var defaultAlb_serverGroupServerGroup = new ServerGroup("defaultAlb/serverGroupServerGroup", ServerGroupArgs.builder()        
            .serverGroupName(name)
            .vpcId(defaultNetwork.id())
            .healthCheckConfig(ServerGroupHealthCheckConfigArgs.builder()
                .healthCheckEnabled("false")
                .build())
            .stickySessionConfig(ServerGroupStickySessionConfigArgs.builder()
                .stickySessionEnabled(true)
                .cookie("tf-testAcc")
                .stickySessionType("Server")
                .build())
            .build());

        var defaultSuspendProcess = new SuspendProcess("defaultSuspendProcess", SuspendProcessArgs.builder()        
            .scalingGroupId(defaultScalingGroup.id())
            .process("ScaleIn")
            .build(), CustomResourceOptions.builder()
                .dependsOn("alicloud_ess_scaling_configuration.default")
                .build());

    }
}

Coming soon!

Coming soon!

configuration:
  name:
    type: string
    default: testAccEssSuspendProcess
resources:
  defaultNetwork:
    type: alicloud:vpc:Network
    properties:
      cidrBlock: 172.16.0.0/16
  defaultSwitch:
    type: alicloud:vpc:Switch
    properties:
      vpcId: ${defaultNetwork.id}
      cidrBlock: 172.16.0.0/24
      zoneId: ${defaultZones.zones[0].id}
  defaultServerGroup:
    type: alicloud:alb:ServerGroup
    properties:
      loadBalancerId: ${alicloud_slb_load_balancer.default.id}
      name: test
  defaultScalingGroup:
    type: alicloud:ess:ScalingGroup
    properties:
      minSize: '2'
      maxSize: '2'
      scalingGroupName: ${name}
      vswitchIds:
        - ${defaultSwitch.id}
  defaultScalingConfiguration:
    type: alicloud:ess:ScalingConfiguration
    properties:
      scalingGroupId: ${defaultScalingGroup.id}
      imageId: ${data.alicloud_images.default.images[0].id}
      instanceType: ${data.alicloud_instance_types.default.instance_types[0].id}
      securityGroupId: ${alicloud_security_group.default.id}
      forceDelete: true
      active: true
      enable: true
  defaultAlb/serverGroupServerGroup:
    type: alicloud:alb:ServerGroup
    properties:
      serverGroupName: ${name}
      vpcId: ${defaultNetwork.id}
      healthCheckConfig:
        healthCheckEnabled: 'false'
      stickySessionConfig:
        stickySessionEnabled: true
        cookie: tf-testAcc
        stickySessionType: Server
  defaultSuspendProcess:
    type: alicloud:ess:SuspendProcess
    properties:
      scalingGroupId: ${defaultScalingGroup.id}
      process: ScaleIn
    options:
      dependson:
        - alicloud_ess_scaling_configuration.default
variables:
  defaultZones:
    fn::invoke:
      Function: alicloud:getZones
      Arguments:
        availableDiskCategory: cloud_efficiency
        availableResourceCreation: VSwitch

Create SuspendProcess Resource

new SuspendProcess(name: string, args: SuspendProcessArgs, opts?: CustomResourceOptions);
@overload
def SuspendProcess(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   process: Optional[str] = None,
                   scaling_group_id: Optional[str] = None)
@overload
def SuspendProcess(resource_name: str,
                   args: SuspendProcessArgs,
                   opts: Optional[ResourceOptions] = None)
func NewSuspendProcess(ctx *Context, name string, args SuspendProcessArgs, opts ...ResourceOption) (*SuspendProcess, error)
public SuspendProcess(string name, SuspendProcessArgs args, CustomResourceOptions? opts = null)
public SuspendProcess(String name, SuspendProcessArgs args)
public SuspendProcess(String name, SuspendProcessArgs args, CustomResourceOptions options)
type: alicloud:ess:SuspendProcess
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SuspendProcessArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SuspendProcessArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SuspendProcessArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SuspendProcessArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SuspendProcessArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SuspendProcess Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SuspendProcess resource accepts the following input properties:

Process string

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

ScalingGroupId string

ID of the scaling group.

Process string

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

ScalingGroupId string

ID of the scaling group.

process String

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scalingGroupId String

ID of the scaling group.

process string

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scalingGroupId string

ID of the scaling group.

process str

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scaling_group_id str

ID of the scaling group.

process String

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scalingGroupId String

ID of the scaling group.

Outputs

All input properties are implicitly available as output properties. Additionally, the SuspendProcess resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing SuspendProcess Resource

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

public static get(name: string, id: Input<ID>, state?: SuspendProcessState, opts?: CustomResourceOptions): SuspendProcess
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        process: Optional[str] = None,
        scaling_group_id: Optional[str] = None) -> SuspendProcess
func GetSuspendProcess(ctx *Context, name string, id IDInput, state *SuspendProcessState, opts ...ResourceOption) (*SuspendProcess, error)
public static SuspendProcess Get(string name, Input<string> id, SuspendProcessState? state, CustomResourceOptions? opts = null)
public static SuspendProcess get(String name, Output<String> id, SuspendProcessState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Process string

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

ScalingGroupId string

ID of the scaling group.

Process string

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

ScalingGroupId string

ID of the scaling group.

process String

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scalingGroupId String

ID of the scaling group.

process string

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scalingGroupId string

ID of the scaling group.

process str

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scaling_group_id str

ID of the scaling group.

process String

Activity type N that you want to suspend. Valid values are: SCALE_OUT,SCALE_IN,HealthCheck,AlarmNotification and ScheduledAction.

scalingGroupId String

ID of the scaling group.

Import

Timeouts The timeouts block allows you to specify timeouts for certain actions* create - (Defaults to 1 mins) Used when create the process. * delete - (Defaults to 1 mins) Used when delete the process.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.