https://serverless-stack.com/ logo
#sst
Title
# sst
y

Yeltrah

01/09/2022, 5:41 AM
How I’m releasing a NextJs site using SST and I have it working well. The only thing is even though I set region to
us-east-1
I notice the CDK formation and the S3 sitebucket are created in
eu-west-1
which must be the default region I set for the AWS CLI. How can I ensure that the CDK + S3 and really all related services for that deployment are all created in the same region?
m

manitej

01/09/2022, 5:42 AM
do you have region configured in
sst.json
?
y

Yeltrah

01/09/2022, 5:44 AM
No. I currently only pass it in the stack via the environment variables region
Copy code
{
 environment: {
  REGION: 'us-east-1'
 }
}
This seems to only set the edge lambda in that region
m

manitej

01/09/2022, 5:54 AM
You can change the region in
sst.json
to change default region.
y

Yeltrah

01/09/2022, 5:55 AM
Ok but I noticed this will be
deprecated
soon
Or maybe that was the stage
What if I want this to be dynamic..so different environments should be set in different regions
Would it then be recommend to set it using the
--region
param in the cli?
Setting it via the cli worked..thanks!
t

thdxr

01/10/2022, 5:44 PM
Yeah I wouldn't set it in sst.json - it's better to control through environment using aws's configuration