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

alicloud.log.getAlertResource

Explore with Pulumi AI

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

    Using this data source can init SLS Alert resources automatically.

    For information about SLS Alert and how to use it, see SLS Alert Overview

    DEPRECATED: This resource has been deprecated from version 1.219.0. Please use new resource alicloud_log_alert_resource.

    NOTE: Available since v1.161.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const exampleUser = alicloud.log.getAlertResource({
        type: "user",
        lang: "cn",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example_user = alicloud.log.get_alert_resource(type="user",
        lang="cn")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := log.LookupAlertResource(ctx, &log.LookupAlertResourceArgs{
    			Type: "user",
    			Lang: pulumi.StringRef("cn"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleUser = AliCloud.Log.GetAlertResource.Invoke(new()
        {
            Type = "user",
            Lang = "cn",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.log.LogFunctions;
    import com.pulumi.alicloud.log.inputs.GetAlertResourceArgs;
    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 exampleUser = LogFunctions.getAlertResource(GetAlertResourceArgs.builder()
                .type("user")
                .lang("cn")
                .build());
    
        }
    }
    
    variables:
      exampleUser:
        fn::invoke:
          Function: alicloud:log:getAlertResource
          Arguments:
            type: user
            lang: cn
    

    Using getAlertResource

    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 getAlertResource(args: GetAlertResourceArgs, opts?: InvokeOptions): Promise<GetAlertResourceResult>
    function getAlertResourceOutput(args: GetAlertResourceOutputArgs, opts?: InvokeOptions): Output<GetAlertResourceResult>
    def get_alert_resource(lang: Optional[str] = None,
                           project: Optional[str] = None,
                           type: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetAlertResourceResult
    def get_alert_resource_output(lang: Optional[pulumi.Input[str]] = None,
                           project: Optional[pulumi.Input[str]] = None,
                           type: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetAlertResourceResult]
    func LookupAlertResource(ctx *Context, args *LookupAlertResourceArgs, opts ...InvokeOption) (*LookupAlertResourceResult, error)
    func LookupAlertResourceOutput(ctx *Context, args *LookupAlertResourceOutputArgs, opts ...InvokeOption) LookupAlertResourceResultOutput

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

    public static class GetAlertResource 
    {
        public static Task<GetAlertResourceResult> InvokeAsync(GetAlertResourceArgs args, InvokeOptions? opts = null)
        public static Output<GetAlertResourceResult> Invoke(GetAlertResourceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAlertResourceResult> getAlertResource(GetAlertResourceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:log/getAlertResource:getAlertResource
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Type string
    The type of alert resources, must be user or project, 'user' for init aliyuncloud account's alert center resource, including project named sls-alert-{uid}-{region} and some dashboards; 'project' for init project's alert resource, including logstore named internal-alert-history and alert dashboard.
    Lang string
    The lang of alert center resource when type is user.
    Project string
    The project of alert resource when type is project.
    Type string
    The type of alert resources, must be user or project, 'user' for init aliyuncloud account's alert center resource, including project named sls-alert-{uid}-{region} and some dashboards; 'project' for init project's alert resource, including logstore named internal-alert-history and alert dashboard.
    Lang string
    The lang of alert center resource when type is user.
    Project string
    The project of alert resource when type is project.
    type String
    The type of alert resources, must be user or project, 'user' for init aliyuncloud account's alert center resource, including project named sls-alert-{uid}-{region} and some dashboards; 'project' for init project's alert resource, including logstore named internal-alert-history and alert dashboard.
    lang String
    The lang of alert center resource when type is user.
    project String
    The project of alert resource when type is project.
    type string
    The type of alert resources, must be user or project, 'user' for init aliyuncloud account's alert center resource, including project named sls-alert-{uid}-{region} and some dashboards; 'project' for init project's alert resource, including logstore named internal-alert-history and alert dashboard.
    lang string
    The lang of alert center resource when type is user.
    project string
    The project of alert resource when type is project.
    type str
    The type of alert resources, must be user or project, 'user' for init aliyuncloud account's alert center resource, including project named sls-alert-{uid}-{region} and some dashboards; 'project' for init project's alert resource, including logstore named internal-alert-history and alert dashboard.
    lang str
    The lang of alert center resource when type is user.
    project str
    The project of alert resource when type is project.
    type String
    The type of alert resources, must be user or project, 'user' for init aliyuncloud account's alert center resource, including project named sls-alert-{uid}-{region} and some dashboards; 'project' for init project's alert resource, including logstore named internal-alert-history and alert dashboard.
    lang String
    The lang of alert center resource when type is user.
    project String
    The project of alert resource when type is project.

    getAlertResource Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    Lang string
    Project string
    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    Lang string
    Project string
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    lang String
    project String
    id string
    The provider-assigned unique ID for this managed resource.
    type string
    lang string
    project string
    id str
    The provider-assigned unique ID for this managed resource.
    type str
    lang str
    project str
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    lang String
    project String

    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