1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. arms
  5. getRemoteWrites
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

alicloud.arms.getRemoteWrites

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

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

    NOTE: Available in v1.204.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.arms.getRemoteWrites({
        ids: ["example_id"],
        clusterId: "your_cluster_id",
    });
    export const armsRemoteWritesId1 = ids.then(ids => ids.remoteWrites?.[0]?.id);
    const nameRegex = alicloud.arms.getRemoteWrites({
        nameRegex: "tf-example",
        clusterId: "your_cluster_id",
    });
    export const armsRemoteWritesId2 = nameRegex.then(nameRegex => nameRegex.remoteWrites?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.arms.get_remote_writes(ids=["example_id"],
        cluster_id="your_cluster_id")
    pulumi.export("armsRemoteWritesId1", ids.remote_writes[0].id)
    name_regex = alicloud.arms.get_remote_writes(name_regex="tf-example",
        cluster_id="your_cluster_id")
    pulumi.export("armsRemoteWritesId2", name_regex.remote_writes[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.GetRemoteWrites(ctx, &arms.GetRemoteWritesArgs{
    			Ids: []string{
    				"example_id",
    			},
    			ClusterId: "your_cluster_id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsRemoteWritesId1", ids.RemoteWrites[0].Id)
    		nameRegex, err := arms.GetRemoteWrites(ctx, &arms.GetRemoteWritesArgs{
    			NameRegex: pulumi.StringRef("tf-example"),
    			ClusterId: "your_cluster_id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsRemoteWritesId2", nameRegex.RemoteWrites[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.GetRemoteWrites.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
            ClusterId = "your_cluster_id",
        });
    
        var nameRegex = AliCloud.Arms.GetRemoteWrites.Invoke(new()
        {
            NameRegex = "tf-example",
            ClusterId = "your_cluster_id",
        });
    
        return new Dictionary<string, object?>
        {
            ["armsRemoteWritesId1"] = ids.Apply(getRemoteWritesResult => getRemoteWritesResult.RemoteWrites[0]?.Id),
            ["armsRemoteWritesId2"] = nameRegex.Apply(getRemoteWritesResult => getRemoteWritesResult.RemoteWrites[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.GetRemoteWritesArgs;
    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.getRemoteWrites(GetRemoteWritesArgs.builder()
                .ids("example_id")
                .clusterId("your_cluster_id")
                .build());
    
            ctx.export("armsRemoteWritesId1", ids.applyValue(getRemoteWritesResult -> getRemoteWritesResult.remoteWrites()[0].id()));
            final var nameRegex = ArmsFunctions.getRemoteWrites(GetRemoteWritesArgs.builder()
                .nameRegex("tf-example")
                .clusterId("your_cluster_id")
                .build());
    
            ctx.export("armsRemoteWritesId2", nameRegex.applyValue(getRemoteWritesResult -> getRemoteWritesResult.remoteWrites()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:arms:getRemoteWrites
          Arguments:
            ids:
              - example_id
            clusterId: your_cluster_id
      nameRegex:
        fn::invoke:
          Function: alicloud:arms:getRemoteWrites
          Arguments:
            nameRegex: tf-example
            clusterId: your_cluster_id
    outputs:
      armsRemoteWritesId1: ${ids.remoteWrites[0].id}
      armsRemoteWritesId2: ${nameRegex.remoteWrites[0].id}
    

    Using getRemoteWrites

    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 getRemoteWrites(args: GetRemoteWritesArgs, opts?: InvokeOptions): Promise<GetRemoteWritesResult>
    function getRemoteWritesOutput(args: GetRemoteWritesOutputArgs, opts?: InvokeOptions): Output<GetRemoteWritesResult>
    def get_remote_writes(cluster_id: Optional[str] = None,
                          ids: Optional[Sequence[str]] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetRemoteWritesResult
    def get_remote_writes_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,
                          opts: Optional[InvokeOptions] = None) -> Output[GetRemoteWritesResult]
    func GetRemoteWrites(ctx *Context, args *GetRemoteWritesArgs, opts ...InvokeOption) (*GetRemoteWritesResult, error)
    func GetRemoteWritesOutput(ctx *Context, args *GetRemoteWritesOutputArgs, opts ...InvokeOption) GetRemoteWritesResultOutput

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

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

    The following arguments are supported:

    ClusterId string
    The ID of the Prometheus instance.
    Ids List<string>
    A list of Remote Write IDs.
    NameRegex string
    A regex string to filter results by Remote Write name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ClusterId string
    The ID of the Prometheus instance.
    Ids []string
    A list of Remote Write IDs.
    NameRegex string
    A regex string to filter results by Remote Write name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    clusterId String
    The ID of the Prometheus instance.
    ids List<String>
    A list of Remote Write IDs.
    nameRegex String
    A regex string to filter results by Remote Write name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    clusterId string
    The ID of the Prometheus instance.
    ids string[]
    A list of Remote Write IDs.
    nameRegex string
    A regex string to filter results by Remote Write name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    cluster_id str
    The ID of the Prometheus instance.
    ids Sequence[str]
    A list of Remote Write IDs.
    name_regex str
    A regex string to filter results by Remote Write name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    clusterId String
    The ID of the Prometheus instance.
    ids List<String>
    A list of Remote Write IDs.
    nameRegex String
    A regex string to filter results by Remote Write name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getRemoteWrites 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 Remote Write names.
    RemoteWrites List<Pulumi.AliCloud.Arms.Outputs.GetRemoteWritesRemoteWrite>
    A list of Remote Writes. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    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 Remote Write names.
    RemoteWrites []GetRemoteWritesRemoteWrite
    A list of Remote Writes. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    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 Remote Write names.
    remoteWrites List<GetRemoteWritesRemoteWrite>
    A list of Remote Writes. Each element contains the following attributes:
    nameRegex String
    outputFile String
    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 Remote Write names.
    remoteWrites GetRemoteWritesRemoteWrite[]
    A list of Remote Writes. Each element contains the following attributes:
    nameRegex string
    outputFile string
    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 Remote Write names.
    remote_writes Sequence[GetRemoteWritesRemoteWrite]
    A list of Remote Writes. Each element contains the following attributes:
    name_regex str
    output_file str
    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 Remote Write names.
    remoteWrites List<Property Map>
    A list of Remote Writes. Each element contains the following attributes:
    nameRegex String
    outputFile String

    Supporting Types

    GetRemoteWritesRemoteWrite

    ClusterId string
    The ID of the Prometheus instance.
    Id string
    The ID of the Remote Write. It formats as <cluster_id>:<remote_write_name>.
    RemoteWriteName string
    The name of the Remote Write configuration item.
    RemoteWriteYaml string
    The details of the Remote Write configuration item. The value is in the YAML format.
    ClusterId string
    The ID of the Prometheus instance.
    Id string
    The ID of the Remote Write. It formats as <cluster_id>:<remote_write_name>.
    RemoteWriteName string
    The name of the Remote Write configuration item.
    RemoteWriteYaml string
    The details of the Remote Write configuration item. The value is in the YAML format.
    clusterId String
    The ID of the Prometheus instance.
    id String
    The ID of the Remote Write. It formats as <cluster_id>:<remote_write_name>.
    remoteWriteName String
    The name of the Remote Write configuration item.
    remoteWriteYaml String
    The details of the Remote Write configuration item. The value is in the YAML format.
    clusterId string
    The ID of the Prometheus instance.
    id string
    The ID of the Remote Write. It formats as <cluster_id>:<remote_write_name>.
    remoteWriteName string
    The name of the Remote Write configuration item.
    remoteWriteYaml string
    The details of the Remote Write configuration item. The value is in the YAML format.
    cluster_id str
    The ID of the Prometheus instance.
    id str
    The ID of the Remote Write. It formats as <cluster_id>:<remote_write_name>.
    remote_write_name str
    The name of the Remote Write configuration item.
    remote_write_yaml str
    The details of the Remote Write configuration item. The value is in the YAML format.
    clusterId String
    The ID of the Prometheus instance.
    id String
    The ID of the Remote Write. It formats as <cluster_id>:<remote_write_name>.
    remoteWriteName String
    The name of the Remote Write configuration item.
    remoteWriteYaml String
    The details of the Remote Write configuration item. The value is in the YAML format.

    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.55.0 published on Tuesday, Apr 30, 2024 by Pulumi