Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getOrganizations

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

NOTE: Available in v1.137.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-testAccOrganizations-Organizations";
        var @default = new AliCloud.Rdc.Organization("default", new AliCloud.Rdc.OrganizationArgs
        {
            OrganizationName = name,
            Source = name,
        });
        var ids = AliCloud.Rdc.GetOrganizations.Invoke(new AliCloud.Rdc.GetOrganizationsInvokeArgs
        {
            Ids = 
            {
                @default.Id,
            },
        });
        this.RdcOrganizationId1 = ids.Apply(ids => ids.Id);
        var nameRegex = Output.Create(AliCloud.Rdc.GetOrganizations.InvokeAsync(new AliCloud.Rdc.GetOrganizationsArgs
        {
            NameRegex = "^my-Organization",
        }));
        this.RdcOrganizationId2 = nameRegex.Apply(nameRegex => nameRegex.Id);
    }

    [Output("rdcOrganizationId1")]
    public Output<string> RdcOrganizationId1 { get; set; }
    [Output("rdcOrganizationId2")]
    public Output<string> RdcOrganizationId2 { get; set; }
}
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
		}
		_, 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.StringOutput))
		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
	})
}

Coming soon!

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)
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);

Coming soon!

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>
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]
func GetOrganizations(ctx *Context, args *GetOrganizationsArgs, opts ...InvokeOption) (*GetOrganizationsResult, error)
func GetOrganizationsOutput(ctx *Context, args *GetOrganizationsOutputArgs, opts ...InvokeOption) GetOrganizationsResultOutput

> 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)
}
public static CompletableFuture<GetOrganizationsResult> getOrganizations(GetOrganizationsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:rdc/getOrganizations:getOrganizations
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Ids List<string>

A list of Organization IDs.

NameRegex string

A regex string to filter results by Organization name.

OutputFile string
RealPk string

User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk

Ids []string

A list of Organization IDs.

NameRegex string

A regex string to filter results by Organization name.

OutputFile string
RealPk string

User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk

ids List

A list of Organization IDs.

nameRegex String

A regex string to filter results by Organization name.

outputFile String
realPk String

User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk

ids string[]

A list of Organization IDs.

nameRegex string

A regex string to filter results by Organization name.

outputFile string
realPk string

User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk

ids Sequence[str]

A list of Organization IDs.

name_regex str

A regex string to filter results by Organization name.

output_file str
real_pk str

User pk, not required, only required when the ak used by the calling interface is inconsistent with the user pk

ids List

A list of Organization IDs.

nameRegex String

A regex string to filter results by Organization name.

outputFile String
realPk 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>
Organizations List<Pulumi.AliCloud.Rdc.Outputs.GetOrganizationsOrganization>
NameRegex string
OutputFile string
RealPk string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
Organizations []GetOrganizationsOrganization
NameRegex string
OutputFile string
RealPk string
id String

The provider-assigned unique ID for this managed resource.

ids List
names List
organizations ListOrganizationsOrganization>
nameRegex String
outputFile String
realPk String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
organizations GetOrganizationsOrganization[]
nameRegex string
outputFile string
realPk string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
organizations Sequence[GetOrganizationsOrganization]
name_regex str
output_file str
real_pk str
id String

The provider-assigned unique ID for this managed resource.

ids List
names List
organizations List
nameRegex String
outputFile String
realPk String

Supporting Types

GetOrganizationsOrganization

Id string

The ID of the Organization.

OrganizationId string

The first ID of the resource.

OrganizationName string

Company name.

Id string

The ID of the Organization.

OrganizationId string

The first ID of the resource.

OrganizationName string

Company name.

id String

The ID of the Organization.

organizationId String

The first ID of the resource.

organizationName String

Company name.

id string

The ID of the Organization.

organizationId string

The first ID of the resource.

organizationName string

Company name.

id str

The ID of the Organization.

organization_id str

The first ID of the resource.

organization_name str

Company name.

id String

The ID of the Organization.

organizationId String

The first ID of the resource.

organizationName String

Company name.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.