1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. arms
  5. getPrometheis
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

alicloud.arms.getPrometheis

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

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

    NOTE: Available in v1.203.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Arms.GetPrometheis.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.Arms.GetPrometheis.Invoke(new()
        {
            NameRegex = "tf-example",
        });
    
        return new Dictionary<string, object?>
        {
            ["armsPrometheisId1"] = ids.Apply(getPrometheisResult => getPrometheisResult.Prometheis[0]?.Id),
            ["armsPrometheisId2"] = nameRegex.Apply(getPrometheisResult => getPrometheisResult.Prometheis[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.GetPrometheis(ctx, &arms.GetPrometheisArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsPrometheisId1", ids.Prometheis[0].Id)
    		nameRegex, err := arms.GetPrometheis(ctx, &arms.GetPrometheisArgs{
    			NameRegex: pulumi.StringRef("tf-example"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsPrometheisId2", nameRegex.Prometheis[0].Id)
    		return nil
    	})
    }
    
    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.GetPrometheisArgs;
    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.getPrometheis(GetPrometheisArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("armsPrometheisId1", ids.applyValue(getPrometheisResult -> getPrometheisResult.prometheis()[0].id()));
            final var nameRegex = ArmsFunctions.getPrometheis(GetPrometheisArgs.builder()
                .nameRegex("tf-example")
                .build());
    
            ctx.export("armsPrometheisId2", nameRegex.applyValue(getPrometheisResult -> getPrometheisResult.prometheis()[0].id()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.arms.get_prometheis(ids=["example_id"])
    pulumi.export("armsPrometheisId1", ids.prometheis[0].id)
    name_regex = alicloud.arms.get_prometheis(name_regex="tf-example")
    pulumi.export("armsPrometheisId2", name_regex.prometheis[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.arms.getPrometheis({
        ids: ["example_id"],
    });
    export const armsPrometheisId1 = ids.then(ids => ids.prometheis?.[0]?.id);
    const nameRegex = alicloud.arms.getPrometheis({
        nameRegex: "tf-example",
    });
    export const armsPrometheisId2 = nameRegex.then(nameRegex => nameRegex.prometheis?.[0]?.id);
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:arms:getPrometheis
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:arms:getPrometheis
          Arguments:
            nameRegex: tf-example
    outputs:
      armsPrometheisId1: ${ids.prometheis[0].id}
      armsPrometheisId2: ${nameRegex.prometheis[0].id}
    

    Using getPrometheis

    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 getPrometheis(args: GetPrometheisArgs, opts?: InvokeOptions): Promise<GetPrometheisResult>
    function getPrometheisOutput(args: GetPrometheisOutputArgs, opts?: InvokeOptions): Output<GetPrometheisResult>
    def get_prometheis(ids: Optional[Sequence[str]] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       resource_group_id: Optional[str] = None,
                       tags: Optional[Mapping[str, Any]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetPrometheisResult
    def get_prometheis_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       name_regex: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       resource_group_id: Optional[pulumi.Input[str]] = None,
                       tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetPrometheisResult]
    func GetPrometheis(ctx *Context, args *GetPrometheisArgs, opts ...InvokeOption) (*GetPrometheisResult, error)
    func GetPrometheisOutput(ctx *Context, args *GetPrometheisOutputArgs, opts ...InvokeOption) GetPrometheisResultOutput

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

    public static class GetPrometheis 
    {
        public static Task<GetPrometheisResult> InvokeAsync(GetPrometheisArgs args, InvokeOptions? opts = null)
        public static Output<GetPrometheisResult> Invoke(GetPrometheisInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPrometheisResult> getPrometheis(GetPrometheisArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:arms/getPrometheis:getPrometheis
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>

    A list of Prometheus IDs.

    NameRegex string

    A regex string to filter results by Prometheus name.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    ResourceGroupId string

    The ID of the resource group.

    Tags Dictionary<string, object>

    A mapping of tags to assign to the resource.

    Ids []string

    A list of Prometheus IDs.

    NameRegex string

    A regex string to filter results by Prometheus name.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    ResourceGroupId string

    The ID of the resource group.

    Tags map[string]interface{}

    A mapping of tags to assign to the resource.

    ids List<String>

    A list of Prometheus IDs.

    nameRegex String

    A regex string to filter results by Prometheus name.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    resourceGroupId String

    The ID of the resource group.

    tags Map<String,Object>

    A mapping of tags to assign to the resource.

    ids string[]

    A list of Prometheus IDs.

    nameRegex string

    A regex string to filter results by Prometheus name.

    outputFile string

    File name where to save data source results (after running pulumi preview).

    resourceGroupId string

    The ID of the resource group.

    tags {[key: string]: any}

    A mapping of tags to assign to the resource.

    ids Sequence[str]

    A list of Prometheus IDs.

    name_regex str

    A regex string to filter results by Prometheus name.

    output_file str

    File name where to save data source results (after running pulumi preview).

    resource_group_id str

    The ID of the resource group.

    tags Mapping[str, Any]

    A mapping of tags to assign to the resource.

    ids List<String>

    A list of Prometheus IDs.

    nameRegex String

    A regex string to filter results by Prometheus name.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    resourceGroupId String

    The ID of the resource group.

    tags Map<Any>

    A mapping of tags to assign to the resource.

    getPrometheis Result

    The following output properties are available:

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids List<string>
    Names List<string>

    A list of Prometheus names.

    Prometheis List<Pulumi.AliCloud.Arms.Outputs.GetPrometheisPromethei>

    A list of Prometheis. Each element contains the following attributes:

    NameRegex string
    OutputFile string
    ResourceGroupId string

    The ID of the resource group.

    Tags Dictionary<string, object>

    The tag of the Prometheus.

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids []string
    Names []string

    A list of Prometheus names.

    Prometheis []GetPrometheisPromethei

    A list of Prometheis. Each element contains the following attributes:

    NameRegex string
    OutputFile string
    ResourceGroupId string

    The ID of the resource group.

    Tags map[string]interface{}

    The tag of the Prometheus.

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>

    A list of Prometheus names.

    prometheis List<GetPrometheisPromethei>

    A list of Prometheis. Each element contains the following attributes:

    nameRegex String
    outputFile String
    resourceGroupId String

    The ID of the resource group.

    tags Map<String,Object>

    The tag of the Prometheus.

    id string

    The provider-assigned unique ID for this managed resource.

    ids string[]
    names string[]

    A list of Prometheus names.

    prometheis GetPrometheisPromethei[]

    A list of Prometheis. Each element contains the following attributes:

    nameRegex string
    outputFile string
    resourceGroupId string

    The ID of the resource group.

    tags {[key: string]: any}

    The tag of the Prometheus.

    id str

    The provider-assigned unique ID for this managed resource.

    ids Sequence[str]
    names Sequence[str]

    A list of Prometheus names.

    prometheis Sequence[GetPrometheisPromethei]

    A list of Prometheis. Each element contains the following attributes:

    name_regex str
    output_file str
    resource_group_id str

    The ID of the resource group.

    tags Mapping[str, Any]

    The tag of the Prometheus.

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>

    A list of Prometheus names.

    prometheis List<Property Map>

    A list of Prometheis. Each element contains the following attributes:

    nameRegex String
    outputFile String
    resourceGroupId String

    The ID of the resource group.

    tags Map<Any>

    The tag of the Prometheus.

    Supporting Types

    GetPrometheisPromethei

    ClusterId string

    The ID of the cluster.

    ClusterName string

    The name of the cluster.

    ClusterType string

    The type of the cluster.

    GrafanaInstanceId string

    The ID of the Grafana workspace.

    Id string

    The ID of the Prometheus.

    ResourceGroupId string

    The ID of the resource group.

    SecurityGroupId string

    The ID of the security group.

    SubClustersJson string

    The child instance json string of the globalView instance.

    Tags Dictionary<string, object>

    A mapping of tags to assign to the resource.

    VpcId string

    The ID of the VPC.

    VswitchId string

    The ID of the VSwitch.

    ClusterId string

    The ID of the cluster.

    ClusterName string

    The name of the cluster.

    ClusterType string

    The type of the cluster.

    GrafanaInstanceId string

    The ID of the Grafana workspace.

    Id string

    The ID of the Prometheus.

    ResourceGroupId string

    The ID of the resource group.

    SecurityGroupId string

    The ID of the security group.

    SubClustersJson string

    The child instance json string of the globalView instance.

    Tags map[string]interface{}

    A mapping of tags to assign to the resource.

    VpcId string

    The ID of the VPC.

    VswitchId string

    The ID of the VSwitch.

    clusterId String

    The ID of the cluster.

    clusterName String

    The name of the cluster.

    clusterType String

    The type of the cluster.

    grafanaInstanceId String

    The ID of the Grafana workspace.

    id String

    The ID of the Prometheus.

    resourceGroupId String

    The ID of the resource group.

    securityGroupId String

    The ID of the security group.

    subClustersJson String

    The child instance json string of the globalView instance.

    tags Map<String,Object>

    A mapping of tags to assign to the resource.

    vpcId String

    The ID of the VPC.

    vswitchId String

    The ID of the VSwitch.

    clusterId string

    The ID of the cluster.

    clusterName string

    The name of the cluster.

    clusterType string

    The type of the cluster.

    grafanaInstanceId string

    The ID of the Grafana workspace.

    id string

    The ID of the Prometheus.

    resourceGroupId string

    The ID of the resource group.

    securityGroupId string

    The ID of the security group.

    subClustersJson string

    The child instance json string of the globalView instance.

    tags {[key: string]: any}

    A mapping of tags to assign to the resource.

    vpcId string

    The ID of the VPC.

    vswitchId string

    The ID of the VSwitch.

    cluster_id str

    The ID of the cluster.

    cluster_name str

    The name of the cluster.

    cluster_type str

    The type of the cluster.

    grafana_instance_id str

    The ID of the Grafana workspace.

    id str

    The ID of the Prometheus.

    resource_group_id str

    The ID of the resource group.

    security_group_id str

    The ID of the security group.

    sub_clusters_json str

    The child instance json string of the globalView instance.

    tags Mapping[str, Any]

    A mapping of tags to assign to the resource.

    vpc_id str

    The ID of the VPC.

    vswitch_id str

    The ID of the VSwitch.

    clusterId String

    The ID of the cluster.

    clusterName String

    The name of the cluster.

    clusterType String

    The type of the cluster.

    grafanaInstanceId String

    The ID of the Grafana workspace.

    id String

    The ID of the Prometheus.

    resourceGroupId String

    The ID of the resource group.

    securityGroupId String

    The ID of the security group.

    subClustersJson String

    The child instance json string of the globalView instance.

    tags Map<Any>

    A mapping of tags to assign to the resource.

    vpcId String

    The ID of the VPC.

    vswitchId String

    The ID of the VSwitch.

    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.45.0 published on Monday, Nov 27, 2023 by Pulumi