1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. log
  5. AlertResource
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.log.AlertResource

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Using this resource can init SLS Alert resources automatically.

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

    NOTE: Available since v1.219.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const exampleUser = new alicloud.log.AlertResource("example_user", {
        type: "user",
        lang: "cn",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example_user = alicloud.log.AlertResource("example_user",
        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.NewAlertResource(ctx, "example_user", &log.AlertResourceArgs{
    			Type: pulumi.String("user"),
    			Lang: pulumi.String("cn"),
    		})
    		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 = new AliCloud.Log.AlertResource("example_user", 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.AlertResource;
    import com.pulumi.alicloud.log.AlertResourceArgs;
    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) {
            var exampleUser = new AlertResource("exampleUser", AlertResourceArgs.builder()
                .type("user")
                .lang("cn")
                .build());
    
        }
    }
    
    resources:
      exampleUser:
        type: alicloud:log:AlertResource
        name: example_user
        properties:
          type: user
          lang: cn
    

    Create AlertResource Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AlertResource(name: string, args: AlertResourceArgs, opts?: CustomResourceOptions);
    @overload
    def AlertResource(resource_name: str,
                      args: AlertResourceArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertResource(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      type: Optional[str] = None,
                      lang: Optional[str] = None,
                      project: Optional[str] = None)
    func NewAlertResource(ctx *Context, name string, args AlertResourceArgs, opts ...ResourceOption) (*AlertResource, error)
    public AlertResource(string name, AlertResourceArgs args, CustomResourceOptions? opts = null)
    public AlertResource(String name, AlertResourceArgs args)
    public AlertResource(String name, AlertResourceArgs args, CustomResourceOptions options)
    
    type: alicloud:log:AlertResource
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AlertResourceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AlertResourceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AlertResourceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertResourceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertResourceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alertResourceResource = new AliCloud.Log.AlertResource("alertResourceResource", new()
    {
        Type = "string",
        Lang = "string",
        Project = "string",
    });
    
    example, err := log.NewAlertResource(ctx, "alertResourceResource", &log.AlertResourceArgs{
    	Type:    pulumi.String("string"),
    	Lang:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    })
    
    var alertResourceResource = new AlertResource("alertResourceResource", AlertResourceArgs.builder()
        .type("string")
        .lang("string")
        .project("string")
        .build());
    
    alert_resource_resource = alicloud.log.AlertResource("alertResourceResource",
        type="string",
        lang="string",
        project="string")
    
    const alertResourceResource = new alicloud.log.AlertResource("alertResourceResource", {
        type: "string",
        lang: "string",
        project: "string",
    });
    
    type: alicloud:log:AlertResource
    properties:
        lang: string
        project: string
        type: string
    

    AlertResource Resource Properties

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

    Inputs

    The AlertResource resource accepts the following input properties:

    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.

    Outputs

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

    Look up Existing AlertResource Resource

    Get an existing AlertResource 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?: AlertResourceState, opts?: CustomResourceOptions): AlertResource
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            lang: Optional[str] = None,
            project: Optional[str] = None,
            type: Optional[str] = None) -> AlertResource
    func GetAlertResource(ctx *Context, name string, id IDInput, state *AlertResourceState, opts ...ResourceOption) (*AlertResource, error)
    public static AlertResource Get(string name, Input<string> id, AlertResourceState? state, CustomResourceOptions? opts = null)
    public static AlertResource get(String name, Output<String> id, AlertResourceState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    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 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 str
    The lang of alert center resource when type is user.
    project str
    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 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.

    Import

    Log alert resource can be imported using the id, e.g.

    $ pulumi import alicloud:log/alertResource:AlertResource example alert_resource:project:tf-project
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi