Skip to content

fix: avoid invalid token error#938

Closed
Siqi-Shan wants to merge 17 commits intomainfrom
regionalized-cleanup-fix
Closed

fix: avoid invalid token error#938
Siqi-Shan wants to merge 17 commits intomainfrom
regionalized-cleanup-fix

Conversation

@Siqi-Shan
Copy link
Contributor

@Siqi-Shan Siqi-Shan commented Feb 18, 2025

Description of changes

Added additional handling to invalid token scenarios in cleanup scripts, since some child test accounts do not have opt-in region enabled, and will encounter invalid token error.

Codegen Paramaters Changed or Added

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • E2E test run linked

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
@Siqi-Shan Siqi-Shan marked this pull request as ready for review February 19, 2025 01:34
@Siqi-Shan Siqi-Shan requested a review from a team as a code owner February 19, 2025 01:34

const BUCKET_TEST_REGEX = /test/;
const IAM_TEST_REGEX = /!RotateE2eAwsToken-e2eTestContextRole|-integtest$|^amplify-|^eu-|^us-|^ap-/;
const IAM_TEST_REGEX = /!RotateE2eAwsToken-e2eTestContextRole|-integtest|^amplify-|^eu-|^us-|^ap-/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this regex is wrong. I'm not aware of any functionality of ! on its own. I think this would be matching the ! character literally.

})
.promise();
} catch (e) {
if (e?.code === 'InvalidClientTokenId') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this case there shouldn't be anything to cleanup anyway? Can you add to the error message that there isn't any additional cleanup needed?

Signed-off-by: Kevin Shan <siqishan@amazon.com>
@Siqi-Shan Siqi-Shan requested a review from a team as a code owner February 19, 2025 18:21
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
Signed-off-by: Kevin Shan <siqishan@amazon.com>
@Siqi-Shan Siqi-Shan closed this Feb 20, 2025
@Siqi-Shan Siqi-Shan deleted the regionalized-cleanup-fix branch February 21, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants