1. Packages
  2. Azure Native
  3. API Docs
  4. resources
  5. ResourceGroup
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.8.0 published on Wednesday, Sep 3, 2025 by Pulumi

azure-native.resources.ResourceGroup

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.8.0 published on Wednesday, Sep 3, 2025 by Pulumi

    Resource group information.

    Uses Azure REST API version 2024-03-01. In version 2.x of the Azure Native provider, it used API version 2022-09-01.

    Other available API versions: 2020-10-01, 2021-01-01, 2021-04-01, 2022-09-01, 2023-07-01, 2024-07-01, 2024-11-01, 2025-03-01, 2025-04-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native resources [ApiVersion]. See the version guide for details.

    Example Usage

    Create or update a resource group

    Code snippet for C# available in the adjacent code block.
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var resourceGroup = new AzureNative.Resources.ResourceGroup("resourceGroup", new()
        {
            Location = "eastus",
            ResourceGroupName = "my-resource-group",
        });
    
    });
    
    Code snippet for Go available in the adjacent code block.
    package main
    
    import (
    	resources "github.com/pulumi/pulumi-azure-native-sdk/resources/v3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := resources.NewResourceGroup(ctx, "resourceGroup", &resources.ResourceGroupArgs{
    			Location:          pulumi.String("eastus"),
    			ResourceGroupName: pulumi.String("my-resource-group"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    Code snippet for Java available in the adjacent code block.
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.resources.ResourceGroup;
    import com.pulumi.azurenative.resources.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) {
            var resourceGroup = new ResourceGroup("resourceGroup", ResourceGroupArgs.builder()
                .location("eastus")
                .resourceGroupName("my-resource-group")
                .build());
    
        }
    }
    
    Code snippet for TypeScript available in the adjacent code block.
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const resourceGroup = new azure_native.resources.ResourceGroup("resourceGroup", {
        location: "eastus",
        resourceGroupName: "my-resource-group",
    });
    
    Code snippet for Python available in the adjacent code block.
    import pulumi
    import pulumi_azure_native as azure_native
    
    resource_group = azure_native.resources.ResourceGroup("resourceGroup",
        location="eastus",
        resource_group_name="my-resource-group")
    
    Code snippet for YAML available in the adjacent code block.
    resources:
      resourceGroup:
        type: azure-native:resources:ResourceGroup
        properties:
          location: eastus
          resourceGroupName: my-resource-group
    

    Create ResourceGroup Resource

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

    Constructor syntax

    Code snippet for JavaScript/TypeScript available in the adjacent code block.
    new ResourceGroup(name: string, args?: ResourceGroupArgs, opts?: CustomResourceOptions);
    Code snippet for Python available in the adjacent code block.
    @overload
    def ResourceGroup(resource_name: str,
                      args: Optional[ResourceGroupArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      location: Optional[str] = None,
                      managed_by: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None)
    Code snippet for Go available in the adjacent code block.
    func NewResourceGroup(ctx *Context, name string, args *ResourceGroupArgs, opts ...ResourceOption) (*ResourceGroup, error)
    Code snippet for C# available in the adjacent code block.
    public ResourceGroup(string name, ResourceGroupArgs? args = null, CustomResourceOptions? opts = null)
    Code snippet for Java available in the adjacent code block.
    public ResourceGroup(String name, ResourceGroupArgs args)
    public ResourceGroup(String name, ResourceGroupArgs args, CustomResourceOptions options)
    
    Code snippet for YAML available in the adjacent code block.
    type: azure-native:resources:ResourceGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    Code snippet for JavaScript/TypeScript available in the adjacent code block.
    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.
    Code snippet for Python available in the adjacent code block.
    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.
    Code snippet for Go available in the adjacent code block.
    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.
    Code snippet for C# available in the adjacent code block.
    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.
    Code snippet for Java available in the adjacent code block.
    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.

    Code snippet for C# available in the adjacent code block.
    var resourceGroupResource = new AzureNative.Resources.ResourceGroup("resourceGroupResource", new()
    {
        Location = "string",
        ManagedBy = "string",
        ResourceGroupName = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    Code snippet for Go available in the adjacent code block.
    example, err := resources.NewResourceGroup(ctx, "resourceGroupResource", &resources.ResourceGroupArgs{
    	Location:          pulumi.String("string"),
    	ManagedBy:         pulumi.String("string"),
    	ResourceGroupName: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    Code snippet for Java available in the adjacent code block.
    var resourceGroupResource = new ResourceGroup("resourceGroupResource", ResourceGroupArgs.builder()
        .location("string")
        .managedBy("string")
        .resourceGroupName("string")
        .tags(Map.of("string", "string"))
        .build());
    
    Code snippet for Python available in the adjacent code block.
    resource_group_resource = azure_native.resources.ResourceGroup("resourceGroupResource",
        location="string",
        managed_by="string",
        resource_group_name="string",
        tags={
            "string": "string",
        })
    
    Code snippet for TypeScript available in the adjacent code block.
    const resourceGroupResource = new azure_native.resources.ResourceGroup("resourceGroupResource", {
        location: "string",
        managedBy: "string",
        resourceGroupName: "string",
        tags: {
            string: "string",
        },
    });
    
    Code snippet for YAML available in the adjacent code block.
    type: azure-native:resources:ResourceGroup
    properties:
        location: string
        managedBy: 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

    Code snippet for Python available in the adjacent code block.

    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:

    Code snippet for C# available in the adjacent code block.
    Location string
    The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
    ManagedBy string
    The ID of the resource that manages this resource group.
    ResourceGroupName string
    The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
    Tags Dictionary<string, string>
    The tags attached to the resource group.
    Code snippet for Go available in the adjacent code block.
    Location string
    The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
    ManagedBy string
    The ID of the resource that manages this resource group.
    ResourceGroupName string
    The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
    Tags map[string]string
    The tags attached to the resource group.
    Code snippet for Java available in the adjacent code block.
    location String
    The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
    managedBy String
    The ID of the resource that manages this resource group.
    resourceGroupName String
    The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
    tags Map<String,String>
    The tags attached to the resource group.
    Code snippet for JavaScript/TypeScript available in the adjacent code block.
    location string
    The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
    managedBy string
    The ID of the resource that manages this resource group.
    resourceGroupName string
    The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
    tags {[key: string]: string}
    The tags attached to the resource group.
    Code snippet for Python available in the adjacent code block.
    location str
    The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
    managed_by str
    The ID of the resource that manages this resource group.
    resource_group_name str
    The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
    tags Mapping[str, str]
    The tags attached to the resource group.
    Code snippet for YAML available in the adjacent code block.
    location String
    The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
    managedBy String
    The ID of the resource that manages this resource group.
    resourceGroupName String
    The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
    tags Map<String>
    The tags attached to the resource group.

    Outputs

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

    Code snippet for C# available in the adjacent code block.
    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the resource group.
    Properties Pulumi.AzureNative.Resources.Outputs.ResourceGroupPropertiesResponse
    The resource group properties.
    Type string
    The type of the resource group.
    Code snippet for Go available in the adjacent code block.
    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the resource group.
    Properties ResourceGroupPropertiesResponse
    The resource group properties.
    Type string
    The type of the resource group.
    Code snippet for Java available in the adjacent code block.
    azureApiVersion String
    The Azure API version of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the resource group.
    properties ResourceGroupPropertiesResponse
    The resource group properties.
    type String
    The type of the resource group.
    Code snippet for JavaScript/TypeScript available in the adjacent code block.
    azureApiVersion string
    The Azure API version of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the resource group.
    properties ResourceGroupPropertiesResponse
    The resource group properties.
    type string
    The type of the resource group.
    Code snippet for Python available in the adjacent code block.
    azure_api_version str
    The Azure API version of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the resource group.
    properties ResourceGroupPropertiesResponse
    The resource group properties.
    type str
    The type of the resource group.
    Code snippet for YAML available in the adjacent code block.
    azureApiVersion String
    The Azure API version of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the resource group.
    properties Property Map
    The resource group properties.
    type String
    The type of the resource group.

    Supporting Types

    ResourceGroupPropertiesResponse, ResourceGroupPropertiesResponseArgs

    Code snippet for C# available in the adjacent code block.
    ProvisioningState string
    The provisioning state.
    Code snippet for Go available in the adjacent code block.
    ProvisioningState string
    The provisioning state.
    Code snippet for Java available in the adjacent code block.
    provisioningState String
    The provisioning state.
    Code snippet for JavaScript/TypeScript available in the adjacent code block.
    provisioningState string
    The provisioning state.
    Code snippet for Python available in the adjacent code block.
    provisioning_state str
    The provisioning state.
    Code snippet for YAML available in the adjacent code block.
    provisioningState String
    The provisioning state.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:resources:ResourceGroup my-resource-group /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} 
    

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

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
    Azure Native v3.8.0 published on Wednesday, Sep 3, 2025 by Pulumi