Skip to content

Commit 64913c1

Browse files
committed
fix(amplify-e2e-tests): handle InvalidClientTokenId in getAmplifyApps opt-in region cleanup
Opt-in regions (ap-east-1/eu-south-1) are not enabled on test accounts, causing getAmplifyApps to throw InvalidClientTokenId which propagates to process.exit(1) and fails the cleanup_e2e_resources shard. Mirror the existing getStacks() guard by also skipping on InvalidClientTokenId. Backport of the fix already on main (#3304) to release-api-plugin-stable. e2e-cleanup only, not customer-facing.
1 parent 2f62dbe commit 64913c1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const getAmplifyApps = async (account: AWSAccountInfo, region: string): Promise<
180180
try {
181181
amplifyApps = await amplifyClient.send(new ListAppsCommand({ maxResults: 50 })); // keeping it to 50 as max supported is 50
182182
} catch (e) {
183-
if (e?.name === 'UnrecognizedClientException') {
183+
if (e?.name === 'UnrecognizedClientException' || e?.name === 'InvalidClientTokenId') {
184184
// Do not fail the cleanup and continue
185185
console.log(`Listing apps for account ${account.accountId}-${region} failed with error with code ${e?.name}. Skipping.`);
186186
return result;

0 commit comments

Comments
 (0)