37 lines
1.3 KiB
TypeScript
37 lines
1.3 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
|
|
}
|
|
|
|
/** 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_]*$/
|