CapacityReservationGroup

class CapacityReservationGroup : KotlinCustomResource

Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group. 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 group.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var capacityReservationGroup = new AzureNative.Compute.CapacityReservationGroup("capacityReservationGroup", new()
{
CapacityReservationGroupName = "myCapacityReservationGroup",
Location = "westus",
ResourceGroupName = "myResourceGroup",
SharingProfile = new AzureNative.Compute.Inputs.ResourceSharingProfileArgs
{
SubscriptionIds = new[]
{
new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id1}",
},
new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id2}",
},
},
},
Tags =
{
{ "department", "finance" },
},
Zones = new[]
{
"1",
"2",
},
});
});
package main
import (
compute "github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCapacityReservationGroup(ctx, "capacityReservationGroup", &compute.CapacityReservationGroupArgs{
CapacityReservationGroupName: pulumi.String("myCapacityReservationGroup"),
Location: pulumi.String("westus"),
ResourceGroupName: pulumi.String("myResourceGroup"),
SharingProfile: &compute.ResourceSharingProfileArgs{
SubscriptionIds: compute.SubResourceArray{
&compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id1}"),
},
&compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id2}"),
},
},
},
Tags: pulumi.StringMap{
"department": pulumi.String("finance"),
},
Zones: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
},
})
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.CapacityReservationGroup;
import com.pulumi.azurenative.compute.CapacityReservationGroupArgs;
import com.pulumi.azurenative.compute.inputs.ResourceSharingProfileArgs;
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 capacityReservationGroup = new CapacityReservationGroup("capacityReservationGroup", CapacityReservationGroupArgs.builder()
.capacityReservationGroupName("myCapacityReservationGroup")
.location("westus")
.resourceGroupName("myResourceGroup")
.sharingProfile(ResourceSharingProfileArgs.builder()
.subscriptionIds(
SubResourceArgs.builder()
.id("/subscriptions/{subscription-id1}")
.build(),
SubResourceArgs.builder()
.id("/subscriptions/{subscription-id2}")
.build())
.build())
.tags(Map.of("department", "finance"))
.zones(
"1",
"2")
.build());
}
}

Import

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

$ pulumi import azure-native:compute:CapacityReservationGroup myCapacityReservationGroup /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard

A list of all capacity reservation resource ids that belong to capacity reservation group.

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

The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group.

Link copied to clipboard
val location: Output<String>

Resource location

Link copied to clipboard
val name: Output<String>

Resource name

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details.

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

Resource tags

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 references to all virtual machines associated to the capacity reservation group.

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

Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones.