Skip to main content
Terraform services provision and manage cloud infrastructure using Terraform modules. Use them to create resources like S3 buckets, databases, and other cloud infrastructure.

Build from Source

Package Terraform modules from your GitHub repository. Ryvn will package the Terraform files from your repository and create versioned releases that can be deployed across environments.
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: s3-buckets
spec:
  type: terraform
  repo: acme/infra
  build:
    path: modules/s3
For Terraform files at the repository root, omit the path field or use ..
kind: Service
metadata:
  name: storage
spec:
  type: terraform
  repo: acme/infra

Use Public Modules

From Terraform Registry:
kind: Service
metadata:
  name: s3-bucket
spec:
  type: terraform
  source: terraform-aws-modules/s3-bucket/aws
Omit repo when referencing a module from a Terraform Registry
From Public GitHub repo:
kind: Service
metadata:
  name: rds
spec:
  type: terraform
  source: github.com/terraform-aws-modules/terraform-aws-rds

Properties

name

string — required Service identifier. Must be lowercase, alphanumeric with hyphens only.
name: s3-buckets

type

string — required Must be terraform.
type: terraform

repo

string — conditional GitHub repository in owner/repo format. Required when building from source.
repo: acme/infra

source

string — conditional Terraform module source reference. Required when using public modules. Supports Terraform Registry modules, GitHub, Git repositories, etc. Do not include version/ref—Ryvn manages versioning.
# Terraform Registry
source: hashicorp/vpc/aws

# GitHub
source: github.com/org/repo//modules/vpc

autoApprove

boolean — optional Auto-approve Terraform plans during deployments. Use with caution in production environments.
autoApprove: true

promotionPipeline

string — optional Name of promotion pipeline to follow for automated release promotion.
promotionPipeline: main-pipeline

maintenanceWindow

string — optional Maintenance window for this service. Automated deployments will only occur during specified intervals.
maintenanceWindow: overnight

build.path

string — optional Directory containing .tf files, relative to repository root. Defaults to repository root if not specified. Required when building from source.
build:
  path: modules/vpc

build.tagPrefix

string — optional Git tag prefix for versioning. The version number will be appended to this prefix. For example, infra@ creates tags like infra@0.1.0.
build:
  tagPrefix: infra@

Examples

# storage.service.yaml
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: storage
spec:
  type: terraform
  repo: acme/infra
  build:
    path: modules/s3
    tagPrefix: storage@

# database.service.yaml
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: database
spec:
  type: terraform
  repo: acme/infra
  build:
    path: modules/rds
    tagPrefix: db@
Using public modules:
# rds.service.yaml
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: rds
spec:
  type: terraform
  source: terraform-aws-modules/rds/aws

# s3-bucket.service.yaml
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: s3-bucket
spec:
  type: terraform
  source: terraform-aws-modules/s3-bucket/aws