Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service name gets prepended to the bucketName #27

Open
saadtazi opened this issue Apr 13, 2020 · 2 comments
Open

service name gets prepended to the bucketName #27

saadtazi opened this issue Apr 13, 2020 · 2 comments

Comments

@saadtazi
Copy link

Hello,
With the following configuration:

service: my-webapp

plugins:
  - fullstack-serverless

provider:
  name: aws
  versionFunctions: false
  region: ${opt:region, 'us-east-1'}
  stage: dev # default stage

custom:
  stage: "${opt:stage, self:provider.stage}"
  profiles:
    dev: dev-profile
  fullstack:
    bucketName: my-webapp-dev
    distributionFolder: build
    indexDocument: index.html
    errorDocument: error.html
    singlePageApp: true
    # clientCommand: npm run builddoing nothing
    # clientSrcPath: client

i get the following error:

sls client deploy --no-confirm --stage dev
Serverless: Skipping client generation...
Serverless: This deployment will:
Serverless: - Remove all existing files from bucket 'my-webapp-dev-my-webapp-saad'
Serverless: - Upload all files from 'build' to bucket 'my-webapp-dev-my-webapp-saad'
Serverless: Looking for bucket 'my-webapp-dev-my-webapp-saad'...
Serverless: Bucket does not exist. Run serverless deploy

  Serverless Error ---------------------------------------

  Bucket does not exist!

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              13.8.0
     Framework Version:         1.67.3
     Plugin Version:            3.6.6
     SDK Version:               2.3.0
     Components Version:        2.29.1

Notice that the bucket name in the logs is my-webapp-dev-my-webapp-saad, not just my-webapp-saad.

Is there a way to not prepend the service name to the bucketName?

@saadtazi
Copy link
Author

Ok, sorry for the noise: I just found that it is the expected behaviour according to this line.

Maybe the doc can be updated?

@edwardgale
Copy link

edwardgale commented May 5, 2020

Would be better to have the bucketName as the actual bucket name in config and not prepend the service name. This would allow the bucketName to fit in with naming policy already used in our AWS account. It would be also more in keeping the way, if you define a custom name for a resource, the serverless framework honours the custom name (for example setting provider.stackName).

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

No branches or pull requests

2 participants