import { ICoreConfig } from '../../typings'; import { IAzureKeyVaultSecret } from '../modules/az'; export declare type UnknownRecord = Record; export declare type TNebulaDatabase = 'mssql' | 'postgres'; /** * Nebula staging area details. Where everything is built */ export interface INebulaPlatformConfigStaging { /** * Location of Nebula staging area where everything is built */ path: string; } /** * Nebula external micro-services to use */ export interface INebulaMicroserviceSpec { /** * Microservice name */ name: string; } /** * Orbit capsule */ export declare enum NebulaOrbitCapsules { auth = "auth", notify = "notify", storage = "storage", audit = "audit" } /** * Service type */ export declare type NebulaBuildServiceType = 'api' | 'ui' | 'job' | 'cronjob'; /** * Secrets engine */ export declare enum NebulaSecretsEngine { raw = "raw", sops = "sops" } /** * Secrets engine injection type */ export declare enum NebulaSecretsEngineInjectType { file = "file", env = "env" } /** * Nebula Orbit Capsule config */ export interface INebulaPlatformOrbitCapsuleConfig { name: NebulaOrbitCapsules; values?: object; } /** * Nebula Orbit config */ export interface INebulaPlatformOrbitConfig { /** * Orbit version to deploy */ version: string; /** * Orbit capsules to deploy */ capsules: INebulaPlatformOrbitCapsuleConfig[]; /** * Orbit capsule prefix in config */ prefix: string; } /** * Helm repository details */ export interface INebulaHelmRepo { /** * Helm repo alias to use when referenced in helm dependencies */ alias: string; /** * Location of helm repository */ path: string; } /** * Project helm chart repository details */ export interface INebulaHelmRepositoryConfig { /** * Rocketmakers helm chart repository */ rocketmakers: INebulaHelmRepo; /** * Stable helm chart repository */ stable: INebulaHelmRepo; } export interface IAzureChartStorage { kind: 'azure'; storageAccount: string; storageAccessKey?: IAzureKeyVaultSecret; storageContainerName?: string; storagePrefix?: string; } export declare type ChartStorage = IAzureChartStorage; /** * Project helm chart details */ export interface INebulaHelmConfig { /** * Helm chart version */ version: string; /** * Helm chart repositories to register */ repository: INebulaHelmRepositoryConfig; /** * Helm Chart Storage */ chartStorage: ChartStorage; } /** * Core nebula service config */ export interface INebulaServiceConfig { version: string; } /** * Nebula API service config */ export interface INebulaApiServiceConfig extends INebulaServiceConfig { /** * Port that API runs on */ port: number; } /** * Nebula ui service config */ export interface INebulaUiServiceConfig extends INebulaServiceConfig { /** * Port that ui files will be served on */ port: number; } /** * Nebula job service config */ export interface INebulaJobServiceConfig extends INebulaServiceConfig { } /** * Nebula cronjob service config */ export interface ICronJobServiceConfig extends INebulaServiceConfig { } /** * Nebula services config */ export interface INebulaPlatformServicesConfig { /** * Nebula API service config */ api: INebulaApiServiceConfig; /** * Nebula ui service config */ ui: INebulaUiServiceConfig; /** * Nebula job service config */ job: INebulaJobServiceConfig; /** * Nebula cronjob service config */ cronjob: ICronJobServiceConfig; } /** * */ export interface INebulaPlatformConfigDeployConfigValue { /** * Name of config value (same as the environment variable). */ name: string; /** * Value to assign to this config value. Can also use the following Nebula system envs: * - NEBULA_ENVIRONMENT: value of the config deploy environment setting */ value: string; /** * Scope this value to services within the deployment */ scope: string[]; } /** * Non-sensitive project config */ export interface INebulaPlatformConfigDeployConfig { /** * Non-sensitive project config values to be injected as environment values (mounting as files is planned). */ values: INebulaPlatformConfigDeployConfigValue[]; } /** * Nebula sops engine config */ export interface INebulaPlatformConfigDeploySecretsEngineSopsConfig { /** * Path to the sops file to decrypt and inject secrets from. This is relative to the nebula.json file. */ path: string; } /** * Secrets engine type config */ export declare type INebulaPlatformConfigDeploySecretsEngineConfig = INebulaPlatformConfigDeploySecretsEngineSopsConfig; /** * Nebula supported secrets engine config */ export interface INebulaPlatformConfigDeploySecretsEngine { /** * Secrets engine type */ type: NebulaSecretsEngine; /** * Secrets engine type config */ config: INebulaPlatformConfigDeploySecretsEngineConfig; } /** * Sensitive project config values to be injected as environment values or files/ */ export interface INebulaPlatformConfigDeploySecretsValue { /** * Name of secret when it is injected. * * [NOT_IMPLEMENTED_YET] When a secret is a file, we also generate a corresponding environment variable describing where the secret is. * * For example, the file path env var for `foo_bar_baz` would be FOO_BAR_BAZ_SECRET_FILE_PATH */ name: string; /** * Location of secret to be injected. Not needed if this matches the name of the secret. */ path?: string; /** * [NOT IMPLEMENTED YET] This will override the file path env var to a non-conventional value */ filePathEnvOverride?: string; /** * Inject the secret as either a file or an environment variable. */ injectAs: NebulaSecretsEngineInjectType; } /** * Sensitive project config */ export interface INebulaPlatformConfigDeploySecrets { /** * Nebula supported secrets engine config */ engine: INebulaPlatformConfigDeploySecretsEngine; /** * Sensitive project config values to be injected as environment values or files/ */ values: INebulaPlatformConfigDeploySecretsValue[]; } /** * Nebula deployment config */ export interface INebulaPlatformConfigDeploy { /** * Orbit deployment config */ orbit: INebulaPlatformOrbitConfig; /** * External nebula micro-services */ external: INebulaMicroserviceSpec[]; /** * Nebula database configuration */ database: TNebulaDatabase; /** * Nebula helm configuration */ helm: INebulaHelmConfig; /** * Nebula service config */ services: INebulaPlatformServicesConfig; /** * Non-sensitive project config */ config: INebulaPlatformConfigDeployConfig; /** * Sensitive project config */ secrets: INebulaPlatformConfigDeploySecrets; } /** * Nebula service build additional config */ export interface INebulaPlatformConfigBuildServiceConfig { /** * Override the default Dockerfile command. Otherwise use the Dockerfile default for that type. */ command: string[]; } /** * Nebula service build additional config */ export interface INebulaPlatformConfigBuildServiceApiConfig extends INebulaPlatformConfigBuildServiceConfig { /** * Endpoint to test the readiness/liveness of the containers */ health: string; } /** * Nebula service build */ export interface INebulaPlatformConfigBuildServiceCore { /** * Location of service Dockerfile */ context: string; /** * Specify whether the context is remote or not. If true, Nebula will look for a docker image of that name instead of building the service * @default false */ remote: boolean; /** * Override the inferred service name with this value */ alias?: string; /** * Specify the relative paths (globs) of files to sync to the container */ sync?: string[]; /** * Specify the container command to use for sync */ syncCommand?: string[]; } /** * Nebula service build */ export interface INebulaPlatformConfigBuildServiceBase extends INebulaPlatformConfigBuildServiceCore { /** * Nebula service build additional config */ config: TConfig; } export interface INebulaPlatformConfigBuildApiService extends INebulaPlatformConfigBuildServiceBase { /** * Nebula service type. Used to infer deployment config */ type: 'api'; } export interface INebulaPlatformConfigBuildUiService extends INebulaPlatformConfigBuildServiceBase { /** * Nebula service type. Used to infer deployment config */ type: 'ui'; } export interface INebulaPlatformConfigBuildCronJobService extends INebulaPlatformConfigBuildServiceBase { /** * Nebula service type. Used to infer deployment config */ type: 'cronjob'; /** * The cron schedule, e.g. "1 * * * *" */ schedule: string; } export interface INebulaPlatformConfigBuildJobService extends INebulaPlatformConfigBuildServiceBase { /** * Nebula service type. Used to infer deployment config */ type: 'job'; } export declare type INebulaPlatformConfigBuildService = INebulaPlatformConfigBuildApiService | INebulaPlatformConfigBuildUiService | INebulaPlatformConfigBuildJobService | INebulaPlatformConfigBuildCronJobService; export interface INebulaPlatformConfigBuild { /** * Docker services to build */ services: INebulaPlatformConfigBuildService[]; /** * Docker registry to publish images to */ registry: string; /** * Authentication mode for the Docker registry */ registryAuth?: 'azure'; } /** * Project details */ export interface INebulaPlatformConfigProject { /** * Project name */ name: string; } /** * Nebula config */ export interface INebulaPlatformConfig extends ICoreConfig { /** * Project details */ project: INebulaPlatformConfigProject; /** * Nebula staging area details */ staging: INebulaPlatformConfigStaging; /** * Nebula build details */ build: INebulaPlatformConfigBuild; /** * Nebula deploy details */ deploy: INebulaPlatformConfigDeploy; }