Show / Hide Table of Contents

Class Notification

Provides a ESS notification resource. More about Ess notification, see Autoscaling Notification.

NOTE: Available in 1.55.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var name = config.Get("name") ?? "tf-testAccEssNotification-%d";
    var defaultRegions = Output.Create(AliCloud.GetRegions.InvokeAsync(new AliCloud.GetRegionsArgs
    {
        Current = true,
    }));
    var defaultAccount = Output.Create(AliCloud.GetAccount.InvokeAsync());
    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 defaultScalingGroup = new AliCloud.Ess.ScalingGroup("defaultScalingGroup", new AliCloud.Ess.ScalingGroupArgs
    {
        MaxSize = 1,
        MinSize = 1,
        RemovalPolicies = 
        {
            "OldestInstance",
            "NewestInstance",
        },
        ScalingGroupName = name,
        VswitchIds = 
        {
            defaultSwitch.Id,
        },
    });
    var defaultQueue = new AliCloud.Mns.Queue("defaultQueue", new AliCloud.Mns.QueueArgs
    {
    });
    var defaultNotification = new AliCloud.Ess.Notification("defaultNotification", new AliCloud.Ess.NotificationArgs
    {
        NotificationArn = Output.Tuple(defaultRegions, defaultAccount, defaultQueue.Name).Apply(values =>
        {
            var defaultRegions = values.Item1;
            var defaultAccount = values.Item2;
            var name = values.Item3;
            return $"acs:ess:{defaultRegions.Regions[0].Id}:{defaultAccount.Id}:queue/{name}";
        }),
        NotificationTypes = 
        {
            "AUTOSCALING:SCALE_OUT_SUCCESS",
            "AUTOSCALING:SCALE_OUT_ERROR",
        },
        ScalingGroupId = defaultScalingGroup.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Notification
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.Ess
Assembly: Pulumi.AliCloud.dll
Syntax
public class Notification : CustomResource

Constructors

View Source

Notification(String, NotificationArgs, CustomResourceOptions)

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

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

The unique name of the resource

NotificationArgs 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

NotificationArn

The Alibaba Cloud Resource Name (ARN) for the notification object. The format of notification_arn is acs:ess:{region}:{account-id}:{resource-relative-id}. Valid values for resource-relative-id: 'cloudmonitor', 'queue/', 'topic/'.

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

NotificationTypes

The notification types of Auto Scaling events and resource changes. Supported notification types: 'AUTOSCALING:SCALE_OUT_SUCCESS', 'AUTOSCALING:SCALE_IN_SUCCESS', 'AUTOSCALING:SCALE_OUT_ERROR', 'AUTOSCALING:SCALE_IN_ERROR', 'AUTOSCALING:SCALE_REJECT', 'AUTOSCALING:SCALE_OUT_START', 'AUTOSCALING:SCALE_IN_START', 'AUTOSCALING:SCHEDULE_TASK_EXPIRING'.

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

ScalingGroupId

The ID of the Auto Scaling group.

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

Methods

View Source

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

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

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

NotificationState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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