serverless-next.js icon indicating copy to clipboard operation
serverless-next.js copied to clipboard

I am trying to use this cool library. how to deploy other region not N. virginia?

Open ChoiJinYoung opened this issue 7 years ago • 3 comments

This library is super cool. No need configurations. but Are there only two options(domain, bucketName)? How can I do If I want to change the deployment region, and function name? Can't I change any options?

ChoiJinYoung avatar Sep 26 '19 15:09 ChoiJinYoung

Use the standard Serverless convention in your serverless.yml file

provider:
  name: aws
  runtime: nodejs10.x
  region: eu-west-1

mattdell avatar Sep 27 '19 13:09 mattdell

@mattdell Thank you for your answer. I've already tried that. it's not working well. when I follow only minimum options. it's working well. like this.

serverless.yml

myNextApplication:
  component: serverless-next.js

I run like following for deploy

 ~/Documents/Dev/react/my-service> serverless

  myNextApplication: 
    appUrl:     https://d2k2e0dkhm3grp.cloudfront.net
    bucketName: 9rkjkl8-9g0zr

  37s › myNextApplication › done

This is working very well.

but if I change yml file that you advised me like following

serverless.yml

myNextApplication:
  component: serverless-next.js
provider:
  name: aws
  runtime: nodejs10.x
  region: ap-northeast-1

when I run like following for deploy

~/Documents/Dev/react/my-service > serverless
 
  Serverless Error ---------------------------------------
 
  "service" property is missing in serverless.yml
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              10.14.2
     Framework Version:         1.53.0
     Plugin Version:            3.0.0
     SDK Version:               2.1.1
     Components Core Version:   1.0.0
     Components CLI Version:    1.2.3

I got this message. what happened to me? Is there some problem my yml file?

ChoiJinYoung avatar Sep 28 '19 07:09 ChoiJinYoung

@ChoiJinYoung There is no deployment region. serverless-next.js is regionless. Your Lambda might look like is deployed to us-east-1 but behind the scenes is replicated to the CloudFront edge locations across the globe. image

With regards to the function name, it is autogenerated to ensure there are no collisions.

I've also updated the FAQ with more info that should be helpful https://github.com/danielcondemarin/serverless-next.js#faq

danielcondemarin avatar Sep 28 '19 09:09 danielcondemarin