@spacelift-io/pulumi-spacelift
Version:
A Pulumi package for creating and managing Spacelift resources.
161 lines (160 loc) • 5.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* `spacelift.Mountedfile` represents a file mounted in each Run's workspace that is part of a configuration of a context (`spacelift.Context`), stack (`spacelift.Stack`) or a module (`spacelift.Module`). In principle, it's very similar to an environment variable (`spacelift.EnvironmentVariable`) except that the value is written to the filesystem rather than passed to the environment.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fs from "fs";
* import * as spacelift from "@spacelift-io/pulumi-spacelift";
*
* // For a context
* const ireland_kubeconfig = new spacelift.Mountedfile("ireland-kubeconfig", {
* contextId: "prod-k8s-ie",
* relativePath: "kubeconfig",
* content: Buffer.from(fs.readFileSync(`${path.module}/kubeconfig.json`), 'binary').toString('base64'),
* });
* // For a module
* const module_kubeconfig = new spacelift.Mountedfile("module-kubeconfig", {
* moduleId: "k8s-module",
* relativePath: "kubeconfig",
* content: Buffer.from(fs.readFileSync(`${path.module}/kubeconfig.json`), 'binary').toString('base64'),
* });
* // For a stack
* const core_kubeconfig = new spacelift.Mountedfile("core-kubeconfig", {
* stackId: "k8s-core",
* relativePath: "kubeconfig",
* content: Buffer.from(fs.readFileSync(`${path.module}/kubeconfig.json`), 'binary').toString('base64'),
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import spacelift:index/mountedfile:Mountedfile ireland-kubeconfig context/$CONTEXT_ID/$MOUNTED_FILE_ID
* ```
*
* ```sh
* $ pulumi import spacelift:index/mountedfile:Mountedfile module-kubeconfig module/$MODULE_ID/$MOUNTED_FILE_ID
* ```
*
* ```sh
* $ pulumi import spacelift:index/mountedfile:Mountedfile core-kubeconfig stack/$STACK_ID/$MOUNTED_FILE_ID
* ```
*/
export declare class Mountedfile extends pulumi.CustomResource {
/**
* Get an existing Mountedfile resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MountedfileState, opts?: pulumi.CustomResourceOptions): Mountedfile;
/**
* Returns true if the given object is an instance of Mountedfile. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Mountedfile;
/**
* SHA-256 checksum of the value
*/
readonly checksum: pulumi.Output<string>;
/**
* Content of the mounted file encoded using Base-64
*/
readonly content: pulumi.Output<string>;
/**
* ID of the context on which the mounted file is defined
*/
readonly contextId: pulumi.Output<string | undefined>;
/**
* ID of the module on which the mounted file is defined
*/
readonly moduleId: pulumi.Output<string | undefined>;
/**
* Relative path to the mounted file, without the /mnt/workspace/ prefix
*/
readonly relativePath: pulumi.Output<string>;
/**
* ID of the stack on which the mounted file is defined
*/
readonly stackId: pulumi.Output<string | undefined>;
/**
* Indicates whether the content can be read back outside a Run. Defaults to `true`.
*/
readonly writeOnly: pulumi.Output<boolean | undefined>;
/**
* Create a Mountedfile resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: MountedfileArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Mountedfile resources.
*/
export interface MountedfileState {
/**
* SHA-256 checksum of the value
*/
checksum?: pulumi.Input<string>;
/**
* Content of the mounted file encoded using Base-64
*/
content?: pulumi.Input<string>;
/**
* ID of the context on which the mounted file is defined
*/
contextId?: pulumi.Input<string>;
/**
* ID of the module on which the mounted file is defined
*/
moduleId?: pulumi.Input<string>;
/**
* Relative path to the mounted file, without the /mnt/workspace/ prefix
*/
relativePath?: pulumi.Input<string>;
/**
* ID of the stack on which the mounted file is defined
*/
stackId?: pulumi.Input<string>;
/**
* Indicates whether the content can be read back outside a Run. Defaults to `true`.
*/
writeOnly?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a Mountedfile resource.
*/
export interface MountedfileArgs {
/**
* Content of the mounted file encoded using Base-64
*/
content: pulumi.Input<string>;
/**
* ID of the context on which the mounted file is defined
*/
contextId?: pulumi.Input<string>;
/**
* ID of the module on which the mounted file is defined
*/
moduleId?: pulumi.Input<string>;
/**
* Relative path to the mounted file, without the /mnt/workspace/ prefix
*/
relativePath: pulumi.Input<string>;
/**
* ID of the stack on which the mounted file is defined
*/
stackId?: pulumi.Input<string>;
/**
* Indicates whether the content can be read back outside a Run. Defaults to `true`.
*/
writeOnly?: pulumi.Input<boolean>;
}