/** * AWS Pipeline Plugin * * Cloud infrastructure pipeline for deploying to AWS. * Uses a config-based architecture where different configs bundle AWS services: * - ec2: Basic EC2 instance * - free-tier: Complete free tier bundle (EC2 + RDS + S3 + ECR) * - standard: Production-ready setup * - enterprise: HA, multi-AZ, auto-scaling * * This is a PIPELINE plugin, not a server plugin. It handles: * - AWS-specific deployment orchestration * - ECR image management * - AWS service provisioning * * Server OS plugins (ubuntu, amazon-linux) handle the actual OS-level commands. * * ============================================================ * PLUGIN STRUCTURE STANDARD * ============================================================ * * **scanfix/** - Scan/fix operations organized by concern * - Each file exports an array of Fix[] objects * - Files group related fixes together (aws-cli, config) * - All fixes are combined in the main plugin class * * **Environment-specific files** - Operations for each environment * - dev.ts - Dev environment operations (deployDev) * - prod.ts - Production operations (deployProd, ensureServerReady) * * **configs/** - AWS configuration types * - types.ts - Standardized AWSConfigDef interface * - ec2.ts - EC2 config implementation * - free-tier.ts - Free tier config implementation * - index.ts - Exports all configs * * **index.ts** - Main plugin class * - Static metadata (id, name, category, version) * - compatibleServers - Which OS types this pipeline supports * - canReach() - Pipeline routing logic * - Imports and combines all scanfix arrays * ============================================================ */ import type { FactiiiConfig, EnvironmentConfig, DeployResult, EnsureServerReadyOptions, Fix, Stage, Reachability, ServerOS } from '../../../types/index.js'; import type { AWSConfigDef } from './configs/types.js'; declare class AWSPipeline { static readonly id = "aws"; static readonly name = "AWS Pipeline"; static readonly category: 'pipeline'; static readonly version = "1.0.0"; /** * Server OS types this pipeline is compatible with * AWS typically runs Ubuntu or Amazon Linux on EC2 */ static readonly compatibleServers: ServerOS[]; /** * Default server OS for this pipeline */ static readonly defaultServer: ServerOS; static readonly requiredEnvVars: string[]; static readonly configSchema: Record; static readonly autoConfigSchema: Record; /** * Determine if this plugin should be loaded for this project * Loads if any environment has pipeline: 'aws' or aws config */ static shouldLoad(_rootDir: string, config: FactiiiConfig): Promise; static configs: Record; static helpText: Record; /** * Check how this pipeline can reach a given stage * This is the core routing logic for the pipeline * * Only claims environments where pipeline: 'aws' or aws config exists. * For staging/prod: checks SSH key first, falls back to workflow. */ static canReach(stage: Stage, config: FactiiiConfig): Reachability; /** * Whether this pipeline requires full repo on server * - staging: true (builds from source) * - prod: false (pulls pre-built images from ECR) */ static requiresFullRepo(environment: string): boolean; static readonly fixes: Fix[]; /** * Auto-detect AWS configuration */ static detectConfig(_rootDir: string): Promise<{ aws_cli_installed: boolean; }>; /** * Execute a command on a remote server via SSH */ static sshExec(envConfig: EnvironmentConfig, command: string): Promise; private _config; private _awsConfig; constructor(config: FactiiiConfig); /** * Scan a stage - handles routing based on canReach() * * Returns { handled: true } if pipeline ran scan remotely. * Returns { handled: false } if caller should run scan locally. */ scanStage(stage: Stage, _options?: Record): Promise<{ handled: boolean; }>; /** * Fix a stage — dev-direct, always runs locally. */ fixStage(stage: Stage, _options?: Record): Promise<{ handled: boolean; }>; /** * Deploy to a stage — dev-direct. dev/prod wired to deploy(); staging * goes through the factiii pipeline's runLocalDeploy (server plugin). */ deployStage(stage: Stage, _options?: { branch?: string; commit?: string; }): Promise; /** * Ensure server is ready for deployment. * * Prod servers run pre-built ECR images, so this only writes per-stage * state (env file + AWS credentials). No node, git, or source on prod. */ ensureServerReady(config: FactiiiConfig, environment: string, options?: EnsureServerReadyOptions): Promise; /** * Deploy to an environment */ deploy(config: FactiiiConfig, environment: string): Promise; /** * Undeploy from an environment */ undeploy(config: FactiiiConfig, environment: string): Promise; } export default AWSPipeline; //# sourceMappingURL=index.d.ts.map