com.pulumi.azure.desktopvirtualization.ScalingPlanHostPoolAssociation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.desktopvirtualization;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.desktopvirtualization.ScalingPlanHostPoolAssociationArgs;
import com.pulumi.azure.desktopvirtualization.inputs.ScalingPlanHostPoolAssociationState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import javax.annotation.Nullable;
/**
* Manages a Virtual Desktop Scaling Plan Host Pool Association.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azuread.AzureadFunctions;
* import com.pulumi.azuread.inputs.GetServicePrincipalArgs;
* import com.pulumi.azure.authorization.Assignment;
* import com.pulumi.azure.authorization.AssignmentArgs;
* import com.pulumi.azure.desktopvirtualization.HostPool;
* import com.pulumi.azure.desktopvirtualization.HostPoolArgs;
* import com.pulumi.azure.desktopvirtualization.ScalingPlan;
* import com.pulumi.azure.desktopvirtualization.ScalingPlanArgs;
* import com.pulumi.azure.desktopvirtualization.inputs.ScalingPlanScheduleArgs;
* import com.pulumi.azure.desktopvirtualization.ScalingPlanHostPoolAssociation;
* import com.pulumi.azure.desktopvirtualization.ScalingPlanHostPoolAssociationArgs;
* import com.pulumi.resources.CustomResourceOptions;
* 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("rg-example-virtualdesktop")
* .location("West Europe")
* .build());
*
* final var example = AzureadFunctions.getServicePrincipal(GetServicePrincipalArgs.builder()
* .displayName("Windows Virtual Desktop")
* .build());
*
* var exampleAssignment = new Assignment("exampleAssignment", AssignmentArgs.builder()
* .scope(exampleResourceGroup.id())
* .roleDefinitionName("Desktop Virtualization Power On Off Contributor")
* .principalId(example.applyValue(getServicePrincipalResult -> getServicePrincipalResult.objectId()))
* .build());
*
* var exampleHostPool = new HostPool("exampleHostPool", HostPoolArgs.builder()
* .name("example-hostpool")
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .type("Pooled")
* .validateEnvironment(true)
* .loadBalancerType("BreadthFirst")
* .build());
*
* var exampleScalingPlan = new ScalingPlan("exampleScalingPlan", ScalingPlanArgs.builder()
* .name("example-scaling-plan")
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .friendlyName("Scaling Plan Test")
* .description("Test Scaling Plan")
* .timeZone("GMT Standard Time")
* .schedules(ScalingPlanScheduleArgs.builder()
* .name("Weekdays")
* .daysOfWeeks(
* "Monday",
* "Tuesday",
* "Wednesday",
* "Thursday",
* "Friday")
* .rampUpStartTime("06:00")
* .rampUpLoadBalancingAlgorithm("BreadthFirst")
* .rampUpMinimumHostsPercent(20)
* .rampUpCapacityThresholdPercent(10)
* .peakStartTime("09:00")
* .peakLoadBalancingAlgorithm("BreadthFirst")
* .rampDownStartTime("18:00")
* .rampDownLoadBalancingAlgorithm("BreadthFirst")
* .rampDownMinimumHostsPercent(10)
* .rampDownForceLogoffUsers(false)
* .rampDownWaitTimeMinutes(45)
* .rampDownNotificationMessage("Please log of in the next 45 minutes...")
* .rampDownCapacityThresholdPercent(5)
* .rampDownStopHostsWhen("ZeroSessions")
* .offPeakStartTime("22:00")
* .offPeakLoadBalancingAlgorithm("BreadthFirst")
* .build())
* .build(), CustomResourceOptions.builder()
* .dependsOn(exampleAssignment)
* .build());
*
* var exampleScalingPlanHostPoolAssociation = new ScalingPlanHostPoolAssociation("exampleScalingPlanHostPoolAssociation", ScalingPlanHostPoolAssociationArgs.builder()
* .hostPoolId(exampleHostPool.id())
* .scalingPlanId(exampleScalingPlan.id())
* .enabled(true)
* .build(), CustomResourceOptions.builder()
* .dependsOn(exampleAssignment)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Associations between Virtual Desktop Scaling Plans and Virtual Desktop Host Pools can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:desktopvirtualization/scalingPlanHostPoolAssociation:ScalingPlanHostPoolAssociation example "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/plan1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup1/providers/Microsoft.DesktopVirtualization/hostPools/myhostpool"
* ```
*
*/
@ResourceType(type="azure:desktopvirtualization/scalingPlanHostPoolAssociation:ScalingPlanHostPoolAssociation")
public class ScalingPlanHostPoolAssociation extends com.pulumi.resources.CustomResource {
/**
* Should the Scaling Plan be enabled on this Host Pool.
*
*/
@Export(name="enabled", refs={Boolean.class}, tree="[0]")
private Output enabled;
/**
* @return Should the Scaling Plan be enabled on this Host Pool.
*
*/
public Output enabled() {
return this.enabled;
}
/**
* The resource ID for the Virtual Desktop Host Pool. Changing this forces a new resource to be created.
*
*/
@Export(name="hostPoolId", refs={String.class}, tree="[0]")
private Output hostPoolId;
/**
* @return The resource ID for the Virtual Desktop Host Pool. Changing this forces a new resource to be created.
*
*/
public Output hostPoolId() {
return this.hostPoolId;
}
/**
* The resource ID for the Virtual Desktop Scaling Plan. Changing this forces a new resource to be created.
*
*/
@Export(name="scalingPlanId", refs={String.class}, tree="[0]")
private Output scalingPlanId;
/**
* @return The resource ID for the Virtual Desktop Scaling Plan. Changing this forces a new resource to be created.
*
*/
public Output scalingPlanId() {
return this.scalingPlanId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ScalingPlanHostPoolAssociation(java.lang.String name) {
this(name, ScalingPlanHostPoolAssociationArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ScalingPlanHostPoolAssociation(java.lang.String name, ScalingPlanHostPoolAssociationArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public ScalingPlanHostPoolAssociation(java.lang.String name, ScalingPlanHostPoolAssociationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:desktopvirtualization/scalingPlanHostPoolAssociation:ScalingPlanHostPoolAssociation", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ScalingPlanHostPoolAssociation(java.lang.String name, Output id, @Nullable ScalingPlanHostPoolAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:desktopvirtualization/scalingPlanHostPoolAssociation:ScalingPlanHostPoolAssociation", name, state, makeResourceOptions(options, id), false);
}
private static ScalingPlanHostPoolAssociationArgs makeArgs(ScalingPlanHostPoolAssociationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ScalingPlanHostPoolAssociationArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static ScalingPlanHostPoolAssociation get(java.lang.String name, Output id, @Nullable ScalingPlanHostPoolAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ScalingPlanHostPoolAssociation(name, id, state, options);
}
}