github_repository_autolink_reference

This resource allows you to create and manage an autolink reference for a single repository.

Example Usage

resource "github_repository" "repo" {
  name         = "my-repo"
  description  = "GitHub repo managed by Terraform"

  private = false
}

resource "github_repository_autolink_reference" "autolink" {
  repository = github_repository.repo.name

  key_prefix = "TICKET-"

  target_url_template = "https://example.com/TICKET?query=<num>"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following additional attributes are exported:

Import

Autolink references can be imported using the name of the repository, combined with the id or key prefix of the autolink reference and a / character for separating components, e.g.

Import by ID

terraform import github_repository_autolink_reference.auto my-repo/123

See the GitHub documentation for how to list all autolinks of a repository to learn the autolink ids to use with the import command.

Import by key prefix

terraform import github_repository_autolink_reference.auto oof/OOF-