1. Packages
  2. GitLab
  3. API Docs
  4. RepositoryFile
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

gitlab.RepositoryFile

Explore with Pulumi AI

gitlab logo
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

    Example Usage

    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.

    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

    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.
    AuthorEmail string
    Email of the commit author.
    AuthorName string
    Name of the commit author.
    CommitMessage string
    Commit message.
    CreateCommitMessage string
    Create commit message.
    DeleteCommitMessage string
    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. Note: requires GitLab 14.10 or newer.
    OverwriteOnCreate bool
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.
    StartBranch string
    Name of the branch to start the new commit from.
    UpdateCommitMessage string
    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.
    AuthorEmail string
    Email of the commit author.
    AuthorName string
    Name of the commit author.
    CommitMessage string
    Commit message.
    CreateCommitMessage string
    Create commit message.
    DeleteCommitMessage string
    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. Note: requires GitLab 14.10 or newer.
    OverwriteOnCreate bool
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.
    StartBranch string
    Name of the branch to start the new commit from.
    UpdateCommitMessage string
    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.
    authorEmail String
    Email of the commit author.
    authorName String
    Name of the commit author.
    commitMessage String
    Commit message.
    createCommitMessage String
    Create commit message.
    deleteCommitMessage String
    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. Note: requires GitLab 14.10 or newer.
    overwriteOnCreate Boolean
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.
    startBranch String
    Name of the branch to start the new commit from.
    updateCommitMessage String
    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.
    authorEmail string
    Email of the commit author.
    authorName string
    Name of the commit author.
    commitMessage string
    Commit message.
    createCommitMessage string
    Create commit message.
    deleteCommitMessage string
    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. Note: requires GitLab 14.10 or newer.
    overwriteOnCreate boolean
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.
    startBranch string
    Name of the branch to start the new commit from.
    updateCommitMessage string
    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.
    author_email str
    Email of the commit author.
    author_name str
    Name of the commit author.
    commit_message str
    Commit message.
    create_commit_message str
    Create commit message.
    delete_commit_message str
    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. Note: requires GitLab 14.10 or newer.
    overwrite_on_create bool
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.
    start_branch str
    Name of the branch to start the new commit from.
    update_commit_message str
    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.
    authorEmail String
    Email of the commit author.
    authorName String
    Name of the commit author.
    commitMessage String
    Commit message.
    createCommitMessage String
    Create commit message.
    deleteCommitMessage String
    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. Note: requires GitLab 14.10 or newer.
    overwriteOnCreate Boolean
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.
    startBranch String
    Name of the branch to start the new commit from.
    updateCommitMessage String
    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.
    LastCommitId string
    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.
    LastCommitId string
    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.
    lastCommitId String
    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.
    lastCommitId string
    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_id str
    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.
    lastCommitId String
    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) -> RepositoryFile
    func 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)
    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.
    The following state arguments are supported:
    AuthorEmail string
    Email of the commit author.
    AuthorName 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.
    CreateCommitMessage string
    Create commit message.
    DeleteCommitMessage string
    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. Note: requires GitLab 14.10 or newer.
    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 ./.
    LastCommitId string
    The last known commit id.
    OverwriteOnCreate bool
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. 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.
    UpdateCommitMessage string
    Update commit message.
    AuthorEmail string
    Email of the commit author.
    AuthorName 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.
    CreateCommitMessage string
    Create commit message.
    DeleteCommitMessage string
    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. Note: requires GitLab 14.10 or newer.
    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 ./.
    LastCommitId string
    The last known commit id.
    OverwriteOnCreate bool
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. 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.
    UpdateCommitMessage string
    Update commit message.
    authorEmail String
    Email of the commit author.
    authorName 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.
    createCommitMessage String
    Create commit message.
    deleteCommitMessage String
    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. Note: requires GitLab 14.10 or newer.
    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 ./.
    lastCommitId String
    The last known commit id.
    overwriteOnCreate Boolean
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. 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.
    updateCommitMessage String
    Update commit message.
    authorEmail string
    Email of the commit author.
    authorName 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.
    createCommitMessage string
    Create commit message.
    deleteCommitMessage string
    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. Note: requires GitLab 14.10 or newer.
    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 ./.
    lastCommitId string
    The last known commit id.
    overwriteOnCreate boolean
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. 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.
    updateCommitMessage string
    Update commit message.
    author_email str
    Email of the commit author.
    author_name 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_message str
    Create commit message.
    delete_commit_message str
    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. Note: requires GitLab 14.10 or newer.
    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_id str
    The last known commit id.
    overwrite_on_create bool
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. 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_message str
    Update commit message.
    authorEmail String
    Email of the commit author.
    authorName 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.
    createCommitMessage String
    Create commit message.
    deleteCommitMessage String
    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. Note: requires GitLab 14.10 or newer.
    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 ./.
    lastCommitId String
    The last known commit id.
    overwriteOnCreate Boolean
    Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. 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.
    updateCommitMessage String
    Update commit message.

    Import

    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 gitlab Terraform Provider.
    gitlab logo
    GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi