1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. arms
  5. getPrometheusMonitorings
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.arms.getPrometheusMonitorings

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetPrometheusMonitorings(ctx *Context, args *GetPrometheusMonitoringsArgs, opts ...InvokeOption) (*GetPrometheusMonitoringsResult, error)
    func GetPrometheusMonitoringsOutput(ctx *Context, args *GetPrometheusMonitoringsOutputArgs, opts ...InvokeOption) GetPrometheusMonitoringsResultOutput

    > 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)
    }
    public static CompletableFuture<GetPrometheusMonitoringsResult> getPrometheusMonitorings(GetPrometheusMonitoringsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:arms/getPrometheusMonitorings:getPrometheusMonitorings
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    The ID of the Prometheus instance.
    Ids List<string>
    A list of Prometheus Monitoring IDs.
    NameRegex 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 string
    The status of the monitoring configuration. Valid values: run, stop.
    Type string
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    ClusterId string
    The ID of the Prometheus instance.
    Ids []string
    A list of Prometheus Monitoring IDs.
    NameRegex 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 string
    The status of the monitoring configuration. Valid values: run, stop.
    Type string
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    clusterId String
    The ID of the Prometheus instance.
    ids List<String>
    A list of Prometheus Monitoring IDs.
    nameRegex 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 String
    The status of the monitoring configuration. Valid values: run, stop.
    type String
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    clusterId string
    The ID of the Prometheus instance.
    ids string[]
    A list of Prometheus Monitoring IDs.
    nameRegex 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 string
    The status of the monitoring configuration. Valid values: run, stop.
    type string
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    cluster_id str
    The ID of the Prometheus instance.
    ids Sequence[str]
    A list of Prometheus Monitoring IDs.
    name_regex 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 str
    The status of the monitoring configuration. Valid values: run, stop.
    type str
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    clusterId String
    The ID of the Prometheus instance.
    ids List<String>
    A list of Prometheus Monitoring IDs.
    nameRegex 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 String
    The status of the monitoring configuration. Valid values: run, stop.
    type 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 string
    The ID of the Prometheus instance.
    ConfigYaml string
    The monitoring configuration. The value is a YAML string.
    Id string
    The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
    MonitoringName string
    The name of the monitoring configuration.
    Status string
    The status of the monitoring configuration. Valid values: run, stop.
    Type string
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    ClusterId string
    The ID of the Prometheus instance.
    ConfigYaml string
    The monitoring configuration. The value is a YAML string.
    Id string
    The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
    MonitoringName string
    The name of the monitoring configuration.
    Status string
    The status of the monitoring configuration. Valid values: run, stop.
    Type string
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    clusterId String
    The ID of the Prometheus instance.
    configYaml String
    The monitoring configuration. The value is a YAML string.
    id String
    The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
    monitoringName String
    The name of the monitoring configuration.
    status String
    The status of the monitoring configuration. Valid values: run, stop.
    type String
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    clusterId string
    The ID of the Prometheus instance.
    configYaml string
    The monitoring configuration. The value is a YAML string.
    id string
    The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
    monitoringName string
    The name of the monitoring configuration.
    status string
    The status of the monitoring configuration. Valid values: run, stop.
    type string
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    cluster_id str
    The ID of the Prometheus instance.
    config_yaml str
    The monitoring configuration. The value is a YAML string.
    id str
    The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
    monitoring_name str
    The name of the monitoring configuration.
    status str
    The status of the monitoring configuration. Valid values: run, stop.
    type str
    The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, probe.
    clusterId String
    The ID of the Prometheus instance.
    configYaml String
    The monitoring configuration. The value is a YAML string.
    id String
    The ID of the Prometheus Monitoring. It formats as <cluster_id>:<monitoring_name>:<type>.
    monitoringName String
    The name of the monitoring configuration.
    status String
    The status of the monitoring configuration. Valid values: run, stop.
    type 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.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi