Skip to main content

Use the Terraform AWS Provider

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.

As CoreWeave AI Object Storage is S3-compatible, it can be managed using the official Terraform AWS Provider. This provider translates Terraform's declarative syntax into S3-compatible API calls.

Here's an example S3 Terraform provider configuration that sets up the AWS provider with the CoreWeave AI Object Storage endpoint and region:

Example
1
terraform {
2
required_providers {
3
aws = {
4
source = "hashicorp/aws"
5
version = "5.67.0"
6
}
7
}
8
9
required_version = ">= 1.2.0"
10
}
11
12
provider "aws" {
13
access_key = env.AWS_ACCESS_KEY
14
secret_key = env.AWS_ACCESS_SECRET
15
region = local.region
16
17
# These two values must be true so Terraform doesn't attempt STS authentication.
18
skip_credentials_validation = true
19
skip_requesting_account_id = true
20
21
# CoreWeave uses different region names, so validation must be skipped.
22
skip_region_validation = true
23
s3_use_path_style = false
24
25
endpoints {
26
s3 = local.endpoint
27
}
28
}
29
30
locals {
31
region = "us-east-03"
32
endpoint = "https://cwobject.com"
33
}
34

Some aspects of note in this example, highlighted above:

  • access_key and secret_key are set as environment variables for security.
  • skip_credentials_validation, skip_requesting_account_id, and skip_region_validation options are set to true to bypass AWS-specific validation checks.
  • In this example, region is set to us-east-03. Note that CoreWeave AI Object Storage uses different region names than AWS.
  • endpoint is set to https://cwobject.com, which is the CoreWeave AI Object Storage endpoint.
  • The s3_use_path_style option is set to false to use virtual-hosted-style URLs.
Learn more

To learn more about using the AWS provider with Object Storage, see the S3 section of the official documentation.