ResourceGroupArgs

data class ResourceGroupArgs(val location: Output<String>? = null, val managedBy: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ResourceGroupArgs>

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}

Constructors

Link copied to clipboard
constructor(location: Output<String>? = null, managedBy: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val location: Output<String>? = null

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>? = null

The ID of the resource that manages this resource group.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

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.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

The tags attached to the resource group.

Functions

Link copied to clipboard
open override fun toJava(): ResourceGroupArgs