1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. resourcemanager
  5. ResourceGroup
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.resourcemanager.ResourceGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Resource Manager Resource Group resource. If you need to group cloud resources according to business departments, projects, and other dimensions, you can create resource groups.

    For information about Resource Manager Resource Group and how to use it, see What is Resource Group.

    NOTE: Available since v1.82.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") || "tfexample";
    const example = new alicloud.resourcemanager.ResourceGroup("example", {
        resourceGroupName: name,
        displayName: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tfexample"
    example = alicloud.resourcemanager.ResourceGroup("example",
        resource_group_name=name,
        display_name=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"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 := "tfexample"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := resourcemanager.NewResourceGroup(ctx, "example", &resourcemanager.ResourceGroupArgs{
    			ResourceGroupName: pulumi.String(name),
    			DisplayName:       pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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") ?? "tfexample";
        var example = new AliCloud.ResourceManager.ResourceGroup("example", new()
        {
            ResourceGroupName = name,
            DisplayName = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourceGroup;
    import com.pulumi.alicloud.resourcemanager.ResourceGroupArgs;
    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("tfexample");
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .resourceGroupName(name)
                .displayName(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tfexample
    resources:
      example:
        type: alicloud:resourcemanager:ResourceGroup
        properties:
          resourceGroupName: ${name}
          displayName: ${name}
    

    Create ResourceGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ResourceGroup(name: string, args: ResourceGroupArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceGroup(resource_name: str,
                      args: ResourceGroupArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      display_name: Optional[str] = None,
                      name: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      tags: Optional[Mapping[str, Any]] = None)
    func NewResourceGroup(ctx *Context, name string, args ResourceGroupArgs, opts ...ResourceOption) (*ResourceGroup, error)
    public ResourceGroup(string name, ResourceGroupArgs args, CustomResourceOptions? opts = null)
    public ResourceGroup(String name, ResourceGroupArgs args)
    public ResourceGroup(String name, ResourceGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:resourcemanager:ResourceGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ResourceGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ResourceGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ResourceGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alicloudResourceGroupResource = new AliCloud.ResourceManager.ResourceGroup("alicloudResourceGroupResource", new()
    {
        DisplayName = "string",
        ResourceGroupName = "string",
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := resourcemanager.NewResourceGroup(ctx, "alicloudResourceGroupResource", &resourcemanager.ResourceGroupArgs{
    	DisplayName:       pulumi.String("string"),
    	ResourceGroupName: pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var alicloudResourceGroupResource = new ResourceGroup("alicloudResourceGroupResource", ResourceGroupArgs.builder()
        .displayName("string")
        .resourceGroupName("string")
        .tags(Map.of("string", "any"))
        .build());
    
    alicloud_resource_group_resource = alicloud.resourcemanager.ResourceGroup("alicloudResourceGroupResource",
        display_name="string",
        resource_group_name="string",
        tags={
            "string": "any",
        })
    
    const alicloudResourceGroupResource = new alicloud.resourcemanager.ResourceGroup("alicloudResourceGroupResource", {
        displayName: "string",
        resourceGroupName: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:resourcemanager:ResourceGroup
    properties:
        displayName: string
        resourceGroupName: string
        tags:
            string: any
    

    ResourceGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ResourceGroup resource accepts the following input properties:

    DisplayName string
    The display name of the resource group. The name must be 1 to 50 characters in length.
    Name string
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    ResourceGroupName string
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    DisplayName string
    The display name of the resource group. The name must be 1 to 50 characters in length.
    Name string
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    ResourceGroupName string
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    displayName String
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name String
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    resourceGroupName String
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    displayName string
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name string
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    resourceGroupName string
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    display_name str
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name str
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    resource_group_name str
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    displayName String
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name String
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    resourceGroupName String
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ResourceGroup resource produces the following output properties:

    AccountId string
    The ID of the Alibaba Cloud account to which the resource group belongs.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionStatuses List<Pulumi.AliCloud.ResourceManager.Outputs.ResourceGroupRegionStatus>
    The status of the resource group in all regions.
    Status string
    The status of the resource group.
    AccountId string
    The ID of the Alibaba Cloud account to which the resource group belongs.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionStatuses []ResourceGroupRegionStatus
    The status of the resource group in all regions.
    Status string
    The status of the resource group.
    accountId String
    The ID of the Alibaba Cloud account to which the resource group belongs.
    id String
    The provider-assigned unique ID for this managed resource.
    regionStatuses List<ResourceGroupRegionStatus>
    The status of the resource group in all regions.
    status String
    The status of the resource group.
    accountId string
    The ID of the Alibaba Cloud account to which the resource group belongs.
    id string
    The provider-assigned unique ID for this managed resource.
    regionStatuses ResourceGroupRegionStatus[]
    The status of the resource group in all regions.
    status string
    The status of the resource group.
    account_id str
    The ID of the Alibaba Cloud account to which the resource group belongs.
    id str
    The provider-assigned unique ID for this managed resource.
    region_statuses Sequence[ResourceGroupRegionStatus]
    The status of the resource group in all regions.
    status str
    The status of the resource group.
    accountId String
    The ID of the Alibaba Cloud account to which the resource group belongs.
    id String
    The provider-assigned unique ID for this managed resource.
    regionStatuses List<Property Map>
    The status of the resource group in all regions.
    status String
    The status of the resource group.

    Look up Existing ResourceGroup Resource

    Get an existing ResourceGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ResourceGroupState, opts?: CustomResourceOptions): ResourceGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            display_name: Optional[str] = None,
            name: Optional[str] = None,
            region_statuses: Optional[Sequence[ResourceGroupRegionStatusArgs]] = None,
            resource_group_name: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None) -> ResourceGroup
    func GetResourceGroup(ctx *Context, name string, id IDInput, state *ResourceGroupState, opts ...ResourceOption) (*ResourceGroup, error)
    public static ResourceGroup Get(string name, Input<string> id, ResourceGroupState? state, CustomResourceOptions? opts = null)
    public static ResourceGroup get(String name, Output<String> id, ResourceGroupState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    The ID of the Alibaba Cloud account to which the resource group belongs.
    DisplayName string
    The display name of the resource group. The name must be 1 to 50 characters in length.
    Name string
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    RegionStatuses List<Pulumi.AliCloud.ResourceManager.Inputs.ResourceGroupRegionStatus>
    The status of the resource group in all regions.
    ResourceGroupName string
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    Status string
    The status of the resource group.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    AccountId string
    The ID of the Alibaba Cloud account to which the resource group belongs.
    DisplayName string
    The display name of the resource group. The name must be 1 to 50 characters in length.
    Name string
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    RegionStatuses []ResourceGroupRegionStatusArgs
    The status of the resource group in all regions.
    ResourceGroupName string
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    Status string
    The status of the resource group.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    accountId String
    The ID of the Alibaba Cloud account to which the resource group belongs.
    displayName String
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name String
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    regionStatuses List<ResourceGroupRegionStatus>
    The status of the resource group in all regions.
    resourceGroupName String
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    status String
    The status of the resource group.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    accountId string
    The ID of the Alibaba Cloud account to which the resource group belongs.
    displayName string
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name string
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    regionStatuses ResourceGroupRegionStatus[]
    The status of the resource group in all regions.
    resourceGroupName string
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    status string
    The status of the resource group.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    account_id str
    The ID of the Alibaba Cloud account to which the resource group belongs.
    display_name str
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name str
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    region_statuses Sequence[ResourceGroupRegionStatusArgs]
    The status of the resource group in all regions.
    resource_group_name str
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    status str
    The status of the resource group.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    accountId String
    The ID of the Alibaba Cloud account to which the resource group belongs.
    displayName String
    The display name of the resource group. The name must be 1 to 50 characters in length.
    name String
    Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    Deprecated: Field name has been deprecated from provider version 1.114.0. New field resource_group_name instead.

    regionStatuses List<Property Map>
    The status of the resource group in all regions.
    resourceGroupName String
    The unique identifier of the resource group. The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.
    status String
    The status of the resource group.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    Supporting Types

    ResourceGroupRegionStatus, ResourceGroupRegionStatusArgs

    RegionId string
    The status of the region.
    Status string
    The status of the resource group.
    RegionId string
    The status of the region.
    Status string
    The status of the resource group.
    regionId String
    The status of the region.
    status String
    The status of the resource group.
    regionId string
    The status of the region.
    status string
    The status of the resource group.
    region_id str
    The status of the region.
    status str
    The status of the resource group.
    regionId String
    The status of the region.
    status String
    The status of the resource group.

    Import

    Resource Manager Resource Group can be imported using the id, e.g.

    $ pulumi import alicloud:resourcemanager/resourceGroup:ResourceGroup example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi