getPrometheusAlertRules

This data source provides the Arms Prometheus Alert Rules of the current Alibaba Cloud user.

NOTE: Available in v1.136.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.arms.ArmsFunctions;
import com.pulumi.alicloud.arms.inputs.GetPrometheusAlertRulesArgs;
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 ids = ArmsFunctions.getPrometheusAlertRules(GetPrometheusAlertRulesArgs.builder()
.clusterId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("armsPrometheusAlertRuleId1", ids.applyValue(getPrometheusAlertRulesResult -> getPrometheusAlertRulesResult.rules()[0].id()));
final var nameRegex = ArmsFunctions.getPrometheusAlertRules(GetPrometheusAlertRulesArgs.builder()
.clusterId("example_value")
.nameRegex("^my-PrometheusAlertRule")
.build());
ctx.export("armsPrometheusAlertRuleId2", nameRegex.applyValue(getPrometheusAlertRulesResult -> getPrometheusAlertRulesResult.rules()[0].id()));
}
}

Return

A collection of values returned by getPrometheusAlertRules.

Parameters

argument

A collection of arguments for invoking getPrometheusAlertRules.


suspend fun getPrometheusAlertRules(clusterId: String, ids: List<String>? = null, matchExpressions: String? = null, nameRegex: String? = null, outputFile: String? = null, status: Int? = null, type: String? = null): GetPrometheusAlertRulesResult

Return

A collection of values returned by getPrometheusAlertRules.

See also

Parameters

clusterId

The ID of the cluster.

ids

A list of Prometheus Alert Rule IDs.

matchExpressions
nameRegex

A regex string to filter results by Prometheus Alert Rule name.

outputFile
status

The status of the resource. Valid values: 0, 1.

type

The type of the alert rule.


Return

A collection of values returned by getPrometheusAlertRules.

See also

Parameters

argument

Builder for com.pulumi.alicloud.arms.kotlin.inputs.GetPrometheusAlertRulesPlainArgs.