Skip to content

Commit 32aca96

Browse files
michal-kopczynskiMichal Kopczynski
andauthored
PRICE-1438: Add commitments resource examples for append mode (#661)
* PRICE-1438: Add commitments resource examples for append mode * docs --------- Co-authored-by: Michal Kopczynski <michal@cast.ai>
1 parent 3eb6c94 commit 32aca96

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

docs/resources/commitments.md

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/resources/castai_commitments/resource.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# GCP example with default OVERWRITE mode and auto_assignment enabled (default)
12
resource "castai_commitments" "gcp_test" {
23
gcp_cuds_json = file("./cuds.json")
34
commitment_configs {
@@ -20,6 +21,7 @@ resource "castai_commitments" "gcp_test" {
2021
}
2122
}
2223

24+
# Azure example with default OVERWRITE mode and auto_assignment enabled (default)
2325
resource "castai_commitments" "azure_test" {
2426
azure_reservations_csv = file("./reservations.csv")
2527
commitment_configs {
@@ -41,3 +43,26 @@ resource "castai_commitments" "azure_test" {
4143
}
4244
}
4345
}
46+
47+
# Azure example with APPEND mode and auto_assignment disabled to prevent commitments from being auto-assigned to all matching clusters.
48+
resource "castai_commitments" "team_a" {
49+
azure_reservations_csv = file("./team-a-reservations.csv")
50+
import_mode = "APPEND"
51+
52+
commitment_configs {
53+
matcher {
54+
region = "eastus"
55+
type = "Standard_DS2_v2"
56+
name = "team-a-reservation"
57+
}
58+
prioritization = false
59+
allowed_usage = 1
60+
status = "Active"
61+
scaling_strategy = "Default"
62+
auto_assignment = false
63+
64+
assignments {
65+
cluster_id = "team-a-cluster-id"
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)