51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
/** A registered Terraform module: a folder of Terraform code, relative to the modules folder of Cloud Platform. */
|
|
export type TfModule = {
|
|
name: string
|
|
root: string
|
|
description: string
|
|
/** The address of the module's configurator, the application that edits the variables of its instances. */
|
|
configuratorUrl: string | null
|
|
}
|
|
|
|
/** A deployment of a module, whose state is kept in the schema stateSchema of the pg backend. */
|
|
export type TfInstance = {
|
|
module: string
|
|
name: string
|
|
stateSchema: string
|
|
/** ISO 8601. */
|
|
created: string
|
|
}
|
|
|
|
/** A variable file of an instance, without its content. */
|
|
export type TfvarsFileStatus = {
|
|
name: string
|
|
bytes: number
|
|
/** ISO 8601, the time of the last write. */
|
|
modified: string
|
|
/** Whether the content the last write replaced is kept. */
|
|
previous: boolean
|
|
}
|
|
|
|
/** A write of an instance's variable files, without their content. */
|
|
export type TfvarsRevision = {
|
|
/** The number of the write, from 1 for each instance. */
|
|
revision: number
|
|
/** The schema version of the files' layout, as their producer gave it; null when not known. */
|
|
schema: number | null
|
|
/** The application that wrote the files, with its version. */
|
|
producer: string
|
|
/** ISO 8601. */
|
|
saved: string
|
|
/** The names of the files of the revision. */
|
|
names: string[]
|
|
}
|
|
|
|
/** The names of modules and instances: a lower-case letter, then lower-case letters, digits and hyphens. */
|
|
export const TF_NAME_PATTERN = /^[a-z][a-z0-9-]*$/
|
|
|
|
/** The names of variable files: letters, digits, '_', '.' and '-', ending in .tfvars.json. */
|
|
export const TFVARS_FILE_PATTERN = /^[A-Za-z0-9_.-]+\.tfvars\.json$/
|
|
|
|
/** The names of pg schemas of a state: a lower-case letter or '_', then lower-case letters, digits and '_'. */
|
|
export const STATE_SCHEMA_PATTERN = /^[a-z_][a-z0-9_]*$/
|