S3 bucket "moved" even though all pre-checks pass

codedeploy
s3
circle.yml

#1

I’m at the final steps of my automated builds but the S3 upload is failing. The create_application_revision step fails at the upload attempt. The pre-checks seem to indicate there isn’t a misconfiguration.

I can’t find anything on the 301 Moved Permanently error that’s helpful.

The errors I’m receiving:

Failed to upload to {u'bucket': u'android-prerelease-apks', u'key': u'/app-name-test-v92.apk'} in us-west-1. Check:
1) Your S3 bucket is in us-west-1
2) The S3 location is correct for your app
3) Your AWS credentials are correct
Unhandled exception
S3ResponseError: 301 Moved Permanently
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message><Bucket>android-prerelease-apks</Bucket><Endpoint>android-prerelease-apks.s3-us-west-2.amazonaws.com</Endpoint><RequestId>760525E66F2212A0</RequestId><HostId>gFRrP1R6k/2PUpDr9iBv8yeRyi87j+wAtlqiSIwc35lOK8nMIuf3zZW65K18WH4rHyvyYy6W/QY=</HostId></Error>

While there’s obviously an error, none of the attempts I’ve made in changing the bucket location have made a difference. (IIRC, S3 buckets don’t really have regions anymore.)

The relevant section in my circle.yml

deployment:
staging:
branch: circle_build
codedeploy:
app-name:
application_root: /app-name/app-name/build/outputs/apk
revision_location:
revision_type: S3
s3_location:
bucket: android-prerelease-apks
key_pattern: /app-name-test-v{BUILD_NUM}.apk
region: us-west-1
deployment_group: staging-instances
deployment_config: CodeDeployDefault.AllAtOnce

(The indentation is correct, but the blockquote has killed it.)


#2