Skip to content

Latest commit

 

History

History
194 lines (144 loc) · 5.84 KB

File metadata and controls

194 lines (144 loc) · 5.84 KB
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.

castai_commitments (Resource)

Commitments represent cloud service provider reserved instances (Azure) and commited use discounts (GCP) that can be used by CAST AI autoscaler.

Example Usage

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"
    }
  }
}

Schema

Optional

  • 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)

Read-Only

Nested Schema for commitment_configs

Required:

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, RamBased
  • status (String) Status of the commitment in CAST AI.

Nested Schema for commitment_configs.matcher

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.

Nested Schema for commitment_configs.assignments

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.

Nested Schema for timeouts

Optional:

  • create (String)
  • update (String)

Nested Schema for azure_reservations

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)

Nested Schema for azure_reservations.assignments

Read-Only:

  • cluster_id (String)
  • priority (Number)

Nested Schema for gcp_cuds

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)

Nested Schema for gcp_cuds.assignments

Read-Only:

  • cluster_id (String)
  • priority (Number)