New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change behaviour on initial stack create failed #5631

Merged
merged 7 commits into from Dec 31, 2018
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+7 −1
Diff settings

Always

Just for now

@@ -18,7 +18,7 @@ module.exports = {


const params = { const params = {
StackName: stackName, StackName: stackName,
OnFailure: 'ROLLBACK', OnFailure: 'DELETE',
Capabilities: [ Capabilities: [
'CAPABILITY_IAM', 'CAPABILITY_IAM',
'CAPABILITY_NAMED_IAM', 'CAPABILITY_NAMED_IAM',
@@ -16,6 +16,11 @@ module.exports = {
'DELETE_COMPLETE', 'DELETE_COMPLETE',
]; ];
const loggedEvents = []; const loggedEvents = [];
const region = this.provider.getRegion();
const baseCfUrl = `https://${region}.console.aws.amazon.com/cloudformation/home`;
const encodedStackId = `${encodeURIComponent(cfData.StackId)}`;
const cfQueryString = `region=${region}#/stack/detail?stackId=${encodedStackId}`;
const stackUrl = `${baseCfUrl}?${cfQueryString}`;


let monitoredSince = null; let monitoredSince = null;
let stackStatus = null; let stackStatus = null;
@@ -106,6 +111,7 @@ module.exports = {
// empty console.log for a prettier output // empty console.log for a prettier output
if (!this.options.verbose) this.serverless.cli.consoleLog(''); if (!this.options.verbose) this.serverless.cli.consoleLog('');
this.serverless.cli.log('Operation failed!'); this.serverless.cli.log('Operation failed!');
this.serverless.cli.log(`View the full error output: ${stackUrl}`);
let errorMessage = 'An error occurred: '; let errorMessage = 'An error occurred: ';
errorMessage += `${stackLatestError.LogicalResourceId} - `; errorMessage += `${stackLatestError.LogicalResourceId} - `;
errorMessage += `${stackLatestError.ResourceStatusReason}.`; errorMessage += `${stackLatestError.ResourceStatusReason}.`;
ProTip! Use n and p to navigate between commits in a pull request.