amplify-education / serverless-vpc-discovery

Serverless plugin for discovering VPC / Subnet / Security Group configuration by name.
MIT License
38 stars 15 forks source link

Hard error instead of only a log when there is a error! #60

Open vinnie1234 opened 2 years ago

vinnie1234 commented 2 years ago

When there is an error the log is only a text log and not a hard error. Is it possible to make it a hard error so serverless stop the process?

Globals.ts public static logError (message: any, debug = false): void { const canLog = (debug && process.env.SLS_DEBUG) || !debug; if (canLog) { Globals.cliLog("Error:", message); } }

Types.ts cli: { log (str: string, entity?: string), consoleLog (str: any), };

ghost commented 1 year ago

Yeah this bit me today. Was launching a new environment and due to reasons the vpc discovery plugin could not find the vpc. The tags didn't match (i.e., stage vs staging). All of the serverless resources that had vpc context (such as lambdas) were launched without vpc context instead of just dying. Was mildly surprising and had to do a full sls remove to fix.