ResourceGroup

class ResourceGroup : KotlinCustomResource

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. 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/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update a resource group

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",
});
});
package main
import (
resources "github.com/pulumi/pulumi-azure-native-sdk/resources/v2"
"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
})
}
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());
}
}

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}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<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.

Link copied to clipboard
val managedBy: Output<String>?

The ID of the resource that manages this resource group.

Link copied to clipboard
val name: Output<String>

The name of the resource group.

Link copied to clipboard

The resource group properties.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

The tags attached to the resource group.

Link copied to clipboard
val type: Output<String>

The type of the resource group.

Link copied to clipboard
val urn: Output<String>