1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ess
  5. getNotifications
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.ess.getNotifications

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides available notification resources.

    NOTE: Available in 1.72.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ds = alicloud.ess.getNotifications({
        scalingGroupId: "scaling_group_id",
    });
    export const firstNotification = ds.then(ds => ds.notifications?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ds = alicloud.ess.get_notifications(scaling_group_id="scaling_group_id")
    pulumi.export("firstNotification", ds.notifications[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ess"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ds, err := ess.GetNotifications(ctx, &ess.GetNotificationsArgs{
    			ScalingGroupId: "scaling_group_id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstNotification", ds.Notifications[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ds = AliCloud.Ess.GetNotifications.Invoke(new()
        {
            ScalingGroupId = "scaling_group_id",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstNotification"] = ds.Apply(getNotificationsResult => getNotificationsResult.Notifications[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ess.EssFunctions;
    import com.pulumi.alicloud.ess.inputs.GetNotificationsArgs;
    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 ds = EssFunctions.getNotifications(GetNotificationsArgs.builder()
                .scalingGroupId("scaling_group_id")
                .build());
    
            ctx.export("firstNotification", ds.applyValue(getNotificationsResult -> getNotificationsResult.notifications()[0].id()));
        }
    }
    
    variables:
      ds:
        fn::invoke:
          Function: alicloud:ess:getNotifications
          Arguments:
            scalingGroupId: scaling_group_id
    outputs:
      firstNotification: ${ds.notifications[0].id}
    

    Using getNotifications

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNotifications(args: GetNotificationsArgs, opts?: InvokeOptions): Promise<GetNotificationsResult>
    function getNotificationsOutput(args: GetNotificationsOutputArgs, opts?: InvokeOptions): Output<GetNotificationsResult>
    def get_notifications(ids: Optional[Sequence[str]] = None,
                          output_file: Optional[str] = None,
                          scaling_group_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetNotificationsResult
    def get_notifications_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          scaling_group_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetNotificationsResult]
    func GetNotifications(ctx *Context, args *GetNotificationsArgs, opts ...InvokeOption) (*GetNotificationsResult, error)
    func GetNotificationsOutput(ctx *Context, args *GetNotificationsOutputArgs, opts ...InvokeOption) GetNotificationsResultOutput

    > Note: This function is named GetNotifications in the Go SDK.

    public static class GetNotifications 
    {
        public static Task<GetNotificationsResult> InvokeAsync(GetNotificationsArgs args, InvokeOptions? opts = null)
        public static Output<GetNotificationsResult> Invoke(GetNotificationsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNotificationsResult> getNotifications(GetNotificationsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ess/getNotifications:getNotifications
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ScalingGroupId string
    Scaling group id the notifications belong to.
    Ids List<string>
    A list of notification ids.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ScalingGroupId string
    Scaling group id the notifications belong to.
    Ids []string
    A list of notification ids.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    scalingGroupId String
    Scaling group id the notifications belong to.
    ids List<String>
    A list of notification ids.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    scalingGroupId string
    Scaling group id the notifications belong to.
    ids string[]
    A list of notification ids.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    scaling_group_id str
    Scaling group id the notifications belong to.
    ids Sequence[str]
    A list of notification ids.
    output_file str
    File name where to save data source results (after running pulumi preview).
    scalingGroupId String
    Scaling group id the notifications belong to.
    ids List<String>
    A list of notification ids.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getNotifications Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Notifications List<Pulumi.AliCloud.Ess.Outputs.GetNotificationsNotification>
    A list of notifications. Each element contains the following attributes:
    ScalingGroupId string
    ID of the scaling group.
    Ids List<string>
    A list of notification ids.
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Notifications []GetNotificationsNotification
    A list of notifications. Each element contains the following attributes:
    ScalingGroupId string
    ID of the scaling group.
    Ids []string
    A list of notification ids.
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    notifications List<GetNotificationsNotification>
    A list of notifications. Each element contains the following attributes:
    scalingGroupId String
    ID of the scaling group.
    ids List<String>
    A list of notification ids.
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    notifications GetNotificationsNotification[]
    A list of notifications. Each element contains the following attributes:
    scalingGroupId string
    ID of the scaling group.
    ids string[]
    A list of notification ids.
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    notifications Sequence[GetNotificationsNotification]
    A list of notifications. Each element contains the following attributes:
    scaling_group_id str
    ID of the scaling group.
    ids Sequence[str]
    A list of notification ids.
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    notifications List<Property Map>
    A list of notifications. Each element contains the following attributes:
    scalingGroupId String
    ID of the scaling group.
    ids List<String>
    A list of notification ids.
    outputFile String

    Supporting Types

    GetNotificationsNotification

    Id string
    ID of the notification.
    NotificationArn string
    The Alibaba Cloud Resource Name (ARN) for the notification object.
    NotificationTypes List<string>
    The notification types of Auto Scaling events and resource changes.
    ScalingGroupId string
    Scaling group id the notifications belong to.
    Id string
    ID of the notification.
    NotificationArn string
    The Alibaba Cloud Resource Name (ARN) for the notification object.
    NotificationTypes []string
    The notification types of Auto Scaling events and resource changes.
    ScalingGroupId string
    Scaling group id the notifications belong to.
    id String
    ID of the notification.
    notificationArn String
    The Alibaba Cloud Resource Name (ARN) for the notification object.
    notificationTypes List<String>
    The notification types of Auto Scaling events and resource changes.
    scalingGroupId String
    Scaling group id the notifications belong to.
    id string
    ID of the notification.
    notificationArn string
    The Alibaba Cloud Resource Name (ARN) for the notification object.
    notificationTypes string[]
    The notification types of Auto Scaling events and resource changes.
    scalingGroupId string
    Scaling group id the notifications belong to.
    id str
    ID of the notification.
    notification_arn str
    The Alibaba Cloud Resource Name (ARN) for the notification object.
    notification_types Sequence[str]
    The notification types of Auto Scaling events and resource changes.
    scaling_group_id str
    Scaling group id the notifications belong to.
    id String
    ID of the notification.
    notificationArn String
    The Alibaba Cloud Resource Name (ARN) for the notification object.
    notificationTypes List<String>
    The notification types of Auto Scaling events and resource changes.
    scalingGroupId String
    Scaling group id the notifications belong to.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi