1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getProjectSecureFile
GitLab v9.7.0 published on Monday, Dec 22, 2025 by Pulumi
gitlab logo
GitLab v9.7.0 published on Monday, Dec 22, 2025 by Pulumi

    The gitlab.getProjectSecureFile data source allows the contents of a secure file to be retrieved by either Name or ID.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const byId = gitlab.getProjectSecureFile({
        project: "123",
        secureFileId: 123,
    });
    const byName = gitlab.getProjectSecureFile({
        project: "123",
        name: "secret.pem",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    by_id = gitlab.get_project_secure_file(project="123",
        secure_file_id=123)
    by_name = gitlab.get_project_secure_file(project="123",
        name="secret.pem")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gitlab.GetProjectSecureFile(ctx, &gitlab.GetProjectSecureFileArgs{
    			Project:      "123",
    			SecureFileId: pulumi.IntRef(123),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.GetProjectSecureFile(ctx, &gitlab.GetProjectSecureFileArgs{
    			Project: "123",
    			Name:    pulumi.StringRef("secret.pem"),
    		}, nil)
    		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 byId = GitLab.GetProjectSecureFile.Invoke(new()
        {
            Project = "123",
            SecureFileId = 123,
        });
    
        var byName = GitLab.GetProjectSecureFile.Invoke(new()
        {
            Project = "123",
            Name = "secret.pem",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.GitlabFunctions;
    import com.pulumi.gitlab.inputs.GetProjectSecureFileArgs;
    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) {
            final var byId = GitlabFunctions.getProjectSecureFile(GetProjectSecureFileArgs.builder()
                .project("123")
                .secureFileId(123)
                .build());
    
            final var byName = GitlabFunctions.getProjectSecureFile(GetProjectSecureFileArgs.builder()
                .project("123")
                .name("secret.pem")
                .build());
    
        }
    }
    
    variables:
      byId:
        fn::invoke:
          function: gitlab:getProjectSecureFile
          arguments:
            project: '123'
            secureFileId: 123
      byName:
        fn::invoke:
          function: gitlab:getProjectSecureFile
          arguments:
            project: '123'
            name: secret.pem
    

    Using getProjectSecureFile

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProjectSecureFile(args: GetProjectSecureFileArgs, opts?: InvokeOptions): Promise<GetProjectSecureFileResult>
    function getProjectSecureFileOutput(args: GetProjectSecureFileOutputArgs, opts?: InvokeOptions): Output<GetProjectSecureFileResult>
    def get_project_secure_file(name: Optional[str] = None,
                                project: Optional[str] = None,
                                secure_file_id: Optional[int] = None,
                                opts: Optional[InvokeOptions] = None) -> GetProjectSecureFileResult
    def get_project_secure_file_output(name: Optional[pulumi.Input[str]] = None,
                                project: Optional[pulumi.Input[str]] = None,
                                secure_file_id: Optional[pulumi.Input[int]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetProjectSecureFileResult]
    func GetProjectSecureFile(ctx *Context, args *GetProjectSecureFileArgs, opts ...InvokeOption) (*GetProjectSecureFileResult, error)
    func GetProjectSecureFileOutput(ctx *Context, args *GetProjectSecureFileOutputArgs, opts ...InvokeOption) GetProjectSecureFileResultOutput

    > Note: This function is named GetProjectSecureFile in the Go SDK.

    public static class GetProjectSecureFile 
    {
        public static Task<GetProjectSecureFileResult> InvokeAsync(GetProjectSecureFileArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectSecureFileResult> Invoke(GetProjectSecureFileInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectSecureFileResult> getProjectSecureFile(GetProjectSecureFileArgs args, InvokeOptions options)
    public static Output<GetProjectSecureFileResult> getProjectSecureFile(GetProjectSecureFileArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gitlab:index/getProjectSecureFile:getProjectSecureFile
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Project string
    The ID or full path of the project the secure file resides.
    Name string
    The name for the secure file, unique per project
    SecureFileId int
    The id of the secure file in gitlab
    Project string
    The ID or full path of the project the secure file resides.
    Name string
    The name for the secure file, unique per project
    SecureFileId int
    The id of the secure file in gitlab
    project String
    The ID or full path of the project the secure file resides.
    name String
    The name for the secure file, unique per project
    secureFileId Integer
    The id of the secure file in gitlab
    project string
    The ID or full path of the project the secure file resides.
    name string
    The name for the secure file, unique per project
    secureFileId number
    The id of the secure file in gitlab
    project str
    The ID or full path of the project the secure file resides.
    name str
    The name for the secure file, unique per project
    secure_file_id int
    The id of the secure file in gitlab
    project String
    The ID or full path of the project the secure file resides.
    name String
    The name for the secure file, unique per project
    secureFileId Number
    The id of the secure file in gitlab

    getProjectSecureFile Result

    The following output properties are available:

    Checksum string
    The checksum of the file
    ChecksumAlgorithm string
    The checksum algorithm used
    Content string
    The contents of the secure file
    CreatedAt string
    The time the secure file was uploaded
    ExpiresAt string
    The time the secure file will expire
    Id string
    The ID of this data source. In the format <project:id>
    Metadata Pulumi.GitLab.Outputs.GetProjectSecureFileMetadata
    metadata returned by the gitlab api about the secure file
    Project string
    The ID or full path of the project the secure file resides.
    SecureFileId int
    The id of the secure file in gitlab
    Name string
    The name for the secure file, unique per project
    Checksum string
    The checksum of the file
    ChecksumAlgorithm string
    The checksum algorithm used
    Content string
    The contents of the secure file
    CreatedAt string
    The time the secure file was uploaded
    ExpiresAt string
    The time the secure file will expire
    Id string
    The ID of this data source. In the format <project:id>
    Metadata GetProjectSecureFileMetadata
    metadata returned by the gitlab api about the secure file
    Project string
    The ID or full path of the project the secure file resides.
    SecureFileId int
    The id of the secure file in gitlab
    Name string
    The name for the secure file, unique per project
    checksum String
    The checksum of the file
    checksumAlgorithm String
    The checksum algorithm used
    content String
    The contents of the secure file
    createdAt String
    The time the secure file was uploaded
    expiresAt String
    The time the secure file will expire
    id String
    The ID of this data source. In the format <project:id>
    metadata GetProjectSecureFileMetadata
    metadata returned by the gitlab api about the secure file
    project String
    The ID or full path of the project the secure file resides.
    secureFileId Integer
    The id of the secure file in gitlab
    name String
    The name for the secure file, unique per project
    checksum string
    The checksum of the file
    checksumAlgorithm string
    The checksum algorithm used
    content string
    The contents of the secure file
    createdAt string
    The time the secure file was uploaded
    expiresAt string
    The time the secure file will expire
    id string
    The ID of this data source. In the format <project:id>
    metadata GetProjectSecureFileMetadata
    metadata returned by the gitlab api about the secure file
    project string
    The ID or full path of the project the secure file resides.
    secureFileId number
    The id of the secure file in gitlab
    name string
    The name for the secure file, unique per project
    checksum str
    The checksum of the file
    checksum_algorithm str
    The checksum algorithm used
    content str
    The contents of the secure file
    created_at str
    The time the secure file was uploaded
    expires_at str
    The time the secure file will expire
    id str
    The ID of this data source. In the format <project:id>
    metadata GetProjectSecureFileMetadata
    metadata returned by the gitlab api about the secure file
    project str
    The ID or full path of the project the secure file resides.
    secure_file_id int
    The id of the secure file in gitlab
    name str
    The name for the secure file, unique per project
    checksum String
    The checksum of the file
    checksumAlgorithm String
    The checksum algorithm used
    content String
    The contents of the secure file
    createdAt String
    The time the secure file was uploaded
    expiresAt String
    The time the secure file will expire
    id String
    The ID of this data source. In the format <project:id>
    metadata Property Map
    metadata returned by the gitlab api about the secure file
    project String
    The ID or full path of the project the secure file resides.
    secureFileId Number
    The id of the secure file in gitlab
    name String
    The name for the secure file, unique per project

    Supporting Types

    GetProjectSecureFileMetadata

    ExpiresAt string
    Certificate expiration date
    Id string
    Certificate ID
    Issuer Pulumi.GitLab.Inputs.GetProjectSecureFileMetadataIssuer
    Certificate issuer information
    Subject Pulumi.GitLab.Inputs.GetProjectSecureFileMetadataSubject
    Certificate subject information
    ExpiresAt string
    Certificate expiration date
    Id string
    Certificate ID
    Issuer GetProjectSecureFileMetadataIssuer
    Certificate issuer information
    Subject GetProjectSecureFileMetadataSubject
    Certificate subject information
    expiresAt String
    Certificate expiration date
    id String
    Certificate ID
    issuer GetProjectSecureFileMetadataIssuer
    Certificate issuer information
    subject GetProjectSecureFileMetadataSubject
    Certificate subject information
    expiresAt string
    Certificate expiration date
    id string
    Certificate ID
    issuer GetProjectSecureFileMetadataIssuer
    Certificate issuer information
    subject GetProjectSecureFileMetadataSubject
    Certificate subject information
    expires_at str
    Certificate expiration date
    id str
    Certificate ID
    issuer GetProjectSecureFileMetadataIssuer
    Certificate issuer information
    subject GetProjectSecureFileMetadataSubject
    Certificate subject information
    expiresAt String
    Certificate expiration date
    id String
    Certificate ID
    issuer Property Map
    Certificate issuer information
    subject Property Map
    Certificate subject information

    GetProjectSecureFileMetadataIssuer

    C string
    Country
    Cn string
    Common Name
    O string
    Organization
    Ou string
    Organizational Unit
    C string
    Country
    Cn string
    Common Name
    O string
    Organization
    Ou string
    Organizational Unit
    c String
    Country
    cn String
    Common Name
    o String
    Organization
    ou String
    Organizational Unit
    c string
    Country
    cn string
    Common Name
    o string
    Organization
    ou string
    Organizational Unit
    c str
    Country
    cn str
    Common Name
    o str
    Organization
    ou str
    Organizational Unit
    c String
    Country
    cn String
    Common Name
    o String
    Organization
    ou String
    Organizational Unit

    GetProjectSecureFileMetadataSubject

    C string
    Country
    Cn string
    Common Name
    O string
    Organization
    Ou string
    Organizational Unit
    Uid string
    User ID
    C string
    Country
    Cn string
    Common Name
    O string
    Organization
    Ou string
    Organizational Unit
    Uid string
    User ID
    c String
    Country
    cn String
    Common Name
    o String
    Organization
    ou String
    Organizational Unit
    uid String
    User ID
    c string
    Country
    cn string
    Common Name
    o string
    Organization
    ou string
    Organizational Unit
    uid string
    User ID
    c str
    Country
    cn str
    Common Name
    o str
    Organization
    ou str
    Organizational Unit
    uid str
    User ID
    c String
    Country
    cn String
    Common Name
    o String
    Organization
    ou String
    Organizational Unit
    uid String
    User ID

    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 v9.7.0 published on Monday, Dec 22, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate