serverless / components

The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds...
https://www.serverless.com
Apache License 2.0
2.31k stars 182 forks source link

Error: Bucket name "<bucket_name>" is already taken. #527

Open mikestaub opened 4 years ago

mikestaub commented 4 years ago

Trying to deploy a new component, I get that error. How can I specify a custom bucket name?

  DEBUG ─ Resolving the template's static variables.
  DEBUG ─ Collecting components from the template.
  DEBUG ─ Downloading any NPM components found in the template.
  DEBUG ─ Analyzing the template's components dependencies.
  DEBUG ─ Creating the template's components graph.
  DEBUG ─ Syncing template state.
  DEBUG ─ Executing the template's components graph.
  DEBUG ─ Deploying bucket 5toht19-3lqccdq in region us-east-1.
  DEBUG ─ Checking if bucket 5toht19-3lqccdq exists.

  error:
  Error: Bucket name "5toht19-3lqccdq" is already taken.
    at AwsS3.default (/Users/mikestaub/.serverless/components/registry/npm/@serverless/backend@4.1.0/node_modules/@serverless/aws-s3/serverless.js:51:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)

  1s › backend › Error: Bucket name "5toht19-3lqccdq" is already taken.
gamribeiro commented 4 years ago

backend: component: '@serverless/backend' inputs: code: root: ./code # The root folder containing the backend code. src: dist # The folder within your 'src' directory containing your built artifacts hook: npm run build # A hook to build/test/do anything region: us-east-1 runtime: nodejs10.x # The runtime for the lambda. Only nodejs10.x or nodejs8.10 are allowed memory: 128 timeout: 10 description: A function for the registry backend.
**bucketName: myBucket # (Optional) The Bucket name where src files/folder will be upload.

If not provided, it will create random bucket name prefixed by backend-**