I am trying to provision resource group with below class. Calling it from the stack class but facing some issue with the output variable.
class GenerateResourceGroup
{
public GenerateResourceGroup(Input<string> location, Input<string> rgName, Dictionary<string, string> tags)
{
Console.WriteLine(location);
Console.WriteLine(rgName);
var config = new Pulumi.Config();
var resourceGroup = new Pulumi.AzureNative.Resources.ResourceGroup("resourceGroup", new Pulumi.AzureNative.Resources.ResourceGroupArgs
{
Location = location,
ResourceGroupName = rgName,
Tags = tags,
});
resourceGroupName = resourceGroup.Name;
}
[Output]
public Output<string> resourceGroupName { get; }
}
Error: Even I tried to utilize apply but still getting error.
Pulumi.Input
1[System.String] Pulumi.Input
1[System.String] Calling [ToString] on an [Output] is not supported. To get the value of an Output as an Output consider: 1. o.Apply(v => $"prefix{v}suffix") 2. Output.Format($"prefix{hostname}suffix"); See https://pulumi.io/help/outputs for more details.