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

alicloud.dms.getUserTenants

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides a list of DMS User Tenants in an Alibaba Cloud account according to the specified filters.

NOTE: Available in 1.161.0+

Example Usage

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

// Declare the data source
const _default = alicloud.dms.getUserTenants({
    status: "ACTIVE",
});
export const tid = _default.then(_default => _default.ids?.[0]);
Copy
import pulumi
import pulumi_alicloud as alicloud

# Declare the data source
default = alicloud.dms.get_user_tenants(status="ACTIVE")
pulumi.export("tid", default.ids[0])
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Declare the data source
		_default, err := dms.GetUserTenants(ctx, &dms.GetUserTenantsArgs{
			Status: pulumi.StringRef("ACTIVE"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("tid", _default.Ids[0])
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    // Declare the data source
    var @default = AliCloud.Dms.GetUserTenants.Invoke(new()
    {
        Status = "ACTIVE",
    });

    return new Dictionary<string, object?>
    {
        ["tid"] = @default.Apply(@default => @default.Apply(getUserTenantsResult => getUserTenantsResult.Ids[0])),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dms.DmsFunctions;
import com.pulumi.alicloud.dms.inputs.GetUserTenantsArgs;
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) {
        // Declare the data source
        final var default = DmsFunctions.getUserTenants(GetUserTenantsArgs.builder()
            .status("ACTIVE")
            .build());

        ctx.export("tid", default_.ids()[0]);
    }
}
Copy
variables:
  # Declare the data source
  default:
    fn::invoke:
      function: alicloud:dms:getUserTenants
      arguments:
        status: ACTIVE
outputs:
  tid: ${default.ids[0]}
Copy

Using getUserTenants

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 getUserTenants(args: GetUserTenantsArgs, opts?: InvokeOptions): Promise<GetUserTenantsResult>
function getUserTenantsOutput(args: GetUserTenantsOutputArgs, opts?: InvokeOptions): Output<GetUserTenantsResult>
Copy
def get_user_tenants(ids: Optional[Sequence[str]] = None,
                     output_file: Optional[str] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetUserTenantsResult
def get_user_tenants_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetUserTenantsResult]
Copy
func GetUserTenants(ctx *Context, args *GetUserTenantsArgs, opts ...InvokeOption) (*GetUserTenantsResult, error)
func GetUserTenantsOutput(ctx *Context, args *GetUserTenantsOutputArgs, opts ...InvokeOption) GetUserTenantsResultOutput
Copy

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

public static class GetUserTenants 
{
    public static Task<GetUserTenantsResult> InvokeAsync(GetUserTenantsArgs args, InvokeOptions? opts = null)
    public static Output<GetUserTenantsResult> Invoke(GetUserTenantsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetUserTenantsResult> getUserTenants(GetUserTenantsArgs args, InvokeOptions options)
public static Output<GetUserTenantsResult> getUserTenants(GetUserTenantsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:dms/getUserTenants:getUserTenants
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids List<string>
A list of DMS User Tenant IDs (TID).
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 user tenant.
Ids []string
A list of DMS User Tenant IDs (TID).
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 user tenant.
ids List<String>
A list of DMS User Tenant IDs (TID).
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 user tenant.
ids string[]
A list of DMS User Tenant IDs (TID).
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 user tenant.
ids Sequence[str]
A list of DMS User Tenant IDs (TID).
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 user tenant.
ids List<String>
A list of DMS User Tenant IDs (TID).
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 user tenant.

getUserTenants Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
A list of DMS User Tenant IDs (UID).
Names List<string>
A list of DMS User Tenant names.
Tenants List<Pulumi.AliCloud.Dms.Outputs.GetUserTenantsTenant>
A list of DMS User Tenants. Each element contains the following attributes:
OutputFile string
Status string
The status of the user tenant.
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of DMS User Tenant IDs (UID).
Names []string
A list of DMS User Tenant names.
Tenants []GetUserTenantsTenant
A list of DMS User Tenants. Each element contains the following attributes:
OutputFile string
Status string
The status of the user tenant.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of DMS User Tenant IDs (UID).
names List<String>
A list of DMS User Tenant names.
tenants List<GetUserTenantsTenant>
A list of DMS User Tenants. Each element contains the following attributes:
outputFile String
status String
The status of the user tenant.
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of DMS User Tenant IDs (UID).
names string[]
A list of DMS User Tenant names.
tenants GetUserTenantsTenant[]
A list of DMS User Tenants. Each element contains the following attributes:
outputFile string
status string
The status of the user tenant.
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of DMS User Tenant IDs (UID).
names Sequence[str]
A list of DMS User Tenant names.
tenants Sequence[GetUserTenantsTenant]
A list of DMS User Tenants. Each element contains the following attributes:
output_file str
status str
The status of the user tenant.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of DMS User Tenant IDs (UID).
names List<String>
A list of DMS User Tenant names.
tenants List<Property Map>
A list of DMS User Tenants. Each element contains the following attributes:
outputFile String
status String
The status of the user tenant.

Supporting Types

GetUserTenantsTenant

Id This property is required. string
The user tenant id.
Status This property is required. string
The status of the user tenant.
TenantName This property is required. string
The name of the user tenant.
Tid This property is required. string
The user tenant id. Same as id.
Id This property is required. string
The user tenant id.
Status This property is required. string
The status of the user tenant.
TenantName This property is required. string
The name of the user tenant.
Tid This property is required. string
The user tenant id. Same as id.
id This property is required. String
The user tenant id.
status This property is required. String
The status of the user tenant.
tenantName This property is required. String
The name of the user tenant.
tid This property is required. String
The user tenant id. Same as id.
id This property is required. string
The user tenant id.
status This property is required. string
The status of the user tenant.
tenantName This property is required. string
The name of the user tenant.
tid This property is required. string
The user tenant id. Same as id.
id This property is required. str
The user tenant id.
status This property is required. str
The status of the user tenant.
tenant_name This property is required. str
The name of the user tenant.
tid This property is required. str
The user tenant id. Same as id.
id This property is required. String
The user tenant id.
status This property is required. String
The status of the user tenant.
tenantName This property is required. String
The name of the user tenant.
tid This property is required. String
The user tenant id. Same as id.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi