1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. arms
  5. getPrometheusMonitorings
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.arms.getPrometheusMonitorings

Explore with Pulumi AI

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

NOTE: Available since v1.210.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.arms.getPrometheusMonitorings({
    clusterId: "your_cluster_id",
    ids: ["example_id"],
});
export const armsPrometheusMonitoringsId1 = ids.then(ids => ids.prometheusMonitorings?.[0]?.id);
const nameRegex = alicloud.arms.getPrometheusMonitorings({
    clusterId: "your_cluster_id",
    nameRegex: "tf-example",
});
export const armsPrometheusMonitoringsId2 = nameRegex.then(nameRegex => nameRegex.prometheusMonitorings?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.arms.get_prometheus_monitorings(cluster_id="your_cluster_id",
    ids=["example_id"])
pulumi.export("armsPrometheusMonitoringsId1", ids.prometheus_monitorings[0].id)
name_regex = alicloud.arms.get_prometheus_monitorings(cluster_id="your_cluster_id",
    name_regex="tf-example")
pulumi.export("armsPrometheusMonitoringsId2", name_regex.prometheus_monitorings[0].id)
Copy
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 {
		ids, err := arms.GetPrometheusMonitorings(ctx, &arms.GetPrometheusMonitoringsArgs{
			ClusterId: "your_cluster_id",
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("armsPrometheusMonitoringsId1", ids.PrometheusMonitorings[0].Id)
		nameRegex, err := arms.GetPrometheusMonitorings(ctx, &arms.GetPrometheusMonitoringsArgs{
			ClusterId: "your_cluster_id",
			NameRegex: pulumi.StringRef("tf-example"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("armsPrometheusMonitoringsId2", nameRegex.PrometheusMonitorings[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.Arms.GetPrometheusMonitorings.Invoke(new()
    {
        ClusterId = "your_cluster_id",
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.Arms.GetPrometheusMonitorings.Invoke(new()
    {
        ClusterId = "your_cluster_id",
        NameRegex = "tf-example",
    });

    return new Dictionary<string, object?>
    {
        ["armsPrometheusMonitoringsId1"] = ids.Apply(getPrometheusMonitoringsResult => getPrometheusMonitoringsResult.PrometheusMonitorings[0]?.Id),
        ["armsPrometheusMonitoringsId2"] = nameRegex.Apply(getPrometheusMonitoringsResult => getPrometheusMonitoringsResult.PrometheusMonitorings[0]?.Id),
    };
});
Copy
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.GetPrometheusMonitoringsArgs;
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.getPrometheusMonitorings(GetPrometheusMonitoringsArgs.builder()
            .clusterId("your_cluster_id")
            .ids("example_id")
            .build());

        ctx.export("armsPrometheusMonitoringsId1", ids.applyValue(getPrometheusMonitoringsResult -> getPrometheusMonitoringsResult.prometheusMonitorings()[0].id()));
        final var nameRegex = ArmsFunctions.getPrometheusMonitorings(GetPrometheusMonitoringsArgs.builder()
            .clusterId("your_cluster_id")
            .nameRegex("tf-example")
            .build());

        ctx.export("armsPrometheusMonitoringsId2", nameRegex.applyValue(getPrometheusMonitoringsResult -> getPrometheusMonitoringsResult.prometheusMonitorings()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:arms:getPrometheusMonitorings
      arguments:
        clusterId: your_cluster_id
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      function: alicloud:arms:getPrometheusMonitorings
      arguments:
        clusterId: your_cluster_id
        nameRegex: tf-example
outputs:
  armsPrometheusMonitoringsId1: ${ids.prometheusMonitorings[0].id}
  armsPrometheusMonitoringsId2: ${nameRegex.prometheusMonitorings[0].id}
Copy

Using getPrometheusMonitorings

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 getPrometheusMonitorings(args: GetPrometheusMonitoringsArgs, opts?: InvokeOptions): Promise<GetPrometheusMonitoringsResult>
function getPrometheusMonitoringsOutput(args: GetPrometheusMonitoringsOutputArgs, opts?: InvokeOptions): Output<GetPrometheusMonitoringsResult>
Copy
def get_prometheus_monitorings(cluster_id: Optional[str] = None,
                               ids: Optional[Sequence[str]] = None,
                               name_regex: Optional[str] = None,
                               output_file: Optional[str] = None,
                               status: Optional[str] = None,
                               type: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetPrometheusMonitoringsResult
def get_prometheus_monitorings_output(cluster_id: 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,
                               status: Optional[pulumi.Input[str]] = None,
                               type: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetPrometheusMonitoringsResult]
Copy
func GetPrometheusMonitorings(ctx *Context, args *GetPrometheusMonitoringsArgs, opts ...InvokeOption) (*GetPrometheusMonitoringsResult, error)
func GetPrometheusMonitoringsOutput(ctx *Context, args *GetPrometheusMonitoringsOutputArgs, opts ...InvokeOption) GetPrometheusMonitoringsResultOutput
Copy

> Note: This function is named GetPrometheusMonitorings in the Go SDK.

public static class GetPrometheusMonitorings 
{
    public static Task<GetPrometheusMonitoringsResult> InvokeAsync(GetPrometheusMonitoringsArgs args, InvokeOptions? opts = null)
    public static Output<GetPrometheusMonitoringsResult> Invoke(GetPrometheusMonitoringsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPrometheusMonitoringsResult> getPrometheusMonitorings(GetPrometheusMonitoringsArgs args, InvokeOptions options)
public static Output<GetPrometheusMonitoringsResult> getPrometheusMonitorings(GetPrometheusMonitoringsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:arms/getPrometheusMonitorings:getPrometheusMonitorings
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Prometheus instance.
Ids Changes to this property will trigger replacement. List<string>
A list of Prometheus Monitoring IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Prometheus Monitoring name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the monitoring configuration. Valid values: run, stop.
Type Changes to this property will trigger replacement. string
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Prometheus instance.
Ids Changes to this property will trigger replacement. []string
A list of Prometheus Monitoring IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Prometheus Monitoring name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the monitoring configuration. Valid values: run, stop.
Type Changes to this property will trigger replacement. string
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Prometheus instance.
ids Changes to this property will trigger replacement. List<String>
A list of Prometheus Monitoring IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Prometheus Monitoring name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the monitoring configuration. Valid values: run, stop.
type Changes to this property will trigger replacement. String
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
clusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Prometheus instance.
ids Changes to this property will trigger replacement. string[]
A list of Prometheus Monitoring IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Prometheus Monitoring name.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of the monitoring configuration. Valid values: run, stop.
type Changes to this property will trigger replacement. string
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
cluster_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Prometheus instance.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Prometheus Monitoring IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Prometheus Monitoring name.
output_file str
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. str
The status of the monitoring configuration. Valid values: run, stop.
type Changes to this property will trigger replacement. str
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Prometheus instance.
ids Changes to this property will trigger replacement. List<String>
A list of Prometheus Monitoring IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Prometheus Monitoring name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the monitoring configuration. Valid values: run, stop.
type Changes to this property will trigger replacement. String
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.

getPrometheusMonitorings Result

The following output properties are available:

ClusterId string
The ID of the Prometheus instance.
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
A list of Prometheus Monitoring names.
PrometheusMonitorings List<Pulumi.AliCloud.Arms.Outputs.GetPrometheusMonitoringsPrometheusMonitoring>
A list of Prometheus Monitorings. Each element contains the following attributes:
NameRegex string
OutputFile string
Status string
The status of the monitoring configuration.
Type string
The type of the monitoring configuration.
ClusterId string
The ID of the Prometheus instance.
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
A list of Prometheus Monitoring names.
PrometheusMonitorings []GetPrometheusMonitoringsPrometheusMonitoring
A list of Prometheus Monitorings. Each element contains the following attributes:
NameRegex string
OutputFile string
Status string
The status of the monitoring configuration.
Type string
The type of the monitoring configuration.
clusterId String
The ID of the Prometheus instance.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
A list of Prometheus Monitoring names.
prometheusMonitorings List<GetPrometheusMonitoringsPrometheusMonitoring>
A list of Prometheus Monitorings. Each element contains the following attributes:
nameRegex String
outputFile String
status String
The status of the monitoring configuration.
type String
The type of the monitoring configuration.
clusterId string
The ID of the Prometheus instance.
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
A list of Prometheus Monitoring names.
prometheusMonitorings GetPrometheusMonitoringsPrometheusMonitoring[]
A list of Prometheus Monitorings. Each element contains the following attributes:
nameRegex string
outputFile string
status string
The status of the monitoring configuration.
type string
The type of the monitoring configuration.
cluster_id str
The ID of the Prometheus instance.
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
A list of Prometheus Monitoring names.
prometheus_monitorings Sequence[GetPrometheusMonitoringsPrometheusMonitoring]
A list of Prometheus Monitorings. Each element contains the following attributes:
name_regex str
output_file str
status str
The status of the monitoring configuration.
type str
The type of the monitoring configuration.
clusterId String
The ID of the Prometheus instance.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
A list of Prometheus Monitoring names.
prometheusMonitorings List<Property Map>
A list of Prometheus Monitorings. Each element contains the following attributes:
nameRegex String
outputFile String
status String
The status of the monitoring configuration.
type String
The type of the monitoring configuration.

Supporting Types

GetPrometheusMonitoringsPrometheusMonitoring

ClusterId This property is required. string
The ID of the Prometheus instance.
ConfigYaml This property is required. string
The monitoring configuration. The value is a YAML string.
Id This property is required. string
The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
MonitoringName This property is required. string
The name of the monitoring configuration.
Status This property is required. string
The status of the monitoring configuration. Valid values: run, stop.
Type This property is required. string
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
ClusterId This property is required. string
The ID of the Prometheus instance.
ConfigYaml This property is required. string
The monitoring configuration. The value is a YAML string.
Id This property is required. string
The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
MonitoringName This property is required. string
The name of the monitoring configuration.
Status This property is required. string
The status of the monitoring configuration. Valid values: run, stop.
Type This property is required. string
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
clusterId This property is required. String
The ID of the Prometheus instance.
configYaml This property is required. String
The monitoring configuration. The value is a YAML string.
id This property is required. String
The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
monitoringName This property is required. String
The name of the monitoring configuration.
status This property is required. String
The status of the monitoring configuration. Valid values: run, stop.
type This property is required. String
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
clusterId This property is required. string
The ID of the Prometheus instance.
configYaml This property is required. string
The monitoring configuration. The value is a YAML string.
id This property is required. string
The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
monitoringName This property is required. string
The name of the monitoring configuration.
status This property is required. string
The status of the monitoring configuration. Valid values: run, stop.
type This property is required. string
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
cluster_id This property is required. str
The ID of the Prometheus instance.
config_yaml This property is required. str
The monitoring configuration. The value is a YAML string.
id This property is required. str
The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
monitoring_name This property is required. str
The name of the monitoring configuration.
status This property is required. str
The status of the monitoring configuration. Valid values: run, stop.
type This property is required. str
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
clusterId This property is required. String
The ID of the Prometheus instance.
configYaml This property is required. String
The monitoring configuration. The value is a YAML string.
id This property is required. String
The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
monitoringName This property is required. String
The name of the monitoring configuration.
status This property is required. String
The status of the monitoring configuration. Valid values: run, stop.
type This property is required. String
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.