github.RepositoryAutolinkReference
Explore with Pulumi AI
This resource allows you to create and manage an autolink reference for a single repository.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const repo = new github.Repository("repo", {
name: "my-repo",
description: "GitHub repo managed by Terraform",
"private": false,
});
const autolink = new github.RepositoryAutolinkReference("autolink", {
repository: repo.name,
keyPrefix: "TICKET-",
targetUrlTemplate: "https://example.com/TICKET?query=<num>",
});
import pulumi
import pulumi_github as github
repo = github.Repository("repo",
name="my-repo",
description="GitHub repo managed by Terraform",
private=False)
autolink = github.RepositoryAutolinkReference("autolink",
repository=repo.name,
key_prefix="TICKET-",
target_url_template="https://example.com/TICKET?query=<num>")
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/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{
Name: pulumi.String("my-repo"),
Description: pulumi.String("GitHub repo managed by Terraform"),
Private: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = github.NewRepositoryAutolinkReference(ctx, "autolink", &github.RepositoryAutolinkReferenceArgs{
Repository: repo.Name,
KeyPrefix: pulumi.String("TICKET-"),
TargetUrlTemplate: pulumi.String("https://example.com/TICKET?query=<num>"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var repo = new Github.Repository("repo", new()
{
Name = "my-repo",
Description = "GitHub repo managed by Terraform",
Private = false,
});
var autolink = new Github.RepositoryAutolinkReference("autolink", new()
{
Repository = repo.Name,
KeyPrefix = "TICKET-",
TargetUrlTemplate = "https://example.com/TICKET?query=<num>",
});
});
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()
.name("my-repo")
.description("GitHub repo managed by Terraform")
.private_(false)
.build());
var autolink = new RepositoryAutolinkReference("autolink", RepositoryAutolinkReferenceArgs.builder()
.repository(repo.name())
.keyPrefix("TICKET-")
.targetUrlTemplate("https://example.com/TICKET?query=<num>")
.build());
}
}
resources:
repo:
type: github:Repository
properties:
name: my-repo
description: GitHub repo managed by Terraform
private: false
autolink:
type: github:RepositoryAutolinkReference
properties:
repository: ${repo.name}
keyPrefix: TICKET-
targetUrlTemplate: https://example.com/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,
is_alphanumeric: Optional[bool] = 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",
IsAlphanumeric = false,
});
example, err := github.NewRepositoryAutolinkReference(ctx, "repositoryAutolinkReferenceResource", &github.RepositoryAutolinkReferenceArgs{
KeyPrefix: pulumi.String("string"),
Repository: pulumi.String("string"),
TargetUrlTemplate: pulumi.String("string"),
IsAlphanumeric: pulumi.Bool(false),
})
var repositoryAutolinkReferenceResource = new RepositoryAutolinkReference("repositoryAutolinkReferenceResource", RepositoryAutolinkReferenceArgs.builder()
.keyPrefix("string")
.repository("string")
.targetUrlTemplate("string")
.isAlphanumeric(false)
.build());
repository_autolink_reference_resource = github.RepositoryAutolinkReference("repositoryAutolinkReferenceResource",
key_prefix="string",
repository="string",
target_url_template="string",
is_alphanumeric=False)
const repositoryAutolinkReferenceResource = new github.RepositoryAutolinkReference("repositoryAutolinkReferenceResource", {
keyPrefix: "string",
repository: "string",
targetUrlTemplate: "string",
isAlphanumeric: false,
});
type: github:RepositoryAutolinkReference
properties:
isAlphanumeric: false
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 - Is
Alphanumeric bool - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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 - Is
Alphanumeric bool - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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 - is
Alphanumeric Boolean - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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 - is
Alphanumeric boolean - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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 - is_
alphanumeric bool - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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 - is
Alphanumeric Boolean - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
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,
is_alphanumeric: Optional[bool] = None,
key_prefix: Optional[str] = None,
repository: Optional[str] = None,
target_url_template: Optional[str] = None) -> RepositoryAutolinkReference
func 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)
Resource lookup is not supported in YAML
- 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.
- Is
Alphanumeric bool - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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.
- Is
Alphanumeric bool - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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.
- is
Alphanumeric Boolean - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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.
- is
Alphanumeric boolean - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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.
- is_
alphanumeric bool - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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.
- is
Alphanumeric Boolean - Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. Default is true.
- 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
Import by key prefix
$ pulumi import github:index/repositoryAutolinkReference:RepositoryAutolinkReference auto oof/OOF-
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
github
Terraform Provider.