Alibaba Cloud
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 Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var exampleUser = Output.Create(AliCloud.Log.GetAlertResource.InvokeAsync(new AliCloud.Log.GetAlertResourceArgs
{
Lang = "cn",
Type = "user",
}));
var exampleProject = Output.Create(AliCloud.Log.GetAlertResource.InvokeAsync(new AliCloud.Log.GetAlertResourceArgs
{
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
})
}
Coming soon!
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 = pulumi.output(alicloud.log.getAlertResource({
lang: "cn",
type: "user",
}));
const exampleProject = pulumi.output(alicloud.log.getAlertResource({
project: "test-alert-tf",
type: "project",
}));
Coming soon!
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:
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.