CapacityReservation

class CapacityReservation : KotlinCustomResource

Specifies information about the capacity reservation. Uses Azure REST API version 2024-11-01. In version 2.x of the Azure Native provider, it used API version 2023-03-01. Other available API versions: 2022-08-01, 2022-11-01, 2023-03-01, 2023-07-01, 2023-09-01, 2024-03-01, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native compute [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update a capacity reservation .

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var capacityReservation = new AzureNative.Compute.CapacityReservation("capacityReservation", new()
{
CapacityReservationGroupName = "myCapacityReservationGroup",
CapacityReservationName = "myCapacityReservation",
Location = "westus",
ResourceGroupName = "myResourceGroup",
Sku = new AzureNative.Compute.Inputs.SkuArgs
{
Capacity = 4,
Name = "Standard_DS1_v2",
},
Tags =
{
{ "department", "HR" },
},
Zones = new[]
{
"1",
},
});
});
package main
import (
compute "github.com/pulumi/pulumi-azure-native-sdk/compute/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCapacityReservation(ctx, "capacityReservation", &compute.CapacityReservationArgs{
CapacityReservationGroupName: pulumi.String("myCapacityReservationGroup"),
CapacityReservationName: pulumi.String("myCapacityReservation"),
Location: pulumi.String("westus"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Sku: &compute.SkuArgs{
Capacity: pulumi.Float64(4),
Name: pulumi.String("Standard_DS1_v2"),
},
Tags: pulumi.StringMap{
"department": pulumi.String("HR"),
},
Zones: pulumi.StringArray{
pulumi.String("1"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CapacityReservation;
import com.pulumi.azurenative.compute.CapacityReservationArgs;
import com.pulumi.azurenative.compute.inputs.SkuArgs;
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 capacityReservation = new CapacityReservation("capacityReservation", CapacityReservationArgs.builder()
.capacityReservationGroupName("myCapacityReservationGroup")
.capacityReservationName("myCapacityReservation")
.location("westus")
.resourceGroupName("myResourceGroup")
.sku(SkuArgs.builder()
.capacity(4.0)
.name("Standard_DS1_v2")
.build())
.tags(Map.of("department", "HR"))
.zones("1")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:compute:CapacityReservation myCapacityReservation /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The Capacity reservation instance view.

Link copied to clipboard
val location: Output<String>

Resource location

Link copied to clipboard
val name: Output<String>

Resource name

Link copied to clipboard

Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.

Link copied to clipboard

The provisioning state, which only appears in the response.

Link copied to clipboard

The date time when the capacity reservation was last updated.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val reservationId: Output<String>

A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.

Link copied to clipboard
val sku: Output<SkuResponse>

SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags

Link copied to clipboard
val timeCreated: Output<String>

Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.

Link copied to clipboard
val type: Output<String>

Resource type

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

A list of all virtual machine resource ids that are associated with the capacity reservation.

Link copied to clipboard
val zones: Output<List<String>>?

Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone.