Skip to content

Commit 5d1cd14

Browse files
authored
fix(amplify-e2e-tests): handle InvalidClientTokenId in getAmplifyApps opt-in region cleanup (#3512)
## Description Opt-in regions (`ap-east-1`, `eu-south-1`) are not enabled on the e2e test accounts. When `getAmplifyApps` calls the Amplify client in those regions, it throws `InvalidClientTokenId`, which currently propagates out of the cleanup script → `process.exit(1)` → fails the `cleanup_e2e_resources` shard. This mirrors the existing guard in `getStacks()` by also skipping on `InvalidClientTokenId` (in addition to the existing `UnrecognizedClientException`), logging and continuing rather than failing. This is a backport of the fix already on `main` (#3304) to the `release-api-plugin-stable` branch. ## Scope - e2e-cleanup only, not customer-facing - Exactly one file, one logical change
1 parent 42226cf commit 5d1cd14

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)