alicloud.resourcemanager.ResourceGroup
Explore with Pulumi AI
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, str]] = 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", "string" },
},
});
example, err := resourcemanager.NewResourceGroup(ctx, "alicloudResourceGroupResource", &resourcemanager.ResourceGroupArgs{
DisplayName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var alicloudResourceGroupResource = new ResourceGroup("alicloudResourceGroupResource", ResourceGroupArgs.builder()
.displayName("string")
.resourceGroupName("string")
.tags(Map.of("string", "string"))
.build());
alicloud_resource_group_resource = alicloud.resourcemanager.ResourceGroup("alicloudResourceGroupResource",
display_name="string",
resource_group_name="string",
tags={
"string": "string",
})
const alicloudResourceGroupResource = new alicloud.resourcemanager.ResourceGroup("alicloudResourceGroupResource", {
displayName: "string",
resourceGroupName: "string",
tags: {
string: "string",
},
});
type: alicloud:resourcemanager:ResourceGroup
properties:
displayName: string
resourceGroupName: string
tags:
string: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ResourceGroup resource accepts the following input properties:
- Display
Name 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 fieldresource_group_name
instead. - Resource
Group stringName - 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.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Display
Name 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 fieldresource_group_name
instead. - Resource
Group stringName - 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.
- map[string]string
- A mapping of tags to assign to the resource.
- display
Name 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 fieldresource_group_name
instead. - resource
Group StringName - 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.
- Map<String,String>
- A mapping of tags to assign to the resource.
- display
Name 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 fieldresource_group_name
instead. - resource
Group stringName - 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.
- {[key: string]: string}
- 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 fieldresource_group_name
instead. - resource_
group_ strname - 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.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- display
Name 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 fieldresource_group_name
instead. - resource
Group StringName - 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.
- Map<String>
- 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:
- Account
Id 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.
- Region
Statuses List<Pulumi.Ali Cloud. Resource Manager. Outputs. Resource Group Region Status> - The status of the resource group in all regions.
- Status string
- The status of the resource group.
- Account
Id 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.
- Region
Statuses []ResourceGroup Region Status - The status of the resource group in all regions.
- Status string
- The status of the resource group.
- account
Id 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.
- region
Statuses List<ResourceGroup Region Status> - The status of the resource group in all regions.
- status String
- The status of the resource group.
- account
Id 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.
- region
Statuses ResourceGroup Region Status[] - 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[ResourceGroup Region Status] - The status of the resource group in all regions.
- status str
- The status of the resource group.
- account
Id 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.
- region
Statuses 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, str]] = 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.
- Account
Id string - The ID of the Alibaba Cloud account to which the resource group belongs.
- Display
Name 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 fieldresource_group_name
instead. - Region
Statuses List<Pulumi.Ali Cloud. Resource Manager. Inputs. Resource Group Region Status> - The status of the resource group in all regions.
- Resource
Group stringName - 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.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Account
Id string - The ID of the Alibaba Cloud account to which the resource group belongs.
- Display
Name 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 fieldresource_group_name
instead. - Region
Statuses []ResourceGroup Region Status Args - The status of the resource group in all regions.
- Resource
Group stringName - 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.
- map[string]string
- A mapping of tags to assign to the resource.
- account
Id String - The ID of the Alibaba Cloud account to which the resource group belongs.
- display
Name 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 fieldresource_group_name
instead. - region
Statuses List<ResourceGroup Region Status> - The status of the resource group in all regions.
- resource
Group StringName - 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.
- Map<String,String>
- A mapping of tags to assign to the resource.
- account
Id string - The ID of the Alibaba Cloud account to which the resource group belongs.
- display
Name 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 fieldresource_group_name
instead. - region
Statuses ResourceGroup Region Status[] - The status of the resource group in all regions.
- resource
Group stringName - 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.
- {[key: string]: string}
- 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 fieldresource_group_name
instead. - region_
statuses Sequence[ResourceGroup Region Status Args] - The status of the resource group in all regions.
- resource_
group_ strname - 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.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- account
Id String - The ID of the Alibaba Cloud account to which the resource group belongs.
- display
Name 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 fieldresource_group_name
instead. - region
Statuses List<Property Map> - The status of the resource group in all regions.
- resource
Group StringName - 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.
- Map<String>
- A mapping of tags to assign to the resource.
Supporting Types
ResourceGroupRegionStatus, ResourceGroupRegionStatusArgs
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.