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,
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-testAccEssNotification-%d"
default_regions = alicloud.get_regions(current=True)
default_account = alicloud.get_account()
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/24",
    vpc_id=default_network.id)
default_scaling_group = alicloud.ess.ScalingGroup("defaultScalingGroup",
    max_size=1,
    min_size=1,
    removal_policies=[
        "OldestInstance",
        "NewestInstance",
    ],
    scaling_group_name=name,
    vswitch_ids=[default_switch.id])
default_queue = alicloud.mns.Queue("defaultQueue")
default_notification = alicloud.ess.Notification("defaultNotification",
    notification_arn=default_queue.name.apply(lambda name: f"acs:ess:{default_regions.regions[0]['id']}:{default_account.id}:queue/{name}"),
    notification_types=[
        "AUTOSCALING:SCALE_OUT_SUCCESS",
        "AUTOSCALING:SCALE_OUT_ERROR",
    ],
    scaling_group_id=default_scaling_group.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-testAccEssNotification-%d";

const defaultRegions = pulumi.output(alicloud.getRegions({
    current: true,
}, { async: true }));
const defaultAccount = pulumi.output(alicloud.getAccount({ async: true }));
const defaultZones = pulumi.output(alicloud.getZones({
    availableDiskCategory: "cloud_efficiency",
    availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
    cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/24",
    vpcId: defaultNetwork.id,
});
const defaultScalingGroup = new alicloud.ess.ScalingGroup("default", {
    maxSize: 1,
    minSize: 1,
    removalPolicies: [
        "OldestInstance",
        "NewestInstance",
    ],
    scalingGroupName: name,
    vswitchIds: [defaultSwitch.id],
});
const defaultQueue = new alicloud.mns.Queue("default", {});
const defaultNotification = new alicloud.ess.Notification("default", {
    notificationArn: pulumi.interpolate`acs:ess:${defaultRegions.regions[0].id}:${defaultAccount.id}:queue/${defaultQueue.name}`,
    notificationTypes: [
        "AUTOSCALING:SCALE_OUT_SUCCESS",
        "AUTOSCALING:SCALE_OUT_ERROR",
    ],
    scalingGroupId: defaultScalingGroup.id,
});

Create a Notification Resource

def Notification(resource_name, opts=None, notification_arn=None, notification_types=None, scaling_group_id=None, __props__=None);
func NewNotification(ctx *Context, name string, args NotificationArgs, opts ...ResourceOption) (*Notification, error)
name string
The unique name of the resource.
args NotificationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args NotificationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NotificationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Notification Resource Properties

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

Inputs

The Notification resource accepts the following input properties:

NotificationArn string

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

NotificationTypes List<string>

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

ScalingGroupId string

The ID of the Auto Scaling group.

NotificationArn string

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

NotificationTypes []string

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

ScalingGroupId string

The ID of the Auto Scaling group.

notificationArn string

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

notificationTypes string[]

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

scalingGroupId string

The ID of the Auto Scaling group.

notification_arn str

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

notification_types List[str]

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

scaling_group_id str

The ID of the Auto Scaling group.

Outputs

All input properties are implicitly available as output properties. Additionally, the Notification 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing Notification Resource

Get an existing Notification 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?: NotificationState, opts?: CustomResourceOptions): Notification
static get(resource_name, id, opts=None, notification_arn=None, notification_types=None, scaling_group_id=None, __props__=None);
func GetNotification(ctx *Context, name string, id IDInput, state *NotificationState, opts ...ResourceOption) (*Notification, error)
public static Notification Get(string name, Input<string> id, NotificationState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

NotificationArn string

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

NotificationTypes List<string>

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

ScalingGroupId string

The ID of the Auto Scaling group.

NotificationArn string

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

NotificationTypes []string

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

ScalingGroupId string

The ID of the Auto Scaling group.

notificationArn string

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

notificationTypes string[]

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

scalingGroupId string

The ID of the Auto Scaling group.

notification_arn str

The Alibaba Cloud Resource Name (ARN) of the notification object, The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format. * region: the region ID of the scaling group. For more information, see Regions and zones * account-id: the ID of your account. * resource-relative-id: the notification method. Valid values : cloudmonitor, MNS queue: queue/{queuename}, Replace the queuename with the specific MNS queue name, MNS topic: topic/{topicname}, Replace the topicname with the specific MNS topic name.

notification_types List[str]

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

scaling_group_id str

The ID of the Auto Scaling group.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.