Alibaba Cloud v3.72.0 published on Friday, Jan 3, 2025 by Pulumi
alicloud.arms.getAlertRobots
Explore with Pulumi AI
This data source provides the Arms Alert Robots of the current Alibaba Cloud user.
NOTE: Available since v1.237.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = new alicloud.arms.AlertRobot("default", {
alertRobotName: "my-AlertRobot",
robotType: "wechat",
robotAddr: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23",
});
const nameRegex = alicloud.arms.getAlertRobotsOutput({
alertRobotName: _default.alertRobotName,
});
export const armsAlertRobotId = nameRegex.apply(nameRegex => nameRegex.robots?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.arms.AlertRobot("default",
alert_robot_name="my-AlertRobot",
robot_type="wechat",
robot_addr="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23")
name_regex = alicloud.arms.get_alert_robots_output(alert_robot_name=default.alert_robot_name)
pulumi.export("armsAlertRobotId", name_regex.robots[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := arms.NewAlertRobot(ctx, "default", &arms.AlertRobotArgs{
AlertRobotName: pulumi.String("my-AlertRobot"),
RobotType: pulumi.String("wechat"),
RobotAddr: pulumi.String("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23"),
})
if err != nil {
return err
}
nameRegex := arms.GetAlertRobotsOutput(ctx, arms.GetAlertRobotsOutputArgs{
AlertRobotName: _default.AlertRobotName,
}, nil)
ctx.Export("armsAlertRobotId", nameRegex.ApplyT(func(nameRegex arms.GetAlertRobotsResult) (*string, error) {
return &nameRegex.Robots[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = new AliCloud.Arms.AlertRobot("default", new()
{
AlertRobotName = "my-AlertRobot",
RobotType = "wechat",
RobotAddr = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23",
});
var nameRegex = AliCloud.Arms.GetAlertRobots.Invoke(new()
{
AlertRobotName = @default.AlertRobotName,
});
return new Dictionary<string, object?>
{
["armsAlertRobotId"] = nameRegex.Apply(getAlertRobotsResult => getAlertRobotsResult.Robots[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.arms.AlertRobot;
import com.pulumi.alicloud.arms.AlertRobotArgs;
import com.pulumi.alicloud.arms.ArmsFunctions;
import com.pulumi.alicloud.arms.inputs.GetAlertRobotsArgs;
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 default_ = new AlertRobot("default", AlertRobotArgs.builder()
.alertRobotName("my-AlertRobot")
.robotType("wechat")
.robotAddr("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23")
.build());
final var nameRegex = ArmsFunctions.getAlertRobots(GetAlertRobotsArgs.builder()
.alertRobotName(default_.alertRobotName())
.build());
ctx.export("armsAlertRobotId", nameRegex.applyValue(getAlertRobotsResult -> getAlertRobotsResult).applyValue(nameRegex -> nameRegex.applyValue(getAlertRobotsResult -> getAlertRobotsResult.robots()[0].id())));
}
}
resources:
default:
type: alicloud:arms:AlertRobot
properties:
alertRobotName: my-AlertRobot
robotType: wechat
robotAddr: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23
variables:
nameRegex:
fn::invoke:
function: alicloud:arms:getAlertRobots
arguments:
alertRobotName: ${default.alertRobotName}
outputs:
armsAlertRobotId: ${nameRegex.robots[0].id}
Using getAlertRobots
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 getAlertRobots(args: GetAlertRobotsArgs, opts?: InvokeOptions): Promise<GetAlertRobotsResult>
function getAlertRobotsOutput(args: GetAlertRobotsOutputArgs, opts?: InvokeOptions): Output<GetAlertRobotsResult>
def get_alert_robots(alert_robot_name: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
robot_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAlertRobotsResult
def get_alert_robots_output(alert_robot_name: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
robot_type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAlertRobotsResult]
func GetAlertRobots(ctx *Context, args *GetAlertRobotsArgs, opts ...InvokeOption) (*GetAlertRobotsResult, error)
func GetAlertRobotsOutput(ctx *Context, args *GetAlertRobotsOutputArgs, opts ...InvokeOption) GetAlertRobotsResultOutput
> Note: This function is named GetAlertRobots
in the Go SDK.
public static class GetAlertRobots
{
public static Task<GetAlertRobotsResult> InvokeAsync(GetAlertRobotsArgs args, InvokeOptions? opts = null)
public static Output<GetAlertRobotsResult> Invoke(GetAlertRobotsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAlertRobotsResult> getAlertRobots(GetAlertRobotsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:arms/getAlertRobots:getAlertRobots
arguments:
# arguments dictionary
The following arguments are supported:
- Alert
Robot stringName - The robot name.
- Ids List<string>
- A list of Alert Robot IDs.
- Name
Regex string - A regex string to filter results by Alert Robot name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Robot
Type string - The robot type.
- Alert
Robot stringName - The robot name.
- Ids []string
- A list of Alert Robot IDs.
- Name
Regex string - A regex string to filter results by Alert Robot name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Robot
Type string - The robot type.
- alert
Robot StringName - The robot name.
- ids List<String>
- A list of Alert Robot IDs.
- name
Regex String - A regex string to filter results by Alert Robot name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - robot
Type String - The robot type.
- alert
Robot stringName - The robot name.
- ids string[]
- A list of Alert Robot IDs.
- name
Regex string - A regex string to filter results by Alert Robot name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - robot
Type string - The robot type.
- alert_
robot_ strname - The robot name.
- ids Sequence[str]
- A list of Alert Robot IDs.
- name_
regex str - A regex string to filter results by Alert Robot name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - robot_
type str - The robot type.
- alert
Robot StringName - The robot name.
- ids List<String>
- A list of Alert Robot IDs.
- name
Regex String - A regex string to filter results by Alert Robot name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - robot
Type String - The robot type.
getAlertRobots Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Alert Robot IDs.
- Names List<string>
- A list of Alert Robot names.
- Robots
List<Pulumi.
Ali Cloud. Arms. Outputs. Get Alert Robots Robot> - A list of Arms Alert Robots. Each element contains the following attributes:
- Alert
Robot stringName - Name
Regex string - Output
File string - Robot
Type string - The type of the robot.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Alert Robot IDs.
- Names []string
- A list of Alert Robot names.
- Robots
[]Get
Alert Robots Robot - A list of Arms Alert Robots. Each element contains the following attributes:
- Alert
Robot stringName - Name
Regex string - Output
File string - Robot
Type string - The type of the robot.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Alert Robot IDs.
- names List<String>
- A list of Alert Robot names.
- robots
List<Get
Alert Robots Robot> - A list of Arms Alert Robots. Each element contains the following attributes:
- alert
Robot StringName - name
Regex String - output
File String - robot
Type String - The type of the robot.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Alert Robot IDs.
- names string[]
- A list of Alert Robot names.
- robots
Get
Alert Robots Robot[] - A list of Arms Alert Robots. Each element contains the following attributes:
- alert
Robot stringName - name
Regex string - output
File string - robot
Type string - The type of the robot.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Alert Robot IDs.
- names Sequence[str]
- A list of Alert Robot names.
- robots
Sequence[Get
Alert Robots Robot] - A list of Arms Alert Robots. Each element contains the following attributes:
- alert_
robot_ strname - name_
regex str - output_
file str - robot_
type str - The type of the robot.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Alert Robot IDs.
- names List<String>
- A list of Alert Robot names.
- robots List<Property Map>
- A list of Arms Alert Robots. Each element contains the following attributes:
- alert
Robot StringName - name
Regex String - output
File String - robot
Type String - The type of the robot.
Supporting Types
GetAlertRobotsRobot
- Create
Time string - The creation time of the resource.
- Daily
Noc string - Specifies whether the alert robot receives daily notifications.
- Daily
Noc stringTime - The time of the daily notification.
- Id string
- The ID of the Alert Robot.
- Robot
Addr string - The webhook url of the robot.
- Robot
Id string - The id of the robot.
- Robot
Name string - The name of the robot.
- Robot
Type string - The robot type.
- Create
Time string - The creation time of the resource.
- Daily
Noc string - Specifies whether the alert robot receives daily notifications.
- Daily
Noc stringTime - The time of the daily notification.
- Id string
- The ID of the Alert Robot.
- Robot
Addr string - The webhook url of the robot.
- Robot
Id string - The id of the robot.
- Robot
Name string - The name of the robot.
- Robot
Type string - The robot type.
- create
Time String - The creation time of the resource.
- daily
Noc String - Specifies whether the alert robot receives daily notifications.
- daily
Noc StringTime - The time of the daily notification.
- id String
- The ID of the Alert Robot.
- robot
Addr String - The webhook url of the robot.
- robot
Id String - The id of the robot.
- robot
Name String - The name of the robot.
- robot
Type String - The robot type.
- create
Time string - The creation time of the resource.
- daily
Noc string - Specifies whether the alert robot receives daily notifications.
- daily
Noc stringTime - The time of the daily notification.
- id string
- The ID of the Alert Robot.
- robot
Addr string - The webhook url of the robot.
- robot
Id string - The id of the robot.
- robot
Name string - The name of the robot.
- robot
Type string - The robot type.
- create_
time str - The creation time of the resource.
- daily_
noc str - Specifies whether the alert robot receives daily notifications.
- daily_
noc_ strtime - The time of the daily notification.
- id str
- The ID of the Alert Robot.
- robot_
addr str - The webhook url of the robot.
- robot_
id str - The id of the robot.
- robot_
name str - The name of the robot.
- robot_
type str - The robot type.
- create
Time String - The creation time of the resource.
- daily
Noc String - Specifies whether the alert robot receives daily notifications.
- daily
Noc StringTime - The time of the daily notification.
- id String
- The ID of the Alert Robot.
- robot
Addr String - The webhook url of the robot.
- robot
Id String - The id of the robot.
- robot
Name String - The name of the robot.
- robot
Type String - The robot type.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.