sparse-intern-71089
09/07/2021, 12:41 PMwooden-lifeguard-41446
09/07/2021, 12:43 PMgreat-queen-39697
09/07/2021, 4:54 PMwooden-lifeguard-41446
09/08/2021, 2:27 AMusing Pulumi;
using AzureNative = Pulumi.AzureNative;
class MyStack : Stack
{
public MyStack()
{
//Management group
var managementGroup = new AzureNative.Management.ManagementGroup("managementGroup", new AzureNative.Management.ManagementGroupArgs
{
Details = new AzureNative.Management.Inputs.CreateManagementGroupDetailsArgs
{
Parent = new AzureNative.Management.Inputs.CreateParentGroupInfoArgs
{
Id = "/providers/Microsoft.Management/managementGroups/abb91b5c-16b1-4d24-96f6-9516b8daf6f9",
},
},
DisplayName = "GroupName",
GroupId = "GroupID",
});
var managementGroupSubscription = new AzureNative.Management.ManagementGroupSubscription("managementGroupSubscription", new AzureNative.Management.ManagementGroupSubscriptionArgs
{
GroupId = managementGroup.GroupId,
SubscriptionId = "3a496a85-c5f3-4379-b7f8-b06f5fd09b44",
});
}
}
This is the error
MyStack.cs(24,39): error CS1061: 'ManagementGroup' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'ManagementGroup' could be found (are you missing a using directive or an assembly reference?)
great-queen-39697
09/08/2021, 6:17 PMSo I don't think that thethat's an input to theGroupId
isn't the same as the input to theManagementGroup
- I think it should beManagementGroupSubscription
so it would look like this:managementgroup.id
public MyStack()
{
//Management group
var managementGroup = new AzureNative.Management.ManagementGroup("managementGroup", new AzureNative.Management.ManagementGroupArgs
{
Details = new AzureNative.Management.Inputs.CreateManagementGroupDetailsArgs
{
Parent = new AzureNative.Management.Inputs.CreateParentGroupInfoArgs
{
Id = "/providers/Microsoft.Management/managementGroups/abb91b5c-16b1-4d24-96f6-9516b8daf6f9",
},
},
DisplayName = "GroupName",
GroupId = "GroupID",
});
var managementGroupSubscription = new AzureNative.Management.ManagementGroupSubscription("managementGroupSubscription", new AzureNative.Management.ManagementGroupSubscriptionArgs
{
GroupId = managementGroup.Id,
SubscriptionId = "3a496a85-c5f3-4379-b7f8-b06f5fd09b44",
});
}
I haven't run that code yet, but I think that should work
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by