Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
layout page_title sidebar_current description
Netlify: netlify_site
Provides an site resource.


Primary settings for a Netlify site - should contain the bulk of your configuration. Allows configuration of most aspects of your Netlify site.

Example Usage

resource "netlify_site" "main" {
  name = "my-site"

  repo {
    command       = "middleman build"
    deploy_key_id = "${}"
    dir           = "/build"
    provider      = "github"
    repo_path     = "username/repo"
    repo_branch   = "master"

Argument Reference

The following arguments are supported:

  • name - (Required) - Name of your site on Netlify (e.g.
  • repo - (Required) - See Repository
  • custom_domain - (Optional) - Custom domain of the site, must be configured using a CNAME in accordance with Netlify's docs. (e.g.
  • deploy_url - (Optional)


repo supports the following arguments:

  • command - (Optional) - Shell command to run before deployment, typically used to build the site
  • deploy_key_id - (Optional) - A deploy key id from the deploy_key resource
  • dir - (Optional) - Directory to deploy, typically where the build puts the processed files
  • provider - (Required) - Name of your VCS provider (e.g. github)
  • repo_path - (Required) - path to your repo, typically username/reponame
  • repo_branch - (Required) - branch to be deployed