Skip to content

fix(cli): handle unsupported S3 acceleration in migration - #14900

Open
hariharan077 wants to merge 1 commit into
aws-amplify:devfrom
hariharan077:fix-14876-s3-accelerate-method-not-allowed
Open

hariharan077 wants to merge 1 commit into
aws-amplify:devfrom
hariharan077:fix-14876-s3-accelerate-method-not-allowed

Conversation

@hariharan077

@hariharan077 hariharan077 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description of changes

Fixes #14876.

amplify gen2-migration generate currently fails when S3 returns MethodNotAllowed for GetBucketAccelerateConfiguration, which can happen for buckets where transfer acceleration is unsupported. This updates AwsFetcher.fetchBucketAccelerate() to treat only MethodNotAllowed as an unavailable acceleration state and return undefined, while still propagating other S3 errors.

The regression test uses a real S3Client against a mocked HTTP 405 REST-XML response. This exercises the AWS SDK deserializer and proves that <Code>MethodNotAllowed</Code> becomes an S3 service error whose name is MethodNotAllowed.

Description of how you validated changes

  • Reproduced the failure through the real AWS SDK path before the patch: the HTTP 405 REST-XML response deserialized to S3ServiceException with name === 'MethodNotAllowed', and fetchBucketAccelerate() rejected.
  • Verified the same reproduction after the patch resolves to undefined.
  • Focused AwsFetcher regression: 3/3 tests passed.
  • S3 migration generator suite: 13/13 tests and 11/11 snapshots passed.
  • Full @aws-amplify/cli-internal suite: 131/131 suites, 802/802 tests, and 138/138 snapshots passed.
  • @aws-amplify/cli-internal build passed.
  • ESLint, Prettier, and diff checks passed.
  • Repository pre-commit and pre-push hooks passed without bypasses.

Checklist

  • PR description included
  • Tests are changed or added

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

sharonyajain
sharonyajain previously approved these changes Aug 24, 2026
Treat an SDK-deserialized MethodNotAllowed response as an unsupported
bucket acceleration capability and continue migration.

Exercise the real S3 REST-XML deserialization path and preserve
propagation of unrelated failures.

Tests: cli-internal focused and full package suites; storage generator;
build, ESLint, Prettier, and diff checks.
---
Prompt: do it
@hariharan077
hariharan077 force-pushed the fix-14876-s3-accelerate-method-not-allowed branch from 6ce5f77 to f50c7d4 Compare August 26, 2026 15:01
@sharonyajain
sharonyajain self-requested a review September 8, 2026 13:31
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.

Gen1 to Gen2 migration fails with MethodNotAllowed error for S3 Transfer Acceleration in unsupported regions (eu-north-1)

2 participants