
terraform-provider-castai
Terraform provider for CAST AI platform
Stars: 51

Terraform Provider for CAST AI is a tool that allows users to manage their CAST AI resources using Terraform. It provides a seamless integration between Terraform and CAST AI platform, enabling users to define and manage their infrastructure as code. The provider supports various features such as setting up cluster configurations, managing node templates, and configuring autoscaler policies. Users can easily install the provider, pass API keys, and leverage the provider's functionalities to automate the deployment and management of their CAST AI resources.
README:
Website: https://www.cast.ai
To install this provider, put the following code into your Terraform configuration. Then, run terraform init
.
terraform {
required_providers {
castai = {
source = "castai/castai"
version = "2.0.0" # can be omitted for the latest version
}
}
required_version = ">= 0.13"
}
provider "castai" {
api_token = "<<your-castai-api-key>>"
}
Alternatively, you can pass api key via environment variable:
$ CASTAI_API_TOKEN=<<your-castai-api-key>> terraform plan
For more logs use the log level flag:
$ TF_LOG=DEBUG terraform plan
More examples can be found here.
Learn why required_providers
block is required
in terraform 0.13 upgrade guide
.
Version 1.x.x no longer supports setting cluster configuration directly and castai_node_configuration
resource should
be used. This applies to all castai_*_cluster
resources.
Additionally, in case of castai_eks_cluster
access_key_id
and secret_access_key
was removed in favor of assume_role_arn
.
Having old configuration:
resource "castai_eks_cluster" "this" {
account_id = data.aws_caller_identity.current.account_id
region = var.cluster_region
name = var.cluster_name
access_key_id = var.aws_access_key_id
secret_access_key = var.aws_secret_access_key
subnets = module.vpc.private_subnets
dns_cluster_ip = "10.100.0.10"
instance_profile_arn = var.instance_profile_arn
security_groups = [aws_security_group.test.id]
}
New configuration will look like:
resource "castai_eks_cluster" "this" {
account_id = data.aws_caller_identity.current.account_id
region = var.cluster_region
name = var.cluster_name
assume_role_arn = var.assume_role_arn
}
resource "castai_node_configuration" "test" {
name = "default"
cluster_id = castai_eks_cluster.this.id
subnets = module.vpc.private_subnets
eks {
instance_profile_arn = var.instance_profile_arn
dns_cluster_ip = "10.100.0.10"
security_groups = [aws_security_group.test.id]
}
}
resource "castai_node_configuration_default" "test" {
cluster_id = castai_eks_cluster.test.id
configuration_id = castai_node_configuration.test.id
}
If you have used castai-eks-cluster
module follow:
https://github.com/castai/terraform-castai-eks-cluster/blob/main/README.md#migrating-from-2xx-to-3xx
Version 4.x.x changed:
-
castai_eks_clusterid
type from data source to resource
Having old configuration:
data "castai_eks_clusterid" "cluster_id" {
account_id = data.aws_caller_identity.current.account_id
region = var.cluster_region
cluster_name = var.cluster_name
}
and usage data.castai_eks_clusterid.cluster_id.id
New configuration will look like:
resource "castai_eks_clusterid" "cluster_id" {
account_id = data.aws_caller_identity.current.account_id
region = var.cluster_region
cluster_name = var.cluster_name
}
and usage castai_eks_clusterid.cluster_id.id
- removal of
castai_cluster_token
resource in favour ofcluster_token
incastai_eks_cluster
Having old configuration:
resource "castai_cluster_token" "this" {
cluster_id = castai_eks_cluster.this.id
}
resource "castai_eks_cluster" "this" {
account_id = data.aws_caller_identity.current.account_id
region = var.cluster_region
name = var.cluster_name
}
and usage castai_cluster_token.this.cluster_token
New configuration will look like:
resource "castai_eks_cluster" "this" {
account_id = data.aws_caller_identity.current.account_id
region = var.cluster_region
name = var.cluster_name
}
and usage castai_eks_cluster.this.cluster_token
- default value for
imds_v1
was change totrue
, in case that your configuration didn't had this specified please explicitly set this value tofalse
Version 5.x.x changed:
- Terraform provider adopts default node template concept
- Removed
spotInstances
field fromautoscaler_policies_json
attribute incastai_autoscaler_policies
resource - Removed
customInstancesEnabled
field fromautoscaler_policies_json
attribute incastai_autoscaler_policies
resource - Removed
nodeConstraints
field fromautoscaler_policies_json
attribute incastai_autoscaler_policies
resource - All valid fields which were removed from
autoscaler_policies_json
have mapping incastai_node_template
resource
Old configuration:
resource "castai_autoscaler" "castai_autoscaler_policies" {
cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference
autoscaler_policies_json = <<-EOT
{
"enabled": true,
"unschedulablePods": {
"enabled": true,
"customInstancesEnabled": true,
"nodeConstraints": {
"enabled": true,
"minCpuCores": 2,
"maxCpuCores": 4,
"minRamMib": 3814,
"maxRamMib": 16384
}
},
"spotInstances": {
"enabled": true,
"clouds": ["gcp"],
"spotBackups": {
"enabled": true
}
},
"nodeDownscaler": {
"enabled": true,
"emptyNodes": {
"enabled": true
},
"evictor": {
"aggressiveMode": true,
"cycleInterval": "5m10s",
"dryRun": false,
"enabled": true,
"nodeGracePeriodMinutes": 10,
"scopedMode": false
}
}
}
EOT
}
New configuration:
resource "castai_autoscaler" "castai_autoscaler_policies" {
cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference
autoscaler_policies_json = <<-EOT
{
"enabled": true,
"unschedulablePods": {
"enabled": true
},
"nodeDownscaler": {
"enabled": true,
"emptyNodes": {
"enabled": true
},
"evictor": {
"aggressiveMode": true,
"cycleInterval": "5m10s",
"dryRun": false,
"enabled": true,
"nodeGracePeriodMinutes": 10,
"scopedMode": false
}
}
}
EOT
}
resource "castai_node_template" "default_by_castai" {
cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference
name = "default-by-castai"
configuration_id = castai_node_configuration.default.id // or other reference
is_default = true
should_taint = false
custom_instances_enabled = true
constraints {
architectures = [
"amd64",
"arm64",
]
on_demand = true
spot = true
use_spot_fallbacks = true
min_cpu = 2
max_cpu = 4
min_memory = 3814
max_memory = 16384
}
depends_on = [ castai_autoscaler.castai_autoscaler_policies ]
}
If you have used castai-eks-cluster
or other modules follow:
https://github.com/castai/terraform-castai-eks-cluster/blob/main/README.md#migrating-from-5xx-to-6xx
Note: default-by-castai
default node template is created in background by CAST.ai, when creating managed resource
in Terraform the provider will handle create as update. Importing default-by-castai
default node template into Terraform
state is not needed if you follow the migration guide. Despite not being needed it can be performed and everything
will work correctly.
Example of node template import:
terraform import castai_node_template.default_by_castai 105e6fa3-20b1-424e-v589-9a64d1eeabea/default-by-castai
Version 6.x.x changed:
- Removed
custom_label
attribute incastai_node_template
resource. Usecustom_labels
instead.
Old configuration:
module "castai-aks-cluster" {
node_templates = {
spot_tmpl = {
custom_label = {
key = "custom-label-key-1"
value = "custom-label-value-1"
}
}
}
}
New configuration:
module "castai-aks-cluster" {
node_templates = {
spot_tmpl = {
custom_labels = {
custom-label-key-1 = "custom-label-value-1"
}
}
}
}
For more information for castai-aks-cluster
module follow:
https://github.com/castai/terraform-castai-aks/blob/main/README.md#migrating-from-2xx-to-3xx
If you have used castai-eks-cluster
or other modules follow:
https://github.com/castai/terraform-castai-eks-cluster/blob/main/README.md#migrating-from-6xx-to-7xx
If you have used castai-gke-cluster
or other modules follow:
https://github.com/castai/terraform-castai-gke-cluster/blob/main/README.md#migrating-from-3xx-to-4xx
Version 7.x.x changed:
- Removed
compute_optimized
andstorage_optimized
attributes incastai_node_template
resource,constraints
object. Usecompute_optimized_state
andstorage_optimized_state
instead.
Old configuration:
module "castai-aks-cluster" {
node_templates = {
spot_tmpl = {
constraints = {
compute_optimized = false
storage_optimized = true
}
}
}
}
New configuration:
module "castai-aks-cluster" {
node_templates = {
spot_tmpl = {
constraints = {
compute_optimized_state = "disabled"
storage_optimized_state = "enabled"
}
}
}
}
- [v7.4.X] Deprecated
autoscaler_policies_json
attribute incastai_autoscaler
resource. Useautoscaler_settings
instead.
Old configuration:
resource "castai_autoscaler" "castai_autoscaler_policies" {
cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference
autoscaler_policies_json = <<-EOT
{
"enabled": true,
"unschedulablePods": {
"enabled": true
},
"nodeDownscaler": {
"enabled": true,
"emptyNodes": {
"enabled": true
},
"evictor": {
"aggressiveMode": false,
"cycleInterval": "5m10s",
"dryRun": false,
"enabled": true,
"nodeGracePeriodMinutes": 10,
"scopedMode": false
}
},
"nodeTemplatesPartialMatchingEnabled": false,
"clusterLimits": {
"cpu": {
"maxCores": 20,
"minCores": 1
},
"enabled": true
}
}
EOT
}
New configuration:
resource "castai_autoscaler" "castai_autoscaler_policies" {
cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference
autoscaler_settings {
enabled = true
node_templates_partial_matching_enabled = false
unschedulable_pods {
enabled = true
}
node_downscaler {
enabled = true
empty_nodes {
enabled = false
}
evictor {
aggressive_mode = false
cycle_interval = "5m10s"
dry_run = false
enabled = true
node_grace_period_minutes = 10
scoped_mode = false
}
}
cluster_limits {
enabled = true
cpu {
max_cores = 20
min_cores = 1
}
}
}
}
For more information for castai-aks-cluster
module follow:
https://github.com/castai/terraform-castai-aks/blob/main/README.md#migrating-from-3xx-to-4xx
If you have used castai-eks-cluster
or other modules follow:
https://github.com/castai/terraform-castai-eks-cluster/blob/main/README.md#migrating-from-7xx-to-8xx
If you have used castai-gke-cluster
or other modules follow:
https://github.com/castai/terraform-castai-gke-cluster/blob/main/README.md#migrating-from-4xx-to-5xx
Make sure you have Go installed on your machine (please check the requirements).
To build the provider locally:
$ git clone https://github.com/CastAI/terraform-provider-castai.git
$ cd terraform-provider-castai
$ make build
After you build the provider, you have to set the ~/.terraformrc
configuration to let terraform know you want to use local provider:
provider_installation {
dev_overrides {
"castai/castai" = "<path-to-terraform-provider-castai-repository>"
}
direct {}
}
make build
builds the provider and install symlinks to that build for all terraform projects in examples/*
dir.
Now you can work on examples/localdev
.
Whenever you make changes to the provider re-run make build
.
You'll need to run terraform init
in your terraform project again since the binary has changed.
To run unit tests:
$ make test
This repository contains a github action to automatically build and publish assets for release when
tag is pushed with pattern v*
(ie. v0.1.0
).
Gorelaser is used to produce build artifacts matching the layout required to publish the provider in the Terraform Registry.
Releases will appear as drafts. Once marked as published on the GitHub Releases page, they will become available via the Terraform Registry.
For Tasks:
Click tags to check more tools for each tasksFor Jobs:
Alternative AI tools for terraform-provider-castai
Similar Open Source Tools

terraform-provider-castai
Terraform Provider for CAST AI is a tool that allows users to manage their CAST AI resources using Terraform. It provides a seamless integration between Terraform and CAST AI platform, enabling users to define and manage their infrastructure as code. The provider supports various features such as setting up cluster configurations, managing node templates, and configuring autoscaler policies. Users can easily install the provider, pass API keys, and leverage the provider's functionalities to automate the deployment and management of their CAST AI resources.

vim-ai
vim-ai is a plugin that adds Artificial Intelligence (AI) capabilities to Vim and Neovim. It allows users to generate code, edit text, and have interactive conversations with GPT models powered by OpenAI's API. The plugin uses OpenAI's API to generate responses, requiring users to set up an account and obtain an API key. It supports various commands for text generation, editing, and chat interactions, providing a seamless integration of AI features into the Vim text editor environment.

ruby-openai
Use the OpenAI API with Ruby! 🤖🩵 Stream text with GPT-4, transcribe and translate audio with Whisper, or create images with DALL·E... Hire me | 🎮 Ruby AI Builders Discord | 🐦 Twitter | 🧠 Anthropic Gem | 🚂 Midjourney Gem ## Table of Contents * Ruby OpenAI * Table of Contents * Installation * Bundler * Gem install * Usage * Quickstart * With Config * Custom timeout or base URI * Extra Headers per Client * Logging * Errors * Faraday middleware * Azure * Ollama * Counting Tokens * Models * Examples * Chat * Streaming Chat * Vision * JSON Mode * Functions * Edits * Embeddings * Batches * Files * Finetunes * Assistants * Threads and Messages * Runs * Runs involving function tools * Image Generation * DALL·E 2 * DALL·E 3 * Image Edit * Image Variations * Moderations * Whisper * Translate * Transcribe * Speech * Errors * Development * Release * Contributing * License * Code of Conduct

llm.nvim
llm.nvim is a universal plugin for a large language model (LLM) designed to enable users to interact with LLM within neovim. Users can customize various LLMs such as gpt, glm, kimi, and local LLM. The plugin provides tools for optimizing code, comparing code, translating text, and more. It also supports integration with free models from Cloudflare, Github models, siliconflow, and others. Users can customize tools, chat with LLM, quickly translate text, and explain code snippets. The plugin offers a flexible window interface for easy interaction and customization.

redcache-ai
RedCache-ai is a memory framework designed for Large Language Models and Agents. It provides a dynamic memory framework for developers to build various applications, from AI-powered dating apps to healthcare diagnostics platforms. Users can store, retrieve, search, update, and delete memories using RedCache-ai. The tool also supports integration with OpenAI for enhancing memories. RedCache-ai aims to expand its functionality by integrating with more LLM providers, adding support for AI Agents, and providing a hosted version.

llama.rn
React Native binding of llama.cpp, which is an inference of LLaMA model in pure C/C++. This tool allows you to use the LLaMA model in your React Native applications for various tasks such as text completion, tokenization, detokenization, and embedding. It provides a convenient interface to interact with the LLaMA model and supports features like grammar sampling and mocking for testing purposes.

gp.nvim
Gp.nvim (GPT prompt) Neovim AI plugin provides a seamless integration of GPT models into Neovim, offering features like streaming responses, extensibility via hook functions, minimal dependencies, ChatGPT-like sessions, instructable text/code operations, speech-to-text support, and image generation directly within Neovim. The plugin aims to enhance the Neovim experience by leveraging the power of AI models in a user-friendly and native way.

lmstudio.js
lmstudio.js is a pre-release alpha client SDK for LM Studio, allowing users to use local LLMs in JS/TS/Node. It is currently undergoing rapid development with breaking changes expected. Users can follow LM Studio's announcements on Twitter and Discord. The SDK provides API usage for loading models, predicting text, setting up the local LLM server, and more. It supports features like custom loading progress tracking, model unloading, structured output prediction, and cancellation of predictions. Users can interact with LM Studio through the CLI tool 'lms' and perform tasks like text completion, conversation, and getting prediction statistics.

llmproxy
llmproxy is a reverse proxy for LLM API based on Cloudflare Worker, supporting platforms like OpenAI, Gemini, and Groq. The interface is compatible with the OpenAI API specification and can be directly accessed using the OpenAI SDK. It provides a convenient way to interact with various AI platforms through a unified API endpoint, enabling seamless integration and usage in different applications.

pipecat-flows
Pipecat Flows is a framework designed for building structured conversations in AI applications. It allows users to create both predefined conversation paths and dynamically generated flows, handling state management and LLM interactions. The framework includes a Python module for building conversation flows and a visual editor for designing and exporting flow configurations. Pipecat Flows is suitable for scenarios such as customer service scripts, intake forms, personalized experiences, and complex decision trees.

ollama-ex
Ollama is a powerful tool for running large language models locally or on your own infrastructure. It provides a full implementation of the Ollama API, support for streaming requests, and tool use capability. Users can interact with Ollama in Elixir to generate completions, chat messages, and perform streaming requests. The tool also supports function calling on compatible models, allowing users to define tools with clear descriptions and arguments. Ollama is designed to facilitate natural language processing tasks and enhance user interactions with language models.

openmacro
Openmacro is a multimodal personal agent that allows users to run code locally. It acts as a personal agent capable of completing and automating tasks autonomously via self-prompting. The tool provides a CLI natural-language interface for completing and automating tasks, analyzing and plotting data, browsing the web, and manipulating files. Currently, it supports API keys for models powered by SambaNova, with plans to add support for other hosts like OpenAI and Anthropic in future versions.

parrot.nvim
Parrot.nvim is a Neovim plugin that prioritizes a seamless out-of-the-box experience for text generation. It simplifies functionality and focuses solely on text generation, excluding integration of DALLE and Whisper. It supports persistent conversations as markdown files, custom hooks for inline text editing, multiple providers like Anthropic API, perplexity.ai API, OpenAI API, Mistral API, and local/offline serving via ollama. It allows custom agent definitions, flexible API credential support, and repository-specific instructions with a `.parrot.md` file. It does not have autocompletion or hidden requests in the background to analyze files.

langcorn
LangCorn is an API server that enables you to serve LangChain models and pipelines with ease, leveraging the power of FastAPI for a robust and efficient experience. It offers features such as easy deployment of LangChain models and pipelines, ready-to-use authentication functionality, high-performance FastAPI framework for serving requests, scalability and robustness for language processing applications, support for custom pipelines and processing, well-documented RESTful API endpoints, and asynchronous processing for faster response times.

swarmzero
SwarmZero SDK is a library that simplifies the creation and execution of AI Agents and Swarms of Agents. It supports various LLM Providers such as OpenAI, Azure OpenAI, Anthropic, MistralAI, Gemini, Nebius, and Ollama. Users can easily install the library using pip or poetry, set up the environment and configuration, create and run Agents, collaborate with Swarms, add tools for complex tasks, and utilize retriever tools for semantic information retrieval. Sample prompts are provided to help users explore the capabilities of the agents and swarms. The SDK also includes detailed examples and documentation for reference.
For similar tasks

terraform-provider-castai
Terraform Provider for CAST AI is a tool that allows users to manage their CAST AI resources using Terraform. It provides a seamless integration between Terraform and CAST AI platform, enabling users to define and manage their infrastructure as code. The provider supports various features such as setting up cluster configurations, managing node templates, and configuring autoscaler policies. Users can easily install the provider, pass API keys, and leverage the provider's functionalities to automate the deployment and management of their CAST AI resources.
For similar jobs

AirGo
AirGo is a front and rear end separation, multi user, multi protocol proxy service management system, simple and easy to use. It supports vless, vmess, shadowsocks, and hysteria2.

mosec
Mosec is a high-performance and flexible model serving framework for building ML model-enabled backend and microservices. It bridges the gap between any machine learning models you just trained and the efficient online service API. * **Highly performant** : web layer and task coordination built with Rust 🦀, which offers blazing speed in addition to efficient CPU utilization powered by async I/O * **Ease of use** : user interface purely in Python 🐍, by which users can serve their models in an ML framework-agnostic manner using the same code as they do for offline testing * **Dynamic batching** : aggregate requests from different users for batched inference and distribute results back * **Pipelined stages** : spawn multiple processes for pipelined stages to handle CPU/GPU/IO mixed workloads * **Cloud friendly** : designed to run in the cloud, with the model warmup, graceful shutdown, and Prometheus monitoring metrics, easily managed by Kubernetes or any container orchestration systems * **Do one thing well** : focus on the online serving part, users can pay attention to the model optimization and business logic

llm-code-interpreter
The 'llm-code-interpreter' repository is a deprecated plugin that provides a code interpreter on steroids for ChatGPT by E2B. It gives ChatGPT access to a sandboxed cloud environment with capabilities like running any code, accessing Linux OS, installing programs, using filesystem, running processes, and accessing the internet. The plugin exposes commands to run shell commands, read files, and write files, enabling various possibilities such as running different languages, installing programs, starting servers, deploying websites, and more. It is powered by the E2B API and is designed for agents to freely experiment within a sandboxed environment.

pezzo
Pezzo is a fully cloud-native and open-source LLMOps platform that allows users to observe and monitor AI operations, troubleshoot issues, save costs and latency, collaborate, manage prompts, and deliver AI changes instantly. It supports various clients for prompt management, observability, and caching. Users can run the full Pezzo stack locally using Docker Compose, with prerequisites including Node.js 18+, Docker, and a GraphQL Language Feature Support VSCode Extension. Contributions are welcome, and the source code is available under the Apache 2.0 License.

learn-generative-ai
Learn Cloud Applied Generative AI Engineering (GenEng) is a course focusing on the application of generative AI technologies in various industries. The course covers topics such as the economic impact of generative AI, the role of developers in adopting and integrating generative AI technologies, and the future trends in generative AI. Students will learn about tools like OpenAI API, LangChain, and Pinecone, and how to build and deploy Large Language Models (LLMs) for different applications. The course also explores the convergence of generative AI with Web 3.0 and its potential implications for decentralized intelligence.

gcloud-aio
This repository contains shared codebase for two projects: gcloud-aio and gcloud-rest. gcloud-aio is built for Python 3's asyncio, while gcloud-rest is a threadsafe requests-based implementation. It provides clients for Google Cloud services like Auth, BigQuery, Datastore, KMS, PubSub, Storage, and Task Queue. Users can install the library using pip and refer to the documentation for usage details. Developers can contribute to the project by following the contribution guide.

fluid
Fluid is an open source Kubernetes-native Distributed Dataset Orchestrator and Accelerator for data-intensive applications, such as big data and AI applications. It implements dataset abstraction, scalable cache runtime, automated data operations, elasticity and scheduling, and is runtime platform agnostic. Key concepts include Dataset and Runtime. Prerequisites include Kubernetes version > 1.16, Golang 1.18+, and Helm 3. The tool offers features like accelerating remote file accessing, machine learning, accelerating PVC, preloading dataset, and on-the-fly dataset cache scaling. Contributions are welcomed, and the project is under the Apache 2.0 license with a vendor-neutral approach.

aiges
AIGES is a core component of the Athena Serving Framework, designed as a universal encapsulation tool for AI developers to deploy AI algorithm models and engines quickly. By integrating AIGES, you can deploy AI algorithm models and engines rapidly and host them on the Athena Serving Framework, utilizing supporting auxiliary systems for networking, distribution strategies, data processing, etc. The Athena Serving Framework aims to accelerate the cloud service of AI algorithm models and engines, providing multiple guarantees for cloud service stability through cloud-native architecture. You can efficiently and securely deploy, upgrade, scale, operate, and monitor models and engines without focusing on underlying infrastructure and service-related development, governance, and operations.