Skip to main content

Manage AI Object Storage with Terraform

Use Terraform to manage CoreWeave AI Object Storage infrastructure as code

Terraform providers are essential plugins that enable Terraform to manage infrastructure resources on various platforms.

You can use Terraform to manage access policies and configure bucket lifecycles and versioning. As CoreWeave AI Object Storage is S3-compatible, you can manage it using either the CoreWeave Terraform provider or the official Terraform AWS Provider. Both providers translate Terraform's declarative syntax into S3-compatible API calls.

If you want to manage data and objects, you can use any S3-compatible tool to manage your data. See How-To: Manage Objects to learn how to use CoreWeave AI Object Storage with s3cmd, Boto3, or the AWS CLI.

Configure Terraform

These examples show how to set up the Terraform provider with CoreWeave AI Object Storage.

Endpoint selection
  • Use the LOTA endpoint, http://cwlota.com, when running inside a CoreWeave cluster. The LOTA endpoint routes to the LOTA cache for best performance.
  • Use the primary endpoint, https://cwobject.com, when running outside of a CoreWeave cluster.

The AWS provider example configuration includes the required overrides for compatibility with CoreWeave AI Object Storage, while the native CoreWeave provider example configuration does not require these overrides.

Example
1
terraform {
2
required_providers {
3
coreweave = {
4
source = "coreweave/coreweave"
5
version = ">= 0.3.0"
6
}
7
}
8
required_version = ">= 1.2.0"
9
}
10
11
provider "coreweave" {
12
token = env.COREWEAVE_API_TOKEN
13
s3_endpoint = env.COREWEAVE_S3_ENDPOINT # If using LOTA, set to http://cwlota.com
14
}
15

Some aspects to note in this example:

  • token is set as an environment variable for security. Get your API access token from the CoreWeave Access Tokens page in Cloud Console.
  • s3_endpoint defaults to https://cwobject.com, which is the primary CoreWeave AI Object Storage endpoint. If using LOTA, set to http://cwlota.com.
  • version is set to >= 0.3.0 because 0.3.0 is the first version to support AI Object Storage.

Object Storage resources

You can use Terraform to manage organization access policies and bucket access policies, and configure bucket lifecycles and versioning. For detailed examples and documentation, see the CoreWeave provider registry documentation.

Additional resources