Skip to content

Terraform module which deploys a static site to DigitalOcean App Platform

License

Notifications You must be signed in to change notification settings

GonzalezAndrew/terraform-digitalocean-app-site

Repository files navigation

Terraform DigitalOcean Static Site App Platform Module

A Terraform module for deploying a static site to DigitalOcean App Platform.


pre-commit License: MIT

Requirements

Name Version
terraform >= 0.15.1, < 1.1.4
digitalocean >= 2.4.0

Providers

Name Version
digitalocean 2.16.0

Modules

No modules.

Resources

Name Type
digitalocean_app.this resource

Inputs

Name Description Type Default Required
spec (Required) A DigitalOcean App spec describing the app. any [] no

Outputs

Name Description
active_deployment_id The ID the app's currently active deployment.
created_at The date and time of when the app was created.
default_ingress The default URL to access the app.
id ID of the app.
live_url The live URL of the app.
updated_at The date and time of when the app was last updated.

Example

Deploy a Hugo static site using the module.

module "hugo_blog" {
  source = "../"
  spec = [{
    name   = "test"
    region = "nyc1"

    domain = {
      name = "test.gonzalezandrew.com"
      type = "PRIMARY"
      zone = "gonzalezandrew.com"
    }

    static_site = {
      name             = "blog"
      build_command    = "hugo -d public"
      environment_slug = "hugo"
      source_dir       = "/"

      github = {
        repo           = "GonzalezAndrew/blog"
        branch         = "master"
        deploy_on_push = true
      }

      routes = {
        path = "/"
      }
    }
  }]
}

About

Terraform module which deploys a static site to DigitalOcean App Platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages