Terraform modules allow you to provision and manage cloud infrastructure as code. With Ryvn, you can deploy Terraform configurations from GitHub repositories while benefiting from automated state management and secure credential handling.

For comprehensive details about Terraform services in Ryvn, see the Terraform service documentation.

Prerequisites

Before deploying a Terraform module, ensure you have:

  • A GitHub repository containing your Terraform configuration
  • The Terraform backend configured for Kubernetes (required for Ryvn)
  • Appropriate cloud provider permissions configured in your environment

Quick Start

1

Create a Terraform Service

Navigate to ServicesCreate Service → Select Terraform

2

Configure GitHub Source

  • Select your GitHub repository
  • (Optional) Specify the Terraform path if in a subdirectory
3

Configure Backend

Add to your Terraform configuration:

terraform {
  backend "kubernetes" {}
}
4

Deploy to Environment

Go to Environments → Select environment → Add Installation → Deploy

Example Terraform Module

Here’s a minimal example that works with Ryvn:

terraform {
  required_version = ">= 1.0"

  backend "kubernetes" {}

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

variable "bucket_name" {
  description = "Name of the S3 bucket"
  type        = string
}

resource "aws_s3_bucket" "main" {
  bucket = var.bucket_name

  tags = {
    ManagedBy = "Terraform"
  }
}

output "bucket_arn" {
  value = aws_s3_bucket.main.arn
}

Common Issues