From 3972e9f9a8e114ceac59e375be0532f6ebcc4c33 Mon Sep 17 00:00:00 2001 From: "0.618" Date: Fri, 10 May 2024 10:48:04 -0700 Subject: [PATCH 1/4] chore: log error for stackUpdateComplete --- .../iterative-deployment/deployment-manager.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts b/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts index 4477fd62458..55ad19c915f 100644 --- a/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts +++ b/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts @@ -490,9 +490,18 @@ export class DeploymentManager { assert(stackParams.stackName, 'stackName should be passed to waitForDeployment'); await cfnClient - .waitFor('stackUpdateComplete', { - StackName: stackParams.stackName, - }) + .waitFor( + 'stackUpdateComplete', + { + StackName: stackParams.stackName, + }, + (err, data) => { + if (err) { + throw err; + } + return data; + }, + ) .promise(); }; From 31304a842dcb6b636279362feb6d99072ebfbde7 Mon Sep 17 00:00:00 2001 From: "0.618" Date: Sat, 11 May 2024 13:43:18 -0700 Subject: [PATCH 2/4] Revert "chore: log error for stackUpdateComplete" This reverts commit 3972e9f9a8e114ceac59e375be0532f6ebcc4c33. --- .../iterative-deployment/deployment-manager.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts b/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts index 55ad19c915f..4477fd62458 100644 --- a/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts +++ b/packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts @@ -490,18 +490,9 @@ export class DeploymentManager { assert(stackParams.stackName, 'stackName should be passed to waitForDeployment'); await cfnClient - .waitFor( - 'stackUpdateComplete', - { - StackName: stackParams.stackName, - }, - (err, data) => { - if (err) { - throw err; - } - return data; - }, - ) + .waitFor('stackUpdateComplete', { + StackName: stackParams.stackName, + }) .promise(); }; From 7e185338900ebdf70576dc364fa71d0b560abcf4 Mon Sep 17 00:00:00 2001 From: "0.618" Date: Sat, 11 May 2024 13:46:14 -0700 Subject: [PATCH 3/4] chore: log stackUpdateComplete message with errorDetails --- .../amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js index 5577b829b26..7a2093d72c3 100644 --- a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js +++ b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js @@ -418,7 +418,7 @@ class CloudFormation { if (completeErr) { await this.collectStackErrors(cfnParentStackParams.StackName).then((errorDetails) => { - completeErr.details = errorDetails; + completeErr.message = JSON.stringify(completeErr) + errorDetails; reject(completeErr); }); } else { From e725d194db1515a2541e255eff90d828fb25c82a Mon Sep 17 00:00:00 2001 From: "0.618" Date: Sat, 11 May 2024 14:06:26 -0700 Subject: [PATCH 4/4] chore: tweak stackUpdateComplete message with errorDetails --- .../amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js index 7a2093d72c3..2b0b99320f8 100644 --- a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js +++ b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js @@ -418,7 +418,7 @@ class CloudFormation { if (completeErr) { await this.collectStackErrors(cfnParentStackParams.StackName).then((errorDetails) => { - completeErr.message = JSON.stringify(completeErr) + errorDetails; + completeErr.message = `${completeErr.message} \n ${errorDetails}`; reject(completeErr); }); } else {