Skip to content

Commit 058c661

Browse files
sai-raySai Ray
andauthored
feat(gen2-migration): add deployment status validation for lock command (#14326)
* chore: add deployment status validation for lock command * chore: add UPDATE_ROLLBACK_COMPLETE to valid deployment statuses * chore: update error message to exclude UPDATE_ROLLBACK_COMPLETE from user output * chore: regenerate yarn.lock to fix lockfile drift * Revert "chore: regenerate yarn.lock to fix lockfile drift" This reverts commit ba03e99. * chore: sync yarn.lock with base branch --------- Co-authored-by: Sai Ray <[email protected]>
1 parent 1570cf5 commit 058c661

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/amplify-cli/src/commands/gen2-migration/_validations.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,17 @@ export class AmplifyGen2MigrationValidations {
7272
}
7373

7474
const stackStatus = response.Stacks[0].StackStatus;
75-
const validStatuses = ['UPDATE_COMPLETE', 'CREATE_COMPLETE'];
75+
// Note: UPDATE_ROLLBACK_COMPLETE isn't an expected state - only being added in the edge case of resuming migration from a failed state
76+
const validStatuses = ['UPDATE_COMPLETE', 'CREATE_COMPLETE', 'UPDATE_ROLLBACK_COMPLETE'];
7677

7778
if (!validStatuses.includes(stackStatus)) {
7879
throw new AmplifyError('StackStateError', {
79-
message: `Root stack status is ${stackStatus}, expected ${validStatuses.join(' or ')}`,
80+
message: `Root stack status is ${stackStatus}, expected UPDATE_COMPLETE or CREATE_COMPLETE`,
8081
resolution: 'Complete the deployment before proceeding.',
8182
});
8283
}
84+
85+
printer.success(`Deployment status validated: ${stackStatus}`);
8386
}
8487

8588
public async validateDeploymentVersion(): Promise<void> {

0 commit comments

Comments
 (0)