
com.pulumi.azurenative.azurefleet.Fleet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.azurenative.azurefleet;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.azurefleet.FleetArgs;
import com.pulumi.azurenative.azurefleet.outputs.ComputeProfileResponse;
import com.pulumi.azurenative.azurefleet.outputs.ManagedServiceIdentityResponse;
import com.pulumi.azurenative.azurefleet.outputs.PlanResponse;
import com.pulumi.azurenative.azurefleet.outputs.RegularPriorityProfileResponse;
import com.pulumi.azurenative.azurefleet.outputs.SpotPriorityProfileResponse;
import com.pulumi.azurenative.azurefleet.outputs.SystemDataResponse;
import com.pulumi.azurenative.azurefleet.outputs.VmSizeProfileResponse;
import com.pulumi.core.Alias;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* An Compute Fleet resource
* Azure REST API version: 2024-05-01-preview.
*
* Other available API versions: 2023-11-01-preview, 2024-11-01.
*
* ## Example Usage
* ### Fleets_CreateOrUpdate_MinimumSet
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.azurefleet.Fleet;
* import com.pulumi.azurenative.azurefleet.FleetArgs;
* import com.pulumi.azurenative.azurefleet.inputs.ComputeProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.BaseVirtualMachineProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.VirtualMachineScaleSetNetworkProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.VirtualMachineScaleSetOSProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.LinuxConfigurationArgs;
* import com.pulumi.azurenative.azurefleet.inputs.VirtualMachineScaleSetStorageProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.azurefleet.inputs.VirtualMachineScaleSetOSDiskArgs;
* import com.pulumi.azurenative.azurefleet.inputs.VirtualMachineScaleSetManagedDiskParametersArgs;
* import com.pulumi.azurenative.azurefleet.inputs.RegularPriorityProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.SpotPriorityProfileArgs;
* import com.pulumi.azurenative.azurefleet.inputs.VmSizeProfileArgs;
* 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 fleet = new Fleet("fleet", FleetArgs.builder()
* .computeProfile(ComputeProfileArgs.builder()
* .baseVirtualMachineProfile(BaseVirtualMachineProfileArgs.builder()
* .networkProfile(VirtualMachineScaleSetNetworkProfileArgs.builder()
* .networkApiVersion("2022-07-01")
* .networkInterfaceConfigurations(VirtualMachineScaleSetNetworkConfigurationArgs.builder()
* .name("vmNameTest")
* .properties(VirtualMachineScaleSetNetworkConfigurationPropertiesArgs.builder()
* .enableAcceleratedNetworking(false)
* .enableIPForwarding(true)
* .ipConfigurations(VirtualMachineScaleSetIPConfigurationArgs.builder()
* .name("vmNameTest")
* .properties(VirtualMachineScaleSetIPConfigurationPropertiesArgs.builder()
* .loadBalancerBackendAddressPools(SubResourceArgs.builder()
* .id("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}")
* .build())
* .primary(true)
* .subnet(ApiEntityReferenceArgs.builder()
* .id("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}")
* .build())
* .build())
* .build())
* .primary(true)
* .build())
* .build())
* .build())
* .osProfile(VirtualMachineScaleSetOSProfileArgs.builder()
* .adminPassword("TestPassword$0")
* .adminUsername("azureuser")
* .computerNamePrefix("prefix")
* .linuxConfiguration(LinuxConfigurationArgs.builder()
* .disablePasswordAuthentication(false)
* .build())
* .build())
* .storageProfile(VirtualMachineScaleSetStorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("0001-com-ubuntu-server-focal")
* .publisher("canonical")
* .sku("20_04-lts-gen2")
* .version("latest")
* .build())
* .osDisk(VirtualMachineScaleSetOSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(VirtualMachineScaleSetManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .osType("Linux")
* .build())
* .build())
* .build())
* .computeApiVersion("2023-09-01")
* .platformFaultDomainCount(1)
* .build())
* .fleetName("testFleet")
* .location("eastus2euap")
* .regularPriorityProfile(RegularPriorityProfileArgs.builder()
* .allocationStrategy("LowestPrice")
* .capacity(2)
* .minCapacity(1)
* .build())
* .resourceGroupName("rgazurefleet")
* .spotPriorityProfile(SpotPriorityProfileArgs.builder()
* .allocationStrategy("PriceCapacityOptimized")
* .capacity(2)
* .evictionPolicy("Delete")
* .maintain(true)
* .minCapacity(1)
* .build())
* .tags(Map.of("key", "fleets-test"))
* .vmSizesProfile(
* VmSizeProfileArgs.builder()
* .name("Standard_D2s_v3")
* .build(),
* VmSizeProfileArgs.builder()
* .name("Standard_D4s_v3")
* .build(),
* VmSizeProfileArgs.builder()
* .name("Standard_E2s_v3")
* .build())
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:azurefleet:Fleet testFleet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}
* ```
*
*/
@ResourceType(type="azure-native:azurefleet:Fleet")
public class Fleet extends com.pulumi.resources.CustomResource {
/**
* Compute Profile to use for running user's workloads.
*
*/
@Export(name="computeProfile", refs={ComputeProfileResponse.class}, tree="[0]")
private Output computeProfile;
/**
* @return Compute Profile to use for running user's workloads.
*
*/
public Output computeProfile() {
return this.computeProfile;
}
/**
* The managed service identities assigned to this resource.
*
*/
@Export(name="identity", refs={ManagedServiceIdentityResponse.class}, tree="[0]")
private Output* @Nullable */ ManagedServiceIdentityResponse> identity;
/**
* @return The managed service identities assigned to this resource.
*
*/
public Output> identity() {
return Codegen.optional(this.identity);
}
/**
* The geo-location where the resource lives
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The geo-location where the resource lives
*
*/
public Output location() {
return this.location;
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Details of the resource plan.
*
*/
@Export(name="plan", refs={PlanResponse.class}, tree="[0]")
private Output* @Nullable */ PlanResponse> plan;
/**
* @return Details of the resource plan.
*
*/
public Output> plan() {
return Codegen.optional(this.plan);
}
/**
* The status of the last operation.
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return The status of the last operation.
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* Configuration Options for Regular instances in Compute Fleet.
*
*/
@Export(name="regularPriorityProfile", refs={RegularPriorityProfileResponse.class}, tree="[0]")
private Output* @Nullable */ RegularPriorityProfileResponse> regularPriorityProfile;
/**
* @return Configuration Options for Regular instances in Compute Fleet.
*
*/
public Output> regularPriorityProfile() {
return Codegen.optional(this.regularPriorityProfile);
}
/**
* Configuration Options for Spot instances in Compute Fleet.
*
*/
@Export(name="spotPriorityProfile", refs={SpotPriorityProfileResponse.class}, tree="[0]")
private Output* @Nullable */ SpotPriorityProfileResponse> spotPriorityProfile;
/**
* @return Configuration Options for Spot instances in Compute Fleet.
*
*/
public Output> spotPriorityProfile() {
return Codegen.optional(this.spotPriorityProfile);
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Specifies the time at which the Compute Fleet is created.
*
*/
@Export(name="timeCreated", refs={String.class}, tree="[0]")
private Output timeCreated;
/**
* @return Specifies the time at which the Compute Fleet is created.
*
*/
public Output timeCreated() {
return this.timeCreated;
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
* Specifies the ID which uniquely identifies a Compute Fleet.
*
*/
@Export(name="uniqueId", refs={String.class}, tree="[0]")
private Output uniqueId;
/**
* @return Specifies the ID which uniquely identifies a Compute Fleet.
*
*/
public Output uniqueId() {
return this.uniqueId;
}
/**
* List of VM sizes supported for Compute Fleet
*
*/
@Export(name="vmSizesProfile", refs={List.class,VmSizeProfileResponse.class}, tree="[0,1]")
private Output> vmSizesProfile;
/**
* @return List of VM sizes supported for Compute Fleet
*
*/
public Output> vmSizesProfile() {
return this.vmSizesProfile;
}
/**
* Zones in which the Compute Fleet is available
*
*/
@Export(name="zones", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> zones;
/**
* @return Zones in which the Compute Fleet is available
*
*/
public Output>> zones() {
return Codegen.optional(this.zones);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Fleet(java.lang.String name) {
this(name, FleetArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Fleet(java.lang.String name, FleetArgs 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 Fleet(java.lang.String name, FleetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:azurefleet:Fleet", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Fleet(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:azurefleet:Fleet", name, null, makeResourceOptions(options, id), false);
}
private static FleetArgs makeArgs(FleetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? FleetArgs.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())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:azurefleet/v20231101preview:Fleet").build()),
Output.of(Alias.builder().type("azure-native:azurefleet/v20240501preview:Fleet").build()),
Output.of(Alias.builder().type("azure-native:azurefleet/v20241101:Fleet").build())
))
.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 options Optional settings to control the behavior of the CustomResource.
*/
public static Fleet get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Fleet(name, id, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy