1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cloudmonitor
  5. getServiceHybridDoubleWrites
Alibaba Cloud v3.55.1 published on Tuesday, May 14, 2024 by Pulumi

alicloud.cloudmonitor.getServiceHybridDoubleWrites

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.55.1 published on Tuesday, May 14, 2024 by Pulumi

    This data source provides the Cloud Monitor Service Hybrid Double Writes of the current Alibaba Cloud user.

    NOTE: Available since v1.220.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.getAccount({});
    const source = new alicloud.cms.Namespace("source", {namespace: "your-source-namespace"});
    const defaultNamespace = new alicloud.cms.Namespace("default", {namespace: "your-namespace"});
    const defaultServiceHybridDoubleWrite = new alicloud.cloudmonitor.ServiceHybridDoubleWrite("default", {
        sourceNamespace: source.id,
        sourceUserId: _default.then(_default => _default.id),
        namespace: defaultNamespace.id,
        userId: _default.then(_default => _default.id),
    });
    const ids = alicloud.cloudmonitor.getServiceHybridDoubleWritesOutput({
        ids: [defaultServiceHybridDoubleWrite.id],
    });
    export const cloudMonitorServiceHybridDoubleWritesId1 = ids.apply(ids => ids.hybridDoubleWrites?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.get_account()
    source = alicloud.cms.Namespace("source", namespace="your-source-namespace")
    default_namespace = alicloud.cms.Namespace("default", namespace="your-namespace")
    default_service_hybrid_double_write = alicloud.cloudmonitor.ServiceHybridDoubleWrite("default",
        source_namespace=source.id,
        source_user_id=default.id,
        namespace=default_namespace.id,
        user_id=default.id)
    ids = alicloud.cloudmonitor.get_service_hybrid_double_writes_output(ids=[default_service_hybrid_double_write.id])
    pulumi.export("cloudMonitorServiceHybridDoubleWritesId1", ids.hybrid_double_writes[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudmonitor"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := alicloud.GetAccount(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		source, err := cms.NewNamespace(ctx, "source", &cms.NamespaceArgs{
    			Namespace: pulumi.String("your-source-namespace"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultNamespace, err := cms.NewNamespace(ctx, "default", &cms.NamespaceArgs{
    			Namespace: pulumi.String("your-namespace"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultServiceHybridDoubleWrite, err := cloudmonitor.NewServiceHybridDoubleWrite(ctx, "default", &cloudmonitor.ServiceHybridDoubleWriteArgs{
    			SourceNamespace: source.ID(),
    			SourceUserId:    pulumi.String(_default.Id),
    			Namespace:       defaultNamespace.ID(),
    			UserId:          pulumi.String(_default.Id),
    		})
    		if err != nil {
    			return err
    		}
    		ids := cloudmonitor.GetServiceHybridDoubleWritesOutput(ctx, cloudmonitor.GetServiceHybridDoubleWritesOutputArgs{
    			Ids: pulumi.StringArray{
    				defaultServiceHybridDoubleWrite.ID(),
    			},
    		}, nil)
    		ctx.Export("cloudMonitorServiceHybridDoubleWritesId1", ids.ApplyT(func(ids cloudmonitor.GetServiceHybridDoubleWritesResult) (*string, error) {
    			return &ids.HybridDoubleWrites[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.GetAccount.Invoke();
    
        var source = new AliCloud.Cms.Namespace("source", new()
        {
            NamespaceName = "your-source-namespace",
        });
    
        var defaultNamespace = new AliCloud.Cms.Namespace("default", new()
        {
            NamespaceName = "your-namespace",
        });
    
        var defaultServiceHybridDoubleWrite = new AliCloud.CloudMonitor.ServiceHybridDoubleWrite("default", new()
        {
            SourceNamespace = source.Id,
            SourceUserId = @default.Apply(@default => @default.Apply(getAccountResult => getAccountResult.Id)),
            Namespace = defaultNamespace.Id,
            UserId = @default.Apply(@default => @default.Apply(getAccountResult => getAccountResult.Id)),
        });
    
        var ids = AliCloud.CloudMonitor.GetServiceHybridDoubleWrites.Invoke(new()
        {
            Ids = new[]
            {
                defaultServiceHybridDoubleWrite.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudMonitorServiceHybridDoubleWritesId1"] = ids.Apply(getServiceHybridDoubleWritesResult => getServiceHybridDoubleWritesResult.HybridDoubleWrites[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.cms.Namespace;
    import com.pulumi.alicloud.cms.NamespaceArgs;
    import com.pulumi.alicloud.cloudmonitor.ServiceHybridDoubleWrite;
    import com.pulumi.alicloud.cloudmonitor.ServiceHybridDoubleWriteArgs;
    import com.pulumi.alicloud.cloudmonitor.CloudmonitorFunctions;
    import com.pulumi.alicloud.cloudmonitor.inputs.GetServiceHybridDoubleWritesArgs;
    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 default = AlicloudFunctions.getAccount();
    
            var source = new Namespace("source", NamespaceArgs.builder()        
                .namespace("your-source-namespace")
                .build());
    
            var defaultNamespace = new Namespace("defaultNamespace", NamespaceArgs.builder()        
                .namespace("your-namespace")
                .build());
    
            var defaultServiceHybridDoubleWrite = new ServiceHybridDoubleWrite("defaultServiceHybridDoubleWrite", ServiceHybridDoubleWriteArgs.builder()        
                .sourceNamespace(source.id())
                .sourceUserId(default_.id())
                .namespace(defaultNamespace.id())
                .userId(default_.id())
                .build());
    
            final var ids = CloudmonitorFunctions.getServiceHybridDoubleWrites(GetServiceHybridDoubleWritesArgs.builder()
                .ids(defaultServiceHybridDoubleWrite.id())
                .build());
    
            ctx.export("cloudMonitorServiceHybridDoubleWritesId1", ids.applyValue(getServiceHybridDoubleWritesResult -> getServiceHybridDoubleWritesResult).applyValue(ids -> ids.applyValue(getServiceHybridDoubleWritesResult -> getServiceHybridDoubleWritesResult.hybridDoubleWrites()[0].id())));
        }
    }
    
    resources:
      source:
        type: alicloud:cms:Namespace
        properties:
          namespace: your-source-namespace
      defaultNamespace:
        type: alicloud:cms:Namespace
        name: default
        properties:
          namespace: your-namespace
      defaultServiceHybridDoubleWrite:
        type: alicloud:cloudmonitor:ServiceHybridDoubleWrite
        name: default
        properties:
          sourceNamespace: ${source.id}
          sourceUserId: ${default.id}
          namespace: ${defaultNamespace.id}
          userId: ${default.id}
    variables:
      default:
        fn::invoke:
          Function: alicloud:getAccount
          Arguments: {}
      ids:
        fn::invoke:
          Function: alicloud:cloudmonitor:getServiceHybridDoubleWrites
          Arguments:
            ids:
              - ${defaultServiceHybridDoubleWrite.id}
    outputs:
      cloudMonitorServiceHybridDoubleWritesId1: ${ids.hybridDoubleWrites[0].id}
    

    Using getServiceHybridDoubleWrites

    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 getServiceHybridDoubleWrites(args: GetServiceHybridDoubleWritesArgs, opts?: InvokeOptions): Promise<GetServiceHybridDoubleWritesResult>
    function getServiceHybridDoubleWritesOutput(args: GetServiceHybridDoubleWritesOutputArgs, opts?: InvokeOptions): Output<GetServiceHybridDoubleWritesResult>
    def get_service_hybrid_double_writes(ids: Optional[Sequence[str]] = None,
                                         namespace: Optional[str] = None,
                                         output_file: Optional[str] = None,
                                         source_namespace: Optional[str] = None,
                                         source_user_id: Optional[str] = None,
                                         user_id: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetServiceHybridDoubleWritesResult
    def get_service_hybrid_double_writes_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                         namespace: Optional[pulumi.Input[str]] = None,
                                         output_file: Optional[pulumi.Input[str]] = None,
                                         source_namespace: Optional[pulumi.Input[str]] = None,
                                         source_user_id: Optional[pulumi.Input[str]] = None,
                                         user_id: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetServiceHybridDoubleWritesResult]
    func GetServiceHybridDoubleWrites(ctx *Context, args *GetServiceHybridDoubleWritesArgs, opts ...InvokeOption) (*GetServiceHybridDoubleWritesResult, error)
    func GetServiceHybridDoubleWritesOutput(ctx *Context, args *GetServiceHybridDoubleWritesOutputArgs, opts ...InvokeOption) GetServiceHybridDoubleWritesResultOutput

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

    public static class GetServiceHybridDoubleWrites 
    {
        public static Task<GetServiceHybridDoubleWritesResult> InvokeAsync(GetServiceHybridDoubleWritesArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceHybridDoubleWritesResult> Invoke(GetServiceHybridDoubleWritesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceHybridDoubleWritesResult> getServiceHybridDoubleWrites(GetServiceHybridDoubleWritesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cloudmonitor/getServiceHybridDoubleWrites:getServiceHybridDoubleWrites
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Hybrid Double Write IDs.
    Namespace string
    Target Namespace.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SourceNamespace string
    Source Namespace.
    SourceUserId string
    Source UserId.
    UserId string
    Target UserId.
    Ids []string
    A list of Hybrid Double Write IDs.
    Namespace string
    Target Namespace.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SourceNamespace string
    Source Namespace.
    SourceUserId string
    Source UserId.
    UserId string
    Target UserId.
    ids List<String>
    A list of Hybrid Double Write IDs.
    namespace String
    Target Namespace.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    sourceNamespace String
    Source Namespace.
    sourceUserId String
    Source UserId.
    userId String
    Target UserId.
    ids string[]
    A list of Hybrid Double Write IDs.
    namespace string
    Target Namespace.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    sourceNamespace string
    Source Namespace.
    sourceUserId string
    Source UserId.
    userId string
    Target UserId.
    ids Sequence[str]
    A list of Hybrid Double Write IDs.
    namespace str
    Target Namespace.
    output_file str
    File name where to save data source results (after running pulumi preview).
    source_namespace str
    Source Namespace.
    source_user_id str
    Source UserId.
    user_id str
    Target UserId.
    ids List<String>
    A list of Hybrid Double Write IDs.
    namespace String
    Target Namespace.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    sourceNamespace String
    Source Namespace.
    sourceUserId String
    Source UserId.
    userId String
    Target UserId.

    getServiceHybridDoubleWrites Result

    The following output properties are available:

    HybridDoubleWrites List<Pulumi.AliCloud.CloudMonitor.Outputs.GetServiceHybridDoubleWritesHybridDoubleWrite>
    A list of Hybrid Double Writes. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Namespace string
    Target Namespace.
    OutputFile string
    SourceNamespace string
    Source Namespace.
    SourceUserId string
    Source UserId.
    UserId string
    Target UserId.
    HybridDoubleWrites []GetServiceHybridDoubleWritesHybridDoubleWrite
    A list of Hybrid Double Writes. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Namespace string
    Target Namespace.
    OutputFile string
    SourceNamespace string
    Source Namespace.
    SourceUserId string
    Source UserId.
    UserId string
    Target UserId.
    hybridDoubleWrites List<GetServiceHybridDoubleWritesHybridDoubleWrite>
    A list of Hybrid Double Writes. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    namespace String
    Target Namespace.
    outputFile String
    sourceNamespace String
    Source Namespace.
    sourceUserId String
    Source UserId.
    userId String
    Target UserId.
    hybridDoubleWrites GetServiceHybridDoubleWritesHybridDoubleWrite[]
    A list of Hybrid Double Writes. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    namespace string
    Target Namespace.
    outputFile string
    sourceNamespace string
    Source Namespace.
    sourceUserId string
    Source UserId.
    userId string
    Target UserId.
    hybrid_double_writes Sequence[GetServiceHybridDoubleWritesHybridDoubleWrite]
    A list of Hybrid Double Writes. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    namespace str
    Target Namespace.
    output_file str
    source_namespace str
    Source Namespace.
    source_user_id str
    Source UserId.
    user_id str
    Target UserId.
    hybridDoubleWrites List<Property Map>
    A list of Hybrid Double Writes. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    namespace String
    Target Namespace.
    outputFile String
    sourceNamespace String
    Source Namespace.
    sourceUserId String
    Source UserId.
    userId String
    Target UserId.

    Supporting Types

    GetServiceHybridDoubleWritesHybridDoubleWrite

    Id string
    The ID of the Hybrid Double Write. It formats as <source_namespace>:<source_user_id>.
    Namespace string
    Target Namespace.
    SourceNamespace string
    Source Namespace.
    SourceUserId string
    Source UserId.
    UserId string
    Target UserId.
    Id string
    The ID of the Hybrid Double Write. It formats as <source_namespace>:<source_user_id>.
    Namespace string
    Target Namespace.
    SourceNamespace string
    Source Namespace.
    SourceUserId string
    Source UserId.
    UserId string
    Target UserId.
    id String
    The ID of the Hybrid Double Write. It formats as <source_namespace>:<source_user_id>.
    namespace String
    Target Namespace.
    sourceNamespace String
    Source Namespace.
    sourceUserId String
    Source UserId.
    userId String
    Target UserId.
    id string
    The ID of the Hybrid Double Write. It formats as <source_namespace>:<source_user_id>.
    namespace string
    Target Namespace.
    sourceNamespace string
    Source Namespace.
    sourceUserId string
    Source UserId.
    userId string
    Target UserId.
    id str
    The ID of the Hybrid Double Write. It formats as <source_namespace>:<source_user_id>.
    namespace str
    Target Namespace.
    source_namespace str
    Source Namespace.
    source_user_id str
    Source UserId.
    user_id str
    Target UserId.
    id String
    The ID of the Hybrid Double Write. It formats as <source_namespace>:<source_user_id>.
    namespace String
    Target Namespace.
    sourceNamespace String
    Source Namespace.
    sourceUserId String
    Source UserId.
    userId String
    Target UserId.

    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.1 published on Tuesday, May 14, 2024 by Pulumi