gitlab.GroupProjectFileTemplate
Explore with Pulumi AI
The gitlab.GroupProjectFileTemplate
resource allows setting a project from which
custom file templates will be loaded. In order to use this resource, the project selected must be a direct child of
the group selected. After the resource has run, gitlab_project_template.template_project_id
is available for use.
For more information about which file types are available as templates, view
GitLab’s documentation
This resource requires a GitLab Enterprise instance with a Premium license.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const foo = new gitlab.Group("foo", {
name: "group",
path: "group",
description: "An example group",
});
const bar = new gitlab.Project("bar", {
name: "template project",
description: "contains file templates",
visibilityLevel: "public",
namespaceId: foo.id,
});
const templateLink = new gitlab.GroupProjectFileTemplate("template_link", {
groupId: foo.id,
fileTemplateProjectId: bar.id,
});
import pulumi
import pulumi_gitlab as gitlab
foo = gitlab.Group("foo",
name="group",
path="group",
description="An example group")
bar = gitlab.Project("bar",
name="template project",
description="contains file templates",
visibility_level="public",
namespace_id=foo.id)
template_link = gitlab.GroupProjectFileTemplate("template_link",
group_id=foo.id,
file_template_project_id=bar.id)
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := gitlab.NewGroup(ctx, "foo", &gitlab.GroupArgs{
Name: pulumi.String("group"),
Path: pulumi.String("group"),
Description: pulumi.String("An example group"),
})
if err != nil {
return err
}
bar, err := gitlab.NewProject(ctx, "bar", &gitlab.ProjectArgs{
Name: pulumi.String("template project"),
Description: pulumi.String("contains file templates"),
VisibilityLevel: pulumi.String("public"),
NamespaceId: foo.ID(),
})
if err != nil {
return err
}
_, err = gitlab.NewGroupProjectFileTemplate(ctx, "template_link", &gitlab.GroupProjectFileTemplateArgs{
GroupId: foo.ID(),
FileTemplateProjectId: bar.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var foo = new GitLab.Group("foo", new()
{
Name = "group",
Path = "group",
Description = "An example group",
});
var bar = new GitLab.Project("bar", new()
{
Name = "template project",
Description = "contains file templates",
VisibilityLevel = "public",
NamespaceId = foo.Id,
});
var templateLink = new GitLab.GroupProjectFileTemplate("template_link", new()
{
GroupId = foo.Id,
FileTemplateProjectId = bar.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Group;
import com.pulumi.gitlab.GroupArgs;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.GroupProjectFileTemplate;
import com.pulumi.gitlab.GroupProjectFileTemplateArgs;
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 foo = new Group("foo", GroupArgs.builder()
.name("group")
.path("group")
.description("An example group")
.build());
var bar = new Project("bar", ProjectArgs.builder()
.name("template project")
.description("contains file templates")
.visibilityLevel("public")
.namespaceId(foo.id())
.build());
var templateLink = new GroupProjectFileTemplate("templateLink", GroupProjectFileTemplateArgs.builder()
.groupId(foo.id())
.fileTemplateProjectId(bar.id())
.build());
}
}
resources:
foo:
type: gitlab:Group
properties:
name: group
path: group
description: An example group
bar:
type: gitlab:Project
properties:
name: template project
description: contains file templates
visibilityLevel: public
namespaceId: ${foo.id}
templateLink:
type: gitlab:GroupProjectFileTemplate
name: template_link
properties:
groupId: ${foo.id}
fileTemplateProjectId: ${bar.id}
Create GroupProjectFileTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GroupProjectFileTemplate(name: string, args: GroupProjectFileTemplateArgs, opts?: CustomResourceOptions);
@overload
def GroupProjectFileTemplate(resource_name: str,
args: GroupProjectFileTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GroupProjectFileTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
file_template_project_id: Optional[int] = None,
group_id: Optional[int] = None)
func NewGroupProjectFileTemplate(ctx *Context, name string, args GroupProjectFileTemplateArgs, opts ...ResourceOption) (*GroupProjectFileTemplate, error)
public GroupProjectFileTemplate(string name, GroupProjectFileTemplateArgs args, CustomResourceOptions? opts = null)
public GroupProjectFileTemplate(String name, GroupProjectFileTemplateArgs args)
public GroupProjectFileTemplate(String name, GroupProjectFileTemplateArgs args, CustomResourceOptions options)
type: gitlab:GroupProjectFileTemplate
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 GroupProjectFileTemplateArgs
- 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 GroupProjectFileTemplateArgs
- 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 GroupProjectFileTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupProjectFileTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupProjectFileTemplateArgs
- 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 groupProjectFileTemplateResource = new GitLab.GroupProjectFileTemplate("groupProjectFileTemplateResource", new()
{
FileTemplateProjectId = 0,
GroupId = 0,
});
example, err := gitlab.NewGroupProjectFileTemplate(ctx, "groupProjectFileTemplateResource", &gitlab.GroupProjectFileTemplateArgs{
FileTemplateProjectId: pulumi.Int(0),
GroupId: pulumi.Int(0),
})
var groupProjectFileTemplateResource = new GroupProjectFileTemplate("groupProjectFileTemplateResource", GroupProjectFileTemplateArgs.builder()
.fileTemplateProjectId(0)
.groupId(0)
.build());
group_project_file_template_resource = gitlab.GroupProjectFileTemplate("groupProjectFileTemplateResource",
file_template_project_id=0,
group_id=0)
const groupProjectFileTemplateResource = new gitlab.GroupProjectFileTemplate("groupProjectFileTemplateResource", {
fileTemplateProjectId: 0,
groupId: 0,
});
type: gitlab:GroupProjectFileTemplate
properties:
fileTemplateProjectId: 0
groupId: 0
GroupProjectFileTemplate 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 GroupProjectFileTemplate resource accepts the following input properties:
- File
Template intProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- Group
Id int - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- File
Template intProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- Group
Id int - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file
Template IntegerProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group
Id Integer - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file
Template numberProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group
Id number - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file_
template_ intproject_ id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group_
id int - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file
Template NumberProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group
Id Number - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
Outputs
All input properties are implicitly available as output properties. Additionally, the GroupProjectFileTemplate resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing GroupProjectFileTemplate Resource
Get an existing GroupProjectFileTemplate 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?: GroupProjectFileTemplateState, opts?: CustomResourceOptions): GroupProjectFileTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
file_template_project_id: Optional[int] = None,
group_id: Optional[int] = None) -> GroupProjectFileTemplate
func GetGroupProjectFileTemplate(ctx *Context, name string, id IDInput, state *GroupProjectFileTemplateState, opts ...ResourceOption) (*GroupProjectFileTemplate, error)
public static GroupProjectFileTemplate Get(string name, Input<string> id, GroupProjectFileTemplateState? state, CustomResourceOptions? opts = null)
public static GroupProjectFileTemplate get(String name, Output<String> id, GroupProjectFileTemplateState 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.
- File
Template intProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- Group
Id int - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- File
Template intProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- Group
Id int - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file
Template IntegerProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group
Id Integer - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file
Template numberProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group
Id number - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file_
template_ intproject_ id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group_
id int - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
- file
Template NumberProject Id - The ID of the project that will be used for file templates. This project must be the direct child of the project defined by the group_id
- group
Id Number - The ID of the group that will use the file template project. This group must be the direct parent of the project defined by project_id
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlab
Terraform Provider.