https://pulumi.com logo
#golang
Title
# golang
e

enough-caravan-98871

02/23/2024, 3:53 AM
Hi! I am having trouble with this. Any help greatly appreciated!
Copy code
ScalingPlan, err := desktopvirtualization.NewScalingPlan(ctx, "scaling-plan", &desktopvirtualization.ScalingPlanArgs{
	HostPoolReferences: []desktopvirtualization.ScalingHostPoolReferenceArgs{
		{
			HostPoolArmPath:    HostPool.ID(),
			ScalingPlanEnabled: pulumi.Bool(true),
		},
	},
	ResourceGroupName: ResourceGroup.Name,
	TimeZone:          pulumi.String("Eastern Standard Time"),
},
	pulumi.DependsOn([]pulumi.Resource{HostPool, ResourceGroup}),
	pulumi.Parent(HostPool),
)
if err != nil {
	return err
}
Screenshot 2024-02-22 at 10.47.16 PM.png
I figured this out by manually creating a resource and then importing it to get the correct code which is slightly different than what is documented in the example here.
Copy code
HostPoolReferences: desktopvirtualization.ScalingHostPoolReferenceArray{
	&desktopvirtualization.ScalingHostPoolReferenceArgs{
		HostPoolArmPath:    HostPool.ID(),
		ScalingPlanEnabled: pulumi.Bool(true),
	},
},