| page_title | castai_commitments Resource - terraform-provider-castai |
|---|---|
| subcategory | |
| description | Commitments represent cloud service provider reserved instances (Azure) and commited use discounts (GCP) that can be used by CAST AI autoscaler. |
Commitments represent cloud service provider reserved instances (Azure) and commited use discounts (GCP) that can be used by CAST AI autoscaler.
resource "castai_commitments" "gcp_test" {
gcp_cuds_json = file("./cuds.json")
commitment_configs {
matcher {
region = "us-east4"
type = "COMPUTE_OPTIMIZED_C2D"
name = "test"
}
prioritization = true
allowed_usage = 0.6
status = "Inactive"
scaling_strategy = "Default"
assignments {
cluster_id = "cluster-id-1" # priority 1 cluster - prioritization is enabled
}
assignments {
cluster_id = "cluster-id-2" # priority 2 cluster - prioritization is enabled
}
}
}
resource "castai_commitments" "azure_test" {
azure_reservations_csv = file("./reservations.csv")
commitment_configs {
matcher {
region = "eastus"
type = "Standard_D32as_v4"
name = "test-res-1"
}
prioritization = false
allowed_usage = 0.9
status = "Active"
scaling_strategy = "Default"
assignments {
cluster_id = "cluster-id-3"
}
assignments {
cluster_id = "cluster-id-4"
}
}
}azure_reservations_csv(String) CSV file containing reservations exported from Azure.commitment_configs(Block List) List of commitment configurations. (see below for nested schema)gcp_cuds_json(String) JSON file containing CUDs exported from GCP.import_mode(String) Import mode. OVERWRITE replaces all commitments for the CSP. APPEND upserts without deleting existing ones.organization_id(String) Organization ID. If not provided, will be fetched from the API using the authentication token.timeouts(Block, Optional) (see below for nested schema)
azure_reservations(List of Object) List of Azure reservations. (see below for nested schema)gcp_cuds(List of Object) List of GCP CUDs. (see below for nested schema)id(String) The ID of this resource.
Required:
matcher(Block List, Min: 1, Max: 1) Matcher used to map config to a commitment. (see below for nested schema)
Optional:
allowed_usage(Number) Allowed usage of the commitment. The value is between 0 (0%) and 1 (100%).assignments(Block List) List of assigned clusters for the commitment. If prioritization is enabled, the order of the assignments indicates the priority. The first assignment has the highest priority. (see below for nested schema)auto_assignment(Boolean) If enabled, the commitment is automatically assigned to all clusters in the matching region. When disabled, only explicitly listed cluster assignments are used.prioritization(Boolean) If enabled, it's possible to assign priorities to the assigned clusters.scaling_strategy(String) Scaling strategy of the commitment in CAST AI. One of: Default, CPUBased, RamBasedstatus(String) Status of the commitment in CAST AI.
Required:
name(String) Name of the commitment to match.region(String) Region of the commitment to match.
Optional:
type(String) Type of the commitment to match. For compute resources, it's the type of the machine.
Required:
cluster_id(String) ID of the cluster to assign the commitment to.
Read-Only:
priority(Number) Priority of the assignment. The lower the value, the higher the priority. 1 is the highest priority.
Optional:
create(String)update(String)
Read-Only:
allowed_usage(Number)assignments(List of Object) (see below for nested schema)count(Number)end_timestamp(String)id(String)instance_type(String)name(String)plan(String)prioritization(Boolean)region(String)reservation_id(String)reservation_status(String)scaling_strategy(String)scope(String)scope_resource_group(String)scope_subscription(String)start_timestamp(String)status(String)
Read-Only:
cluster_id(String)priority(Number)
Read-Only:
allowed_usage(Number)assignments(List of Object) (see below for nested schema)cpu(Number)cud_id(String)cud_status(String)end_timestamp(String)id(String)memory_mb(Number)name(String)plan(String)prioritization(Boolean)region(String)scaling_strategy(String)start_timestamp(String)status(String)type(String)
Read-Only:
cluster_id(String)priority(Number)