published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
This resource allows you to create and manage an autolink reference for a single repository.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var repo = new Github.Repository("repo", new()
{
Description = "GitHub repo managed by Terraform",
Private = false,
});
var auto = new Github.RepositoryAutolinkReference("auto", new()
{
Repository = repo.Name,
KeyPrefix = "TICKET-",
TargetUrlTemplate = "https://hello.there/TICKET?query=<num>",
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v4/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
repo, err := github.NewRepository(ctx, "repo", &github.RepositoryArgs{
Description: pulumi.String("GitHub repo managed by Terraform"),
Private: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = github.NewRepositoryAutolinkReference(ctx, "auto", &github.RepositoryAutolinkReferenceArgs{
Repository: repo.Name,
KeyPrefix: pulumi.String("TICKET-"),
TargetUrlTemplate: pulumi.String("https://hello.there/TICKET?query=<num>"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.RepositoryAutolinkReference;
import com.pulumi.github.RepositoryAutolinkReferenceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var repo = new Repository("repo", RepositoryArgs.builder()
.description("GitHub repo managed by Terraform")
.private_(false)
.build());
var auto = new RepositoryAutolinkReference("auto", RepositoryAutolinkReferenceArgs.builder()
.repository(repo.name())
.keyPrefix("TICKET-")
.targetUrlTemplate("https://hello.there/TICKET?query=<num>")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const repo = new github.Repository("repo", {
description: "GitHub repo managed by Terraform",
"private": false,
});
const auto = new github.RepositoryAutolinkReference("auto", {
repository: repo.name,
keyPrefix: "TICKET-",
targetUrlTemplate: "https://hello.there/TICKET?query=<num>",
});
import pulumi
import pulumi_github as github
repo = github.Repository("repo",
description="GitHub repo managed by Terraform",
private=False)
auto = github.RepositoryAutolinkReference("auto",
repository=repo.name,
key_prefix="TICKET-",
target_url_template="https://hello.there/TICKET?query=<num>")
resources:
repo:
type: github:Repository
properties:
description: GitHub repo managed by Terraform
private: false
auto:
type: github:RepositoryAutolinkReference
properties:
repository: ${repo.name}
keyPrefix: TICKET-
targetUrlTemplate: https://hello.there/TICKET?query=<num>
Create RepositoryAutolinkReference Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RepositoryAutolinkReference(name: string, args: RepositoryAutolinkReferenceArgs, opts?: CustomResourceOptions);@overload
def RepositoryAutolinkReference(resource_name: str,
args: RepositoryAutolinkReferenceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RepositoryAutolinkReference(resource_name: str,
opts: Optional[ResourceOptions] = None,
key_prefix: Optional[str] = None,
repository: Optional[str] = None,
target_url_template: Optional[str] = None)func NewRepositoryAutolinkReference(ctx *Context, name string, args RepositoryAutolinkReferenceArgs, opts ...ResourceOption) (*RepositoryAutolinkReference, error)public RepositoryAutolinkReference(string name, RepositoryAutolinkReferenceArgs args, CustomResourceOptions? opts = null)
public RepositoryAutolinkReference(String name, RepositoryAutolinkReferenceArgs args)
public RepositoryAutolinkReference(String name, RepositoryAutolinkReferenceArgs args, CustomResourceOptions options)
type: github:RepositoryAutolinkReference
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RepositoryAutolinkReferenceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RepositoryAutolinkReferenceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RepositoryAutolinkReferenceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryAutolinkReferenceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryAutolinkReferenceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var repositoryAutolinkReferenceResource = new Github.RepositoryAutolinkReference("repositoryAutolinkReferenceResource", new()
{
KeyPrefix = "string",
Repository = "string",
TargetUrlTemplate = "string",
});
example, err := github.NewRepositoryAutolinkReference(ctx, "repositoryAutolinkReferenceResource", &github.RepositoryAutolinkReferenceArgs{
KeyPrefix: pulumi.String("string"),
Repository: pulumi.String("string"),
TargetUrlTemplate: pulumi.String("string"),
})
var repositoryAutolinkReferenceResource = new RepositoryAutolinkReference("repositoryAutolinkReferenceResource", RepositoryAutolinkReferenceArgs.builder()
.keyPrefix("string")
.repository("string")
.targetUrlTemplate("string")
.build());
repository_autolink_reference_resource = github.RepositoryAutolinkReference("repositoryAutolinkReferenceResource",
key_prefix="string",
repository="string",
target_url_template="string")
const repositoryAutolinkReferenceResource = new github.RepositoryAutolinkReference("repositoryAutolinkReferenceResource", {
keyPrefix: "string",
repository: "string",
targetUrlTemplate: "string",
});
type: github:RepositoryAutolinkReference
properties:
keyPrefix: string
repository: string
targetUrlTemplate: string
RepositoryAutolinkReference Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RepositoryAutolinkReference resource accepts the following input properties:
- Key
Prefix string - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- Repository string
- The repository of the autolink reference.
- Target
Url stringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- Key
Prefix string - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- Repository string
- The repository of the autolink reference.
- Target
Url stringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- key
Prefix String - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository String
- The repository of the autolink reference.
- target
Url StringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- key
Prefix string - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository string
- The repository of the autolink reference.
- target
Url stringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- key_
prefix str - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository str
- The repository of the autolink reference.
- target_
url_ strtemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- key
Prefix String - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository String
- The repository of the autolink reference.
- target
Url StringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
Outputs
All input properties are implicitly available as output properties. Additionally, the RepositoryAutolinkReference resource produces the following output properties:
Look up Existing RepositoryAutolinkReference Resource
Get an existing RepositoryAutolinkReference resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RepositoryAutolinkReferenceState, opts?: CustomResourceOptions): RepositoryAutolinkReference@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
etag: Optional[str] = None,
key_prefix: Optional[str] = None,
repository: Optional[str] = None,
target_url_template: Optional[str] = None) -> RepositoryAutolinkReferencefunc GetRepositoryAutolinkReference(ctx *Context, name string, id IDInput, state *RepositoryAutolinkReferenceState, opts ...ResourceOption) (*RepositoryAutolinkReference, error)public static RepositoryAutolinkReference Get(string name, Input<string> id, RepositoryAutolinkReferenceState? state, CustomResourceOptions? opts = null)public static RepositoryAutolinkReference get(String name, Output<String> id, RepositoryAutolinkReferenceState state, CustomResourceOptions options)resources: _: type: github:RepositoryAutolinkReference get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Etag string
- An etag representing the autolink reference object.
- Key
Prefix string - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- Repository string
- The repository of the autolink reference.
- Target
Url stringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- Etag string
- An etag representing the autolink reference object.
- Key
Prefix string - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- Repository string
- The repository of the autolink reference.
- Target
Url stringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- etag String
- An etag representing the autolink reference object.
- key
Prefix String - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository String
- The repository of the autolink reference.
- target
Url StringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- etag string
- An etag representing the autolink reference object.
- key
Prefix string - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository string
- The repository of the autolink reference.
- target
Url stringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- etag str
- An etag representing the autolink reference object.
- key_
prefix str - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository str
- The repository of the autolink reference.
- target_
url_ strtemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
- etag String
- An etag representing the autolink reference object.
- key
Prefix String - This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
- repository String
- The repository of the autolink reference.
- target
Url StringTemplate - The template of the target URL used for the links; must be a valid URL and contain
<num>for the reference number
Import
Autolink references can be imported using the name of the repository, combined with the id of the autolink reference and a / character for separating components, e.g.
$ pulumi import github:index/repositoryAutolinkReference:RepositoryAutolinkReference auto oof/123
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
githubTerraform Provider.
published on Monday, Mar 9, 2026 by Pulumi
