serverless-client-s3
serverless-client-s3 copied to clipboard
Allow a developer to remove the 'prod' stage text from bucket name.
Having a stage name for test, dev, UAT, etc is great, but when you host a project using a CNAME domain for a nice project URL, the bucket name must match that domain name exactly.
Allowing the user to optionally specify a regex string removal of the (e.g.) prod stage name from the bucket name allows the developer to push the prod stage so the bucket name matches the client project's domain name, while still allowing dev, test, uat, etc. s3 endpoints.
Example
CartesiCreative:node_modules duncanjm$ sls client deploy -s dev
Serverless: Deploying client to stage "dev" in region "us-east-1"...
Serverless: Finishing deployment...
Serverless: Successfully deployed client to: dev.augrel.cartesive.com.s3-website-us-east-1.amazonaws.com
1.amazonaws.com
CartesiCreative:node_modules duncanjm$ sls client deploy -s prod
Serverless: Deploying client to stage "prod" in region "us-east-1"...
Serverless: Finishing deployment...
Serverless: Successfully deployed client to: augrel.cartesive.com.s3-website-us-east-1.amazonaws.com
Now the user can go to dev at: http://dev.augrel.cartesive.com.s3-website-us-east-1.amazonaws.com
But also prod which EXACTLY matches the domain with CNAME forwarding:
http://augrel.cartesive.com