You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--fsx-create fails with 301 MovedPermanently when S3 bucket is in a different region than the instance #103
spawn launch --fsx-create --fsx-s3-bucket <bucket> fails immediately with a 301 redirect error when the S3 bucket exists in a different region than the instance being launched.
Error
Error: failed to create FSx filesystem: failed to create S3 bucket: failed to check if bucket exists:
operation error S3: HeadBucket, https response error StatusCode: 301, RequestID: 0D2K6Y3E468HH7Q8,
api error MovedPermanently: Moved Permanently
The S3 HeadBucket call is being made against the global S3 endpoint (or the wrong region endpoint). When a bucket exists in a different region, S3 returns 301 instead of 200. The fix is to use a region-aware S3 client for the bucket existence check — either:
Parse the region from the --fsx-s3-bucket URI and construct a region-specific client, or
Use GetBucketLocation to discover the bucket's region and redirect accordingly, or
Skip the bucket existence check and let FSx return a meaningful error if the bucket doesn't exist (FSx itself handles cross-region validation)
Note on FSx DRA cross-region
As a related point: FSx PERSISTENT_2 Data Repository Associations require the S3 bucket to be in the same region as the filesystem (AWS enforces this). So even after fixing the HeadBucket check, --fsx-create with a cross-region bucket will fail at the DRA creation step. The error message from spawn could be clearer here — ideally detecting region mismatch early and printing:
Error: --fsx-s3-bucket bucket region (us-west-2) does not match instance region (us-east-2).
FSx data repository associations require same-region S3.
Either use a bucket in us-east-2 or omit --fsx-create and create FSx manually.
Workaround
Create the FSx filesystem separately and pass --fsx-id instead of --fsx-create.
Verified fixed in spawn v0.43.0 (truffle v0.38.1). Cross-region --fsx-create --fsx-s3-bucket <us-west-2 bucket> with an instance in us-east-2 now passes the bucket-existence check cleanly instead of erroring on the 301. Re-tested against the original Tutorial 04 scenario (BuckAI aws-buckai bucket in us-west-2, hpc6a.48xlarge in us-east-2) — the manual --fsx-id workaround is no longer needed. 🎉
Activity
test: cover LaunchError (#108) and cross-region S3 redirect (#103)
fix: spawn quick-wins #103 #104 #108 #110 (truffle-backed validation) (…
scttfrdmn commentedon Jun 12, 2026
Fixed in #111 (merged). spawn now sources instance-type capabilities from truffle (GetCapabilities).
scttfrdmn commentedon Jun 12, 2026
Verified fixed in spawn v0.43.0 (truffle v0.38.1). Cross-region
--fsx-create --fsx-s3-bucket <us-west-2 bucket>with an instance inus-east-2now passes the bucket-existence check cleanly instead of erroring on the 301. Re-tested against the original Tutorial 04 scenario (BuckAIaws-buckaibucket in us-west-2, hpc6a.48xlarge in us-east-2) — the manual--fsx-idworkaround is no longer needed. 🎉