gitlab.RepositoryFile
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
import * as std from "@pulumi/std";
const _this = new gitlab.Group("this", {
    name: "example",
    path: "example",
    description: "An example group",
});
const thisProject = new gitlab.Project("this", {
    name: "example",
    namespaceId: _this.id,
    initializeWithReadme: true,
});
const thisRepositoryFile = new gitlab.RepositoryFile("this", {
    project: thisProject.id,
    filePath: "meow.txt",
    branch: "main",
    content: std.base64encode({
        input: "Meow goes the cat",
    }).then(invoke => invoke.result),
    authorEmail: "terraform@example.com",
    authorName: "Terraform",
    commitMessage: "feature: add meow file",
});
const readme = new gitlab.RepositoryFile("readme", {
    project: thisProject.id,
    filePath: "readme.txt",
    branch: "main",
    content: "Meow goes the cat",
    authorEmail: "terraform@example.com",
    authorName: "Terraform",
    commitMessage: "feature: add readme file",
});
const readmeForDogs = new gitlab.RepositoryFile("readme_for_dogs", {
    project: thisProject.id,
    filePath: "readme.txt",
    branch: "main",
    content: "Bark goes the dog",
    authorEmail: "terraform@example.com",
    authorName: "Terraform",
    commitMessage: "feature: update readme file",
    overwriteOnCreate: true,
});
import pulumi
import pulumi_gitlab as gitlab
import pulumi_std as std
this = gitlab.Group("this",
    name="example",
    path="example",
    description="An example group")
this_project = gitlab.Project("this",
    name="example",
    namespace_id=this.id,
    initialize_with_readme=True)
this_repository_file = gitlab.RepositoryFile("this",
    project=this_project.id,
    file_path="meow.txt",
    branch="main",
    content=std.base64encode(input="Meow goes the cat").result,
    author_email="terraform@example.com",
    author_name="Terraform",
    commit_message="feature: add meow file")
readme = gitlab.RepositoryFile("readme",
    project=this_project.id,
    file_path="readme.txt",
    branch="main",
    content="Meow goes the cat",
    author_email="terraform@example.com",
    author_name="Terraform",
    commit_message="feature: add readme file")
readme_for_dogs = gitlab.RepositoryFile("readme_for_dogs",
    project=this_project.id,
    file_path="readme.txt",
    branch="main",
    content="Bark goes the dog",
    author_email="terraform@example.com",
    author_name="Terraform",
    commit_message="feature: update readme file",
    overwrite_on_create=True)
