Terraform - WunderGraph

Terraform Provider for Cosmo

Terraform is an open-source infrastructure as code (IaC) tool that enables you to safely and predictably create, change, and improve infrastructure. With the Cosmo Terraform provider, you can manage your Cosmo Cloud resources programmatically, ensuring consistent and repeatable deployments.

Installation

To get started with Terraform, you’ll need to install it first. Please follow the official installation guide for detailed instructions.

Provider Configuration

To use the Cosmo provider, you’ll need to configure it in your Terraform configuration. Here’s a basic example:

terraform {
  required_providers {
    cosmo = {
      source = "wundergraph/cosmo"
      version = "~> 0.4.1"
    }
  }
}

provider "cosmo" {
  api_key = var.api_key
}

You can find complete examples in the examples directory.

Why Use Terraform with Cosmo?

Available Resources

Namespaces \ \ Organize and isolate resources using namespaces

Monographs \ \ Define and manage GraphQL schema documentation

Federated Graphs \ \ Manage federated GraphQL schema configurations

Subgraphs \ \ Configure and manage GraphQL subgraphs

Feature Flags \ \ Control feature availability across your GraphQL API

Feature Subgraphs \ \ Configure subgraphs for specific features

Contracts \ \ Define and manage GraphQL contracts between your services

Router Tokens \ \ Manage authentication tokens for your GraphQL router

Considerations

Why should I use Terraform to manage my Cosmo Cloud resources?

Using Terraform provides several benefits:

How does Terraform work with Cosmo Cloud?

The Cosmo Terraform provider allows you to:

What are the prerequisites for using the Cosmo Terraform provider?

To get started, you’ll need:

Can I use Terraform with existing Cosmo Cloud resources?

Yes, you can import existing Cosmo Cloud resources into your Terraform state. This allows you to manage both new and existing resources using Terraform.

How do I get started with the Cosmo Terraform provider?

  1. Install Terraform
  2. Configure the Cosmo provider in your Terraform configuration
  3. Define your resources using the available resource types
  4. Initialize Terraform and apply your configuration

For detailed setup instructions, refer to our provider documentation.

Additional Resources

Terraform Modules

AWS Fargate