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 dictionaryThe 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
- Secure
File intId - 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
- Secure
File intId - 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
- secure
File IntegerId - 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
- secure
File numberId - 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_ intid - 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
- secure
File NumberId - The id of the secure file in gitlab
getProjectSecureFile Result
The following output properties are available:
- Checksum string
- The checksum of the file
- Checksum
Algorithm string - The checksum algorithm used
- Content string
- The contents of the secure file
- Created
At string - The time the secure file was uploaded
- Expires
At string - The time the secure file will expire
- Id string
- The ID of this data source. In the format
<project:id> - Metadata
Pulumi.
Git Lab. Outputs. Get Project Secure File Metadata - metadata returned by the gitlab api about the secure file
- Project string
- The ID or full path of the project the secure file resides.
- Secure
File intId - 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
- Checksum
Algorithm string - The checksum algorithm used
- Content string
- The contents of the secure file
- Created
At string - The time the secure file was uploaded
- Expires
At string - The time the secure file will expire
- Id string
- The ID of this data source. In the format
<project:id> - Metadata
Get
Project Secure File Metadata - metadata returned by the gitlab api about the secure file
- Project string
- The ID or full path of the project the secure file resides.
- Secure
File intId - 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
- checksum
Algorithm String - The checksum algorithm used
- content String
- The contents of the secure file
- created
At String - The time the secure file was uploaded
- expires
At String - The time the secure file will expire
- id String
- The ID of this data source. In the format
<project:id> - metadata
Get
Project Secure File Metadata - metadata returned by the gitlab api about the secure file
- project String
- The ID or full path of the project the secure file resides.
- secure
File IntegerId - 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
- checksum
Algorithm string - The checksum algorithm used
- content string
- The contents of the secure file
- created
At string - The time the secure file was uploaded
- expires
At string - The time the secure file will expire
- id string
- The ID of this data source. In the format
<project:id> - metadata
Get
Project Secure File Metadata - metadata returned by the gitlab api about the secure file
- project string
- The ID or full path of the project the secure file resides.
- secure
File numberId - 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
Get
Project Secure File Metadata - 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_ intid - 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
- checksum
Algorithm String - The checksum algorithm used
- content String
- The contents of the secure file
- created
At String - The time the secure file was uploaded
- expires
At 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.
- secure
File NumberId - The id of the secure file in gitlab
- name String
- The name for the secure file, unique per project
Supporting Types
GetProjectSecureFileMetadata
- Expires
At string - Certificate expiration date
- Id string
- Certificate ID
- Issuer
Pulumi.
Git Lab. Inputs. Get Project Secure File Metadata Issuer - Certificate issuer information
- Subject
Pulumi.
Git Lab. Inputs. Get Project Secure File Metadata Subject - Certificate subject information
- Expires
At string - Certificate expiration date
- Id string
- Certificate ID
- Issuer
Get
Project Secure File Metadata Issuer - Certificate issuer information
- Subject
Get
Project Secure File Metadata Subject - Certificate subject information
- expires
At String - Certificate expiration date
- id String
- Certificate ID
- issuer
Get
Project Secure File Metadata Issuer - Certificate issuer information
- subject
Get
Project Secure File Metadata Subject - Certificate subject information
- expires
At string - Certificate expiration date
- id string
- Certificate ID
- issuer
Get
Project Secure File Metadata Issuer - Certificate issuer information
- subject
Get
Project Secure File Metadata Subject - Certificate subject information
- expires_
at str - Certificate expiration date
- id str
- Certificate ID
- issuer
Get
Project Secure File Metadata Issuer - Certificate issuer information
- subject
Get
Project Secure File Metadata Subject - Certificate subject information
- expires
At String - Certificate expiration date
- id String
- Certificate ID
- issuer Property Map
- Certificate issuer information
- subject Property Map
- Certificate subject information
GetProjectSecureFileMetadataIssuer
GetProjectSecureFileMetadataSubject
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