package main
import (
	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		this, err := gitlab.NewGroup(ctx, "this", &gitlab.GroupArgs{
			Name:        pulumi.String("example"),
			Path:        pulumi.String("example"),
			Description: pulumi.String("An example group"),
		})
		if err != nil {
			return err
		}
		thisProject, err := gitlab.NewProject(ctx, "this", &gitlab.ProjectArgs{
			Name:                 pulumi.String("example"),
			NamespaceId:          this.ID(),
			InitializeWithReadme: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
			Input: "Meow goes the cat",
		}, nil)
		if err != nil {
			return err
		}
		_, err = gitlab.NewRepositoryFile(ctx, "this", &gitlab.RepositoryFileArgs{
			Project:       thisProject.ID(),
			FilePath:      pulumi.String("meow.txt"),
			Branch:        pulumi.String("main"),
			Content:       pulumi.String(invokeBase64encode.Result),
			AuthorEmail:   pulumi.String("terraform@example.com"),
			AuthorName:    pulumi.String("Terraform"),
			CommitMessage: pulumi.String("feature: add meow file"),
		})
		if err != nil {
			return err
		}
		_, err = gitlab.NewRepositoryFile(ctx, "readme", &gitlab.RepositoryFileArgs{
			Project:       thisProject.ID(),
			FilePath:      pulumi.String("readme.txt"),
			Branch:        pulumi.String("main"),
			Content:       pulumi.String("Meow goes the cat"),
			AuthorEmail:   pulumi.String("terraform@example.com"),
			AuthorName:    pulumi.String("Terraform"),
			CommitMessage: pulumi.String("feature: add readme file"),
		})
		if err != nil {
			return err
		}
		_, err = gitlab.NewRepositoryFile(ctx, "readme_for_dogs", &gitlab.RepositoryFileArgs{
			Project:           thisProject.ID(),
			FilePath:          pulumi.String("readme.txt"),
			Branch:            pulumi.String("main"),
			Content:           pulumi.String("Bark goes the dog"),
			AuthorEmail:       pulumi.String("terraform@example.com"),
			AuthorName:        pulumi.String("Terraform"),
			CommitMessage:     pulumi.String("feature: update readme file"),
			OverwriteOnCreate: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() => 
{
    var @this = new GitLab.Group("this", new()
    {
        Name = "example",
        Path = "example",
        Description = "An example group",
    });
    var thisProject = new GitLab.Project("this", new()
    {
        Name = "example",
        NamespaceId = @this.Id,
        InitializeWithReadme = true,
    });
    var thisRepositoryFile = new GitLab.RepositoryFile("this", new()
    {
        Project = thisProject.Id,
        FilePath = "meow.txt",
        Branch = "main",
        Content = Std.Base64encode.Invoke(new()
        {
            Input = "Meow goes the cat",
        }).Apply(invoke => invoke.Result),
        AuthorEmail = "terraform@example.com",
        AuthorName = "Terraform",
        CommitMessage = "feature: add meow file",
    });
    var readme = new GitLab.RepositoryFile("readme", new()
    {
        Project = thisProject.Id,
        FilePath = "readme.txt",
        Branch = "main",
        Content = "Meow goes the cat",
        AuthorEmail = "terraform@example.com",
        AuthorName = "Terraform",
        CommitMessage = "feature: add readme file",
    });
    var readmeForDogs = new GitLab.RepositoryFile("readme_for_dogs", new()
    {
        Project = thisProject.Id,
        FilePath = "readme.txt",
        Branch = "main",
        Content = "Bark goes the dog",
        AuthorEmail = "terraform@example.com",
        AuthorName = "Terraform",
        CommitMessage = "feature: update readme file",
        OverwriteOnCreate = true,
    });
});
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.RepositoryFile;
import com.pulumi.gitlab.RepositoryFileArgs;
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 this_ = new Group("this", GroupArgs.builder()
            .name("example")
            .path("example")
            .description("An example group")
            .build());
        var thisProject = new Project("thisProject", ProjectArgs.builder()
            .name("example")
            .namespaceId(this_.id())
            .initializeWithReadme(true)
            .build());
        var thisRepositoryFile = new RepositoryFile("thisRepositoryFile", RepositoryFileArgs.builder()
            .project(thisProject.id())
            .filePath("meow.txt")
            .branch("main")
            .content(StdFunctions.base64encode(Base64encodeArgs.builder()
                .input("Meow goes the cat")
                .build()).result())
            .authorEmail("terraform@example.com")
            .authorName("Terraform")
            .commitMessage("feature: add meow file")
            .build());
        var readme = new RepositoryFile("readme", RepositoryFileArgs.builder()
            .project(thisProject.id())
            .filePath("readme.txt")
            .branch("main")
            .content("Meow goes the cat")
            .authorEmail("terraform@example.com")
            .authorName("Terraform")
            .commitMessage("feature: add readme file")
            .build());
        var readmeForDogs = new RepositoryFile("readmeForDogs", RepositoryFileArgs.builder()
            .project(thisProject.id())
            .filePath("readme.txt")
            .branch("main")
            .content("Bark goes the dog")
            .authorEmail("terraform@example.com")
            .authorName("Terraform")
            .commitMessage("feature: update readme file")
            .overwriteOnCreate(true)
            .build());
    }
}
resources:
  this:
    type: gitlab:Group
    properties:
      name: example
      path: example
      description: An example group
  thisProject:
    type: gitlab:Project
    name: this
    properties:
      name: example
      namespaceId: ${this.id}
      initializeWithReadme: true
  thisRepositoryFile:
    type: gitlab:RepositoryFile
    name: this
    properties:
      project: ${thisProject.id}
      filePath: meow.txt
      branch: main
      content:
        fn::invoke:
          function: std:base64encode
          arguments:
            input: Meow goes the cat
          return: result
      authorEmail: terraform@example.com
      authorName: Terraform
      commitMessage: 'feature: add meow file'
  readme:
    type: gitlab:RepositoryFile
    properties:
      project: ${thisProject.id}
      filePath: readme.txt
      branch: main
      content: Meow goes the cat
      authorEmail: terraform@example.com
      authorName: Terraform
      commitMessage: 'feature: add readme file'
  readmeForDogs:
    type: gitlab:RepositoryFile
    name: readme_for_dogs
    properties:
      project: ${thisProject.id}
      filePath: readme.txt
      branch: main
      content: Bark goes the dog
      authorEmail: terraform@example.com
      authorName: Terraform
      commitMessage: 'feature: update readme file'
      overwriteOnCreate: true
Create RepositoryFile Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RepositoryFile(name: string, args: RepositoryFileArgs, opts?: CustomResourceOptions);@overload
def RepositoryFile(resource_name: str,
                   args: RepositoryFileArgs,
                   opts: Optional[ResourceOptions] = None)
@overload
def RepositoryFile(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   content: Optional[str] = None,
                   project: Optional[str] = None,
                   branch: Optional[str] = None,
                   file_path: Optional[str] = None,
                   commit_message: Optional[str] = None,
                   create_commit_message: Optional[str] = None,
                   delete_commit_message: Optional[str] = None,
                   encoding: Optional[str] = None,
                   execute_filemode: Optional[bool] = None,
                   author_email: Optional[str] = None,
                   overwrite_on_create: Optional[bool] = None,
                   author_name: Optional[str] = None,
                   start_branch: Optional[str] = None,
                   update_commit_message: Optional[str] = None)func NewRepositoryFile(ctx *Context, name string, args RepositoryFileArgs, opts ...ResourceOption) (*RepositoryFile, error)public RepositoryFile(string name, RepositoryFileArgs args, CustomResourceOptions? opts = null)
public RepositoryFile(String name, RepositoryFileArgs args)
public RepositoryFile(String name, RepositoryFileArgs args, CustomResourceOptions options)
type: gitlab:RepositoryFile
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 RepositoryFileArgs
- 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 RepositoryFileArgs
- 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 RepositoryFileArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryFileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryFileArgs
- 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 repositoryFileResource = new GitLab.RepositoryFile("repositoryFileResource", new()
{
    Content = "string",
    Project = "string",
    Branch = "string",
    FilePath = "string",
    CommitMessage = "string",
    CreateCommitMessage = "string",
    DeleteCommitMessage = "string",
    Encoding = "string",
    ExecuteFilemode = false,
    AuthorEmail = "string",
    OverwriteOnCreate = false,
    AuthorName = "string",
    StartBranch = "string",
    UpdateCommitMessage = "string",
});
example, err := gitlab.NewRepositoryFile(ctx, "repositoryFileResource", &gitlab.RepositoryFileArgs{
	Content:             pulumi.String("string"),
	Project:             pulumi.String("string"),
	Branch:              pulumi.String("string"),
	FilePath:            pulumi.String("string"),
	CommitMessage:       pulumi.String("string"),
	CreateCommitMessage: pulumi.String("string"),
	DeleteCommitMessage: pulumi.String("string"),
	Encoding:            pulumi.String("string"),
	ExecuteFilemode:     pulumi.Bool(false),
	AuthorEmail:         pulumi.String("string"),
	OverwriteOnCreate:   pulumi.Bool(false),
	AuthorName:          pulumi.String("string"),
	StartBranch:         pulumi.String("string"),
	UpdateCommitMessage: pulumi.String("string"),
})
var repositoryFileResource = new RepositoryFile("repositoryFileResource", RepositoryFileArgs.builder()
    .content("string")
    .project("string")
    .branch("string")
    .filePath("string")
    .commitMessage("string")
    .createCommitMessage("string")
    .deleteCommitMessage("string")
    .encoding("string")
    .executeFilemode(false)
    .authorEmail("string")
    .overwriteOnCreate(false)
    .authorName("string")
    .startBranch("string")
    .updateCommitMessage("string")
    .build());
repository_file_resource = gitlab.RepositoryFile("repositoryFileResource",
    content="string",
    project="string",
    branch="string",
    file_path="string",
    commit_message="string",
    create_commit_message="string",
    delete_commit_message="string",
    encoding="string",
    execute_filemode=False,
    author_email="string",
    overwrite_on_create=False,
    author_name="string",
    start_branch="string",
    update_commit_message="string")
const repositoryFileResource = new gitlab.RepositoryFile("repositoryFileResource", {
    content: "string",
    project: "string",
    branch: "string",
    filePath: "string",
    commitMessage: "string",
    createCommitMessage: "string",
    deleteCommitMessage: "string",
    encoding: "string",
    executeFilemode: false,
    authorEmail: "string",
    overwriteOnCreate: false,
    authorName: "string",
    startBranch: "string",
    updateCommitMessage: "string",
});
type: gitlab:RepositoryFile
properties:
    authorEmail: string
    authorName: string
    branch: string
    commitMessage: string
    content: string
    createCommitMessage: string
    deleteCommitMessage: string
    encoding: string
    executeFilemode: false
    filePath: string
    overwriteOnCreate: false
    project: string
    startBranch: string
    updateCommitMessage: string
RepositoryFile 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 RepositoryFile resource accepts the following input properties:
- Branch string
- Name of the branch to which to commit to.
- Content string
- File content.
- FilePath string
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- Project string
- The name or ID of the project.
- string
- Email of the commit author.
- string
- Name of the commit author.
- CommitMessage string
- Commit message.
- CreateCommit stringMessage 
- Create commit message.
- DeleteCommit stringMessage 
- Delete Commit message.
- Encoding string
- The file content encoding. Default value is base64. Valid values are:base64,text.
- ExecuteFilemode bool
- Enables or disables the execute flag on the file.
- OverwriteOn boolCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- StartBranch string
- Name of the branch to start the new commit from.
- UpdateCommit stringMessage 
- Update commit message.
- Branch string
- Name of the branch to which to commit to.
- Content string
- File content.
- FilePath string
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- Project string
- The name or ID of the project.
- string
- Email of the commit author.
- string
- Name of the commit author.
- CommitMessage string
- Commit message.
- CreateCommit stringMessage 
- Create commit message.
- DeleteCommit stringMessage 
- Delete Commit message.
- Encoding string
- The file content encoding. Default value is base64. Valid values are:base64,text.
- ExecuteFilemode bool
- Enables or disables the execute flag on the file.
- OverwriteOn boolCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- StartBranch string
- Name of the branch to start the new commit from.
- UpdateCommit stringMessage 
- Update commit message.
- branch String
- Name of the branch to which to commit to.
- content String
- File content.
- filePath String
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- project String
- The name or ID of the project.
- String
- Email of the commit author.
- String
- Name of the commit author.
- commitMessage String
- Commit message.
- createCommit StringMessage 
- Create commit message.
- deleteCommit StringMessage 
- Delete Commit message.
- encoding String
- The file content encoding. Default value is base64. Valid values are:base64,text.
- executeFilemode Boolean
- Enables or disables the execute flag on the file.
- overwriteOn BooleanCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- startBranch String
- Name of the branch to start the new commit from.
- updateCommit StringMessage 
- Update commit message.
- branch string
- Name of the branch to which to commit to.
- content string
- File content.
- filePath string
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- project string
- The name or ID of the project.
- string
- Email of the commit author.
- string
- Name of the commit author.
- commitMessage string
- Commit message.
- createCommit stringMessage 
- Create commit message.
- deleteCommit stringMessage 
- Delete Commit message.
- encoding string
- The file content encoding. Default value is base64. Valid values are:base64,text.
- executeFilemode boolean
- Enables or disables the execute flag on the file.
- overwriteOn booleanCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- startBranch string
- Name of the branch to start the new commit from.
- updateCommit stringMessage 
- Update commit message.
- branch str
- Name of the branch to which to commit to.
- content str
- File content.
- file_path str
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- project str
- The name or ID of the project.
- str
- Email of the commit author.
- str
- Name of the commit author.
- commit_message str
- Commit message.
- create_commit_ strmessage 
- Create commit message.
- delete_commit_ strmessage 
- Delete Commit message.
- encoding str
- The file content encoding. Default value is base64. Valid values are:base64,text.
- execute_filemode bool
- Enables or disables the execute flag on the file.
- overwrite_on_ boolcreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- start_branch str
- Name of the branch to start the new commit from.
- update_commit_ strmessage 
- Update commit message.
- branch String
- Name of the branch to which to commit to.
- content String
- File content.
- filePath String
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- project String
- The name or ID of the project.
- String
- Email of the commit author.
- String
- Name of the commit author.
- commitMessage String
- Commit message.
- createCommit StringMessage 
- Create commit message.
- deleteCommit StringMessage 
- Delete Commit message.
- encoding String
- The file content encoding. Default value is base64. Valid values are:base64,text.
- executeFilemode Boolean
- Enables or disables the execute flag on the file.
- overwriteOn BooleanCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- startBranch String
- Name of the branch to start the new commit from.
- updateCommit StringMessage 
- Update commit message.
Outputs
All input properties are implicitly available as output properties. Additionally, the RepositoryFile resource produces the following output properties:
- BlobId string
- The blob id.
- CommitId string
- The commit id.
- ContentSha256 string
- File content sha256 digest.
- FileName string
- The filename.
- Id string
- The provider-assigned unique ID for this managed resource.
- LastCommit stringId 
- The last known commit id.
- Ref string
- The name of branch, tag or commit.
- Size int
- The file size.
- BlobId string
- The blob id.
- CommitId string
- The commit id.
- ContentSha256 string
- File content sha256 digest.
- FileName string
- The filename.
- Id string
- The provider-assigned unique ID for this managed resource.
- LastCommit stringId 
- The last known commit id.
- Ref string
- The name of branch, tag or commit.
- Size int
- The file size.
- blobId String
- The blob id.
- commitId String
- The commit id.
- contentSha256 String
- File content sha256 digest.
- fileName String
- The filename.
- id String
- The provider-assigned unique ID for this managed resource.
- lastCommit StringId 
- The last known commit id.
- ref String
- The name of branch, tag or commit.
- size Integer
- The file size.
- blobId string
- The blob id.
- commitId string
- The commit id.
- contentSha256 string
- File content sha256 digest.
- fileName string
- The filename.
- id string
- The provider-assigned unique ID for this managed resource.
- lastCommit stringId 
- The last known commit id.
- ref string
- The name of branch, tag or commit.
- size number
- The file size.
- blob_id str
- The blob id.
- commit_id str
- The commit id.
- content_sha256 str
- File content sha256 digest.
- file_name str
- The filename.
- id str
- The provider-assigned unique ID for this managed resource.
- last_commit_ strid 
- The last known commit id.
- ref str
- The name of branch, tag or commit.
- size int
- The file size.
- blobId String
- The blob id.
- commitId String
- The commit id.
- contentSha256 String
- File content sha256 digest.
- fileName String
- The filename.
- id String
- The provider-assigned unique ID for this managed resource.
- lastCommit StringId 
- The last known commit id.
- ref String
- The name of branch, tag or commit.
- size Number
- The file size.
Look up Existing RepositoryFile Resource
Get an existing RepositoryFile 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?: RepositoryFileState, opts?: CustomResourceOptions): RepositoryFile@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        author_email: Optional[str] = None,
        author_name: Optional[str] = None,
        blob_id: Optional[str] = None,
        branch: Optional[str] = None,
        commit_id: Optional[str] = None,
        commit_message: Optional[str] = None,
        content: Optional[str] = None,
        content_sha256: Optional[str] = None,
        create_commit_message: Optional[str] = None,
        delete_commit_message: Optional[str] = None,
        encoding: Optional[str] = None,
        execute_filemode: Optional[bool] = None,
        file_name: Optional[str] = None,
        file_path: Optional[str] = None,
        last_commit_id: Optional[str] = None,
        overwrite_on_create: Optional[bool] = None,
        project: Optional[str] = None,
        ref: Optional[str] = None,
        size: Optional[int] = None,
        start_branch: Optional[str] = None,
        update_commit_message: Optional[str] = None) -> RepositoryFilefunc GetRepositoryFile(ctx *Context, name string, id IDInput, state *RepositoryFileState, opts ...ResourceOption) (*RepositoryFile, error)public static RepositoryFile Get(string name, Input<string> id, RepositoryFileState? state, CustomResourceOptions? opts = null)public static RepositoryFile get(String name, Output<String> id, RepositoryFileState state, CustomResourceOptions options)resources:  _:    type: gitlab:RepositoryFile    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.
