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

alicloud.rdc.getOrganizations

Explore with Pulumi AI

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

This data source provides the Rdc Organizations of the current Alibaba Cloud user.

NOTE: Available since v1.137.0.

DEPRECATED: This data source has been deprecated from version 1.238.0.

Example Usage

Basic Usage

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

const config = new pulumi.Config();
const name = config.get("name") || "tf-testAccOrganizations-Organizations";
const _default = new alicloud.rdc.Organization("default", {
    organizationName: name,
    source: name,
});
const ids = alicloud.rdc.getOrganizationsOutput({
    ids: [_default.id],
});
export const rdcOrganizationId1 = ids.apply(ids => ids.id);
const nameRegex = alicloud.rdc.getOrganizations({
    nameRegex: "^my-Organization",
});
export const rdcOrganizationId2 = nameRegex.then(nameRegex => nameRegex.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-testAccOrganizations-Organizations"
default = alicloud.rdc.Organization("default",
    organization_name=name,
    source=name)
ids = alicloud.rdc.get_organizations_output(ids=[default.id])
pulumi.export("rdcOrganizationId1", ids.id)
name_regex = alicloud.rdc.get_organizations(name_regex="^my-Organization")
pulumi.export("rdcOrganizationId2", name_regex.id)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "tf-testAccOrganizations-Organizations"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_default, err := rdc.NewOrganization(ctx, "default", &rdc.OrganizationArgs{
			OrganizationName: pulumi.String(name),
			Source:           pulumi.String(name),
		})
		if err != nil {
			return err
		}
		ids := rdc.GetOrganizationsOutput(ctx, rdc.GetOrganizationsOutputArgs{
			Ids: pulumi.StringArray{
				_default.ID(),
			},
		}, nil)
		ctx.Export("rdcOrganizationId1", ids.ApplyT(func(ids rdc.GetOrganizationsResult) (*string, error) {
			return &ids.Id, nil
		}).(pulumi.StringPtrOutput))
		nameRegex, err := rdc.GetOrganizations(ctx, &rdc.GetOrganizationsArgs{
			NameRegex: pulumi.StringRef("^my-Organization"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("rdcOrganizationId2", nameRegex.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "tf-testAccOrganizations-Organizations";
    var @default = new AliCloud.Rdc.Organization("default", new()
    {
        OrganizationName = name,
        Source = name,
    });

    var ids = AliCloud.Rdc.GetOrganizations.Invoke(new()
    {
        Ids = new[]
        {
            @default.Id,
        },
    });

    var nameRegex = AliCloud.Rdc.GetOrganizations.Invoke(new()
    {
        NameRegex = "^my-Organization",
    });

    return new Dictionary<string, object?>
    {
        ["rdcOrganizationId1"] = ids.Apply(getOrganizationsResult => getOrganizationsResult.Id),
        ["rdcOrganizationId2"] = nameRegex.Apply(getOrganizationsResult => getOrganizationsResult.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.rdc.Organization;
import com.pulumi.alicloud.rdc.OrganizationArgs;
import com.pulumi.alicloud.rdc.RdcFunctions;
import com.pulumi.alicloud.rdc.inputs.GetOrganizationsArgs;
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 config = ctx.config();
        final var name = config.get("name").orElse("tf-testAccOrganizations-Organizations");
        var default_ = new Organization("default", OrganizationArgs.builder()
            .organizationName(name)
            .source(name)
            .build());

        final var ids = RdcFunctions.getOrganizations(GetOrganizationsArgs.builder()
            .ids(default_.id())
            .build());

        ctx.export("rdcOrganizationId1", ids.applyValue(getOrganizationsResult -> getOrganizationsResult).applyValue(ids -> ids.applyValue(getOrganizationsResult -> getOrganizationsResult.id())));
        final var nameRegex = RdcFunctions.getOrganizations(GetOrganizationsArgs.builder()
            .nameRegex("^my-Organization")
            .build());

        ctx.export("rdcOrganizationId2", nameRegex.applyValue(getOrganizationsResult -> getOrganizationsResult.id()));
    }
}
Copy
configuration:
  name:
    type: string
    default: tf-testAccOrganizations-Organizations
resources:
  default:
    type: alicloud:rdc:Organization
    properties:
      organizationName: ${name}
      source: ${name}
variables:
  ids:
    fn::invoke:
      function: alicloud:rdc:getOrganizations
      arguments:
        ids:
          - ${default.id}
  nameRegex:
    fn::invoke:
      function: alicloud:rdc:getOrganizations
      arguments:
        nameRegex: ^my-Organization
outputs:
  rdcOrganizationId1: ${ids.id}
  rdcOrganizationId2: ${nameRegex.id}
Copy

Using getOrganizations

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 getOrganizations(args: GetOrganizationsArgs, opts?: InvokeOptions): Promise<GetOrganizationsResult>
function getOrganizationsOutput(args: GetOrganizationsOutputArgs, opts?: InvokeOptions): Output<GetOrganizationsResult>
Copy
def get_organizations(ids: Optional[Sequence[str]] = None,
                      name_regex: Optional[str] = None,
                      output_file: Optional[str] = None,
                      real_pk: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetOrganizationsResult
def get_organizations_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      real_pk: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetOrganizationsResult]
Copy
func GetOrganizations(ctx *Context, args *GetOrganizationsArgs, opts ...InvokeOption) (*GetOrganizationsResult, error)
func GetOrganizationsOutput(ctx *Context, args *GetOrganizationsOutputArgs, opts ...InvokeOption) GetOrganizationsResultOutput
Copy

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

public static class GetOrganizations 
{
    public static Task<GetOrganizationsResult> InvokeAsync(GetOrganizationsArgs args, InvokeOptions? opts = null)
    public static Output<GetOrganizationsResult> Invoke(GetOrganizationsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetOrganizationsResult> getOrganizations(GetOrganizationsArgs args, InvokeOptions options)
public static Output<GetOrganizationsResult> getOrganizations(GetOrganizationsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:rdc/getOrganizations:getOrganizations
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Organization IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Organization name.
OutputFile string
File name where to save data source results (after running pulumi preview).
RealPk Changes to this property will trigger replacement. string
User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk
Ids Changes to this property will trigger replacement. []string
A list of Organization IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Organization name.
OutputFile string
File name where to save data source results (after running pulumi preview).
RealPk Changes to this property will trigger replacement. string
User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk
ids Changes to this property will trigger replacement. List<String>
A list of Organization IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Organization name.
outputFile String
File name where to save data source results (after running pulumi preview).
realPk Changes to this property will trigger replacement. String
User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk
ids Changes to this property will trigger replacement. string[]
A list of Organization IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Organization name.
outputFile string
File name where to save data source results (after running pulumi preview).
realPk Changes to this property will trigger replacement. string
User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk
ids Changes to this property will trigger replacement. Sequence[str]
A list of Organization IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Organization name.
output_file str
File name where to save data source results (after running pulumi preview).
real_pk Changes to this property will trigger replacement. str
User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk
ids Changes to this property will trigger replacement. List<String>
A list of Organization IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Organization name.
outputFile String
File name where to save data source results (after running pulumi preview).
realPk Changes to this property will trigger replacement. String
User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk

getOrganizations 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 Organization names.
Organizations List<Pulumi.AliCloud.Rdc.Outputs.GetOrganizationsOrganization>
A list of Rdc Organizations. Each element contains the following attributes:
NameRegex string
OutputFile string
RealPk string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
A list of Organization names.
Organizations []GetOrganizationsOrganization
A list of Rdc Organizations. Each element contains the following attributes:
NameRegex string
OutputFile string
RealPk string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
A list of Organization names.
organizations List<GetOrganizationsOrganization>
A list of Rdc Organizations. Each element contains the following attributes:
nameRegex String
outputFile String
realPk String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
A list of Organization names.
organizations GetOrganizationsOrganization[]
A list of Rdc Organizations. Each element contains the following attributes:
nameRegex string
outputFile string
realPk string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
A list of Organization names.
organizations Sequence[GetOrganizationsOrganization]
A list of Rdc Organizations. Each element contains the following attributes:
name_regex str
output_file str
real_pk str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
A list of Organization names.
organizations List<Property Map>
A list of Rdc Organizations. Each element contains the following attributes:
nameRegex String
outputFile String
realPk String

Supporting Types

GetOrganizationsOrganization

Id This property is required. string
The ID of the Organization.
OrganizationId This property is required. string
The first ID of the resource.
OrganizationName This property is required. string
Company name.
Id This property is required. string
The ID of the Organization.
OrganizationId This property is required. string
The first ID of the resource.
OrganizationName This property is required. string
Company name.
id This property is required. String
The ID of the Organization.
organizationId This property is required. String
The first ID of the resource.
organizationName This property is required. String
Company name.
id This property is required. string
The ID of the Organization.
organizationId This property is required. string
The first ID of the resource.
organizationName This property is required. string
Company name.
id This property is required. str
The ID of the Organization.
organization_id This property is required. str
The first ID of the resource.
organization_name This property is required. str
Company name.
id This property is required. String
The ID of the Organization.
organizationId This property is required. String
The first ID of the resource.
organizationName This property is required. String
Company name.

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