GetResourceGroup

Use this data source to access information about an existing Resource Group.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.Core.GetResourceGroup.InvokeAsync(new Azure.Core.GetResourceGroupArgs
        {
            Name = "existing",
        }));
        this.Id = example.Apply(example => example.Id);
    }

    [Output("id")]
    public Output<string> Id { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        example, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{
            Name: "existing",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("id", example.Id)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example = azure.core.get_resource_group(name="existing")
pulumi.export("id", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.core.getResourceGroup({
    name: "existing",
});
export const id = example.then(example => example.id);

Using GetResourceGroup

function getResourceGroup(args: GetResourceGroupArgs, opts?: InvokeOptions): Promise<GetResourceGroupResult>
function  get_resource_group(name=None, opts=None)
func LookupResourceGroup(ctx *Context, args *LookupResourceGroupArgs, opts ...InvokeOption) (*LookupResourceGroupResult, error)

Note: This function is named LookupResourceGroup in the Go SDK.

public static class GetResourceGroup {
    public static Task<GetResourceGroupResult> InvokeAsync(GetResourceGroupArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The Name of this Resource Group.

Name string

The Name of this Resource Group.

name string

The Name of this Resource Group.

name str

The Name of this Resource Group.

GetResourceGroup Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Location string

The Azure Region where the Resource Group exists.

Name string
Tags Dictionary<string, string>

A mapping of tags assigned to the Resource Group.

Id string

The provider-assigned unique ID for this managed resource.

Location string

The Azure Region where the Resource Group exists.

Name string
Tags map[string]string

A mapping of tags assigned to the Resource Group.

id string

The provider-assigned unique ID for this managed resource.

location string

The Azure Region where the Resource Group exists.

name string
tags {[key: string]: string}

A mapping of tags assigned to the Resource Group.

id str

The provider-assigned unique ID for this managed resource.

location str

The Azure Region where the Resource Group exists.

name str
tags Dict[str, str]

A mapping of tags assigned to the Resource Group.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.