- string
- Email of the commit author.
- string
- Name of the commit author.
- BlobId string
- The blob id.
- Branch string
- Name of the branch to which to commit to.
- CommitId string
- The commit id.
- CommitMessage string
- Commit message.
- Content string
- File content.
- ContentSha256 string
- File content sha256 digest.
- CreateCommit stringMessage 
- Create commit message.
- DeleteCommit stringMessage 
- Delete Commit message.
- Encoding string
- The file content encoding. Default value is base64. Valid values are:base64,text.
- ExecuteFilemode bool
- Enables or disables the execute flag on the file.
- FileName string
- The filename.
- FilePath string
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- LastCommit stringId 
- The last known commit id.
- OverwriteOn boolCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- Project string
- The name or ID of the project.
- Ref string
- The name of branch, tag or commit.
- Size int
- The file size.
- StartBranch string
- Name of the branch to start the new commit from.
- UpdateCommit stringMessage 
- Update commit message.
- string
- Email of the commit author.
- string
- Name of the commit author.
- BlobId string
- The blob id.
- Branch string
- Name of the branch to which to commit to.
- CommitId string
- The commit id.
- CommitMessage string
- Commit message.
- Content string
- File content.
- ContentSha256 string
- File content sha256 digest.
- CreateCommit stringMessage 
- Create commit message.
- DeleteCommit stringMessage 
- Delete Commit message.
- Encoding string
- The file content encoding. Default value is base64. Valid values are:base64,text.
- ExecuteFilemode bool
- Enables or disables the execute flag on the file.
- FileName string
- The filename.
- FilePath string
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- LastCommit stringId 
- The last known commit id.
- OverwriteOn boolCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- Project string
- The name or ID of the project.
- Ref string
- The name of branch, tag or commit.
- Size int
- The file size.
- StartBranch string
- Name of the branch to start the new commit from.
- UpdateCommit stringMessage 
- Update commit message.
- String
- Email of the commit author.
- String
- Name of the commit author.
- blobId String
- The blob id.
- branch String
- Name of the branch to which to commit to.
- commitId String
- The commit id.
- commitMessage String
- Commit message.
- content String
- File content.
- contentSha256 String
- File content sha256 digest.
- createCommit StringMessage 
- Create commit message.
- deleteCommit StringMessage 
- Delete Commit message.
- encoding String
- The file content encoding. Default value is base64. Valid values are:base64,text.
- executeFilemode Boolean
- Enables or disables the execute flag on the file.
- fileName String
- The filename.
- filePath String
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- lastCommit StringId 
- The last known commit id.
- overwriteOn BooleanCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- project String
- The name or ID of the project.
- ref String
- The name of branch, tag or commit.
- size Integer
- The file size.
- startBranch String
- Name of the branch to start the new commit from.
- updateCommit StringMessage 
- Update commit message.
- string
- Email of the commit author.
- string
- Name of the commit author.
- blobId string
- The blob id.
- branch string
- Name of the branch to which to commit to.
- commitId string
- The commit id.
- commitMessage string
- Commit message.
- content string
- File content.
- contentSha256 string
- File content sha256 digest.
- createCommit stringMessage 
- Create commit message.
- deleteCommit stringMessage 
- Delete Commit message.
- encoding string
- The file content encoding. Default value is base64. Valid values are:base64,text.
- executeFilemode boolean
- Enables or disables the execute flag on the file.
- fileName string
- The filename.
- filePath string
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- lastCommit stringId 
- The last known commit id.
- overwriteOn booleanCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- project string
- The name or ID of the project.
- ref string
- The name of branch, tag or commit.
- size number
- The file size.
- startBranch string
- Name of the branch to start the new commit from.
- updateCommit stringMessage 
- Update commit message.
- str
- Email of the commit author.
- str
- Name of the commit author.
- blob_id str
- The blob id.
- branch str
- Name of the branch to which to commit to.
- commit_id str
- The commit id.
- commit_message str
- Commit message.
- content str
- File content.
- content_sha256 str
- File content sha256 digest.
- create_commit_ strmessage 
- Create commit message.
- delete_commit_ strmessage 
- Delete Commit message.
- encoding str
- The file content encoding. Default value is base64. Valid values are:base64,text.
- execute_filemode bool
- Enables or disables the execute flag on the file.
- file_name str
- The filename.
- file_path str
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- last_commit_ strid 
- The last known commit id.
- overwrite_on_ boolcreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- project str
- The name or ID of the project.
- ref str
- The name of branch, tag or commit.
- size int
- The file size.
- start_branch str
- Name of the branch to start the new commit from.
- update_commit_ strmessage 
- Update commit message.
- String
- Email of the commit author.
- String
- Name of the commit author.
- blobId String
- The blob id.
- branch String
- Name of the branch to which to commit to.
- commitId String
- The commit id.
- commitMessage String
- Commit message.
- content String
- File content.
- contentSha256 String
- File content sha256 digest.
- createCommit StringMessage 
- Create commit message.
- deleteCommit StringMessage 
- Delete Commit message.
- encoding String
- The file content encoding. Default value is base64. Valid values are:base64,text.
- executeFilemode Boolean
- Enables or disables the execute flag on the file.
- fileName String
- The filename.
- filePath String
- The full path of the file. It must be relative to the root of the project without a leading slash /or./.
- lastCommit StringId 
- The last known commit id.
- overwriteOn BooleanCreate 
- Enable overwriting existing files, defaults to false. This attribute is only used duringcreateand must be use carefully. We suggest to useimportswhenever possible and limit the use of this attribute for when the project was imported on the sameapply. This attribute is not supported during a resource import.
- project String
- The name or ID of the project.
- ref String
- The name of branch, tag or commit.
- size Number
- The file size.
- startBranch String
- Name of the branch to start the new commit from.
- updateCommit StringMessage 
- Update commit message.
Import
Starting in Terraform v1.5.0 you can use an import block to import gitlab_repository_file. For example:
terraform
import {
to = gitlab_repository_file.example
id = “see CLI command below for ID”
}
Import using the CLI is supported using the following syntax:
A Repository File can be imported using an id made up of <project-id>:<branch-name>:<file-path>, e.g.
$ pulumi import gitlab:index/repositoryFile:RepositoryFile this 1:main:foo/bar.txt
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the gitlabTerraform Provider.