alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.log.getAlertResource

Using this data source can init SLS Alert resources automatically.

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

NOTE: Available in v1.161.0+

Example Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var exampleUser = AliCloud.Log.GetAlertResource.Invoke(new()
    {
        Lang = "cn",
        Type = "user",
    });

    var exampleProject = AliCloud.Log.GetAlertResource.Invoke(new()
    {
        Project = "test-alert-tf",
        Type = "project",
    });

});
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.GetAlertResource(ctx, &log.GetAlertResourceArgs{
			Lang: pulumi.StringRef("cn"),
			Type: "user",
		}, nil)
		if err != nil {
			return err
		}
		_, err = log.GetAlertResource(ctx, &log.GetAlertResourceArgs{
			Project: pulumi.StringRef("test-alert-tf"),
			Type:    "project",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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()
            .lang("cn")
            .type("user")
            .build());

        final var exampleProject = LogFunctions.getAlertResource(GetAlertResourceArgs.builder()
            .project("test-alert-tf")
            .type("project")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example_user = alicloud.log.get_alert_resource(lang="cn",
    type="user")
example_project = alicloud.log.get_alert_resource(project="test-alert-tf",
    type="project")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const exampleUser = alicloud.log.getAlertResource({
    lang: "cn",
    type: "user",
});
const exampleProject = alicloud.log.getAlertResource({
    project: "test-alert-tf",
    type: "project",
});
variables:
  exampleUser:
    fn::invoke:
      Function: alicloud:log:getAlertResource
      Arguments:
        lang: cn
        type: user
  exampleProject:
    fn::invoke:
      Function: alicloud:log:getAlertResource
      Arguments:
        project: test-alert-tf
        type: project

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 GetAlertResource(ctx *Context, args *GetAlertResourceArgs, opts ...InvokeOption) (*GetAlertResourceResult, error)
func GetAlertResourceOutput(ctx *Context, args *GetAlertResourceOutputArgs, opts ...InvokeOption) GetAlertResourceResultOutput

> Note: This function is named GetAlertResource 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.