GetResourceGroups

This data source provides resource groups of the current Alibaba Cloud user.

NOTE: Available in v1.84.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.ResourceManager.GetResourceGroups.InvokeAsync(new AliCloud.ResourceManager.GetResourceGroupsArgs
        {
            NameRegex = "tftest",
        }));
        this.FirstResourceGroupId = example.Apply(example => example.Groups[0].Id);
    }

    [Output("firstResourceGroupId")]
    public Output<string> FirstResourceGroupId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

example = alicloud.resourcemanager.get_resource_groups(name_regex="tftest")
pulumi.export("firstResourceGroupId", example.groups[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = pulumi.output(alicloud.resourcemanager.getResourceGroups({
    nameRegex: "tftest",
}, { async: true }));

export const firstResourceGroupId = example.groups[0].id;

Using GetResourceGroups

function getResourceGroups(args: GetResourceGroupsArgs, opts?: InvokeOptions): Promise<GetResourceGroupsResult>
function  get_resource_groups(ids=None, name_regex=None, output_file=None, status=None, opts=None)
func GetResourceGroups(ctx *Context, args *GetResourceGroupsArgs, opts ...InvokeOption) (*GetResourceGroupsResult, error)
public static class GetResourceGroups {
    public static Task<GetResourceGroupsResult> InvokeAsync(GetResourceGroupsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Ids List<string>

A list of resource group IDs.

NameRegex string

A regex string to filter results by resource group name.

OutputFile string
Status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

Ids []string

A list of resource group IDs.

NameRegex string

A regex string to filter results by resource group name.

OutputFile string
Status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

ids string[]

A list of resource group IDs.

nameRegex string

A regex string to filter results by resource group name.

outputFile string
status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

ids List[str]

A list of resource group IDs.

name_regex str

A regex string to filter results by resource group name.

output_file str
status str

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

GetResourceGroups Result

The following output properties are available:

Groups List<Pulumi.AliCloud.ResourceManager.Outputs.GetResourceGroupsGroup>

A list of resource groups. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of resource group IDs.

Names List<string>

A list of resource group names.

NameRegex string
OutputFile string
Status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

Groups []GetResourceGroupsGroup

A list of resource groups. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of resource group IDs.

Names []string

A list of resource group names.

NameRegex string
OutputFile string
Status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

groups GetResourceGroupsGroup[]

A list of resource groups. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of resource group IDs.

names string[]

A list of resource group names.

nameRegex string
outputFile string
status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

groups List[GetResourceGroupsGroup]

A list of resource groups. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of resource group IDs.

names List[str]

A list of resource group names.

name_regex str
output_file str
status str

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

Supporting Types

GetResourceGroupsGroup

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AccountId string

The ID of the Alibaba Cloud account to which the resource group belongs.

CreateDate string

The time when the resource group was created.

DisplayName string

The display name of the resource group.

Id string

The ID of the resource group.

Name string

The unique identifier of the resource group.

Status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

AccountId string

The ID of the Alibaba Cloud account to which the resource group belongs.

CreateDate string

The time when the resource group was created.

DisplayName string

The display name of the resource group.

Id string

The ID of the resource group.

Name string

The unique identifier of the resource group.

Status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

accountId string

The ID of the Alibaba Cloud account to which the resource group belongs.

createDate string

The time when the resource group was created.

displayName string

The display name of the resource group.

id string

The ID of the resource group.

name string

The unique identifier of the resource group.

status string

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

account_id str

The ID of the Alibaba Cloud account to which the resource group belongs.

create_date str

The time when the resource group was created.

display_name str

The display name of the resource group.

id str

The ID of the resource group.

name str

The unique identifier of the resource group.

status str

The status of the resource group. Possible values:Creating,Deleted,OK and PendingDelete.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.