Ross Gerbasi
03/09/2022, 8:23 PMsst deploy
read from env
files early enough to set a profile? Just checking out the docs here, https://docs.serverless-stack.com/packages/cli#aws-profile realizing I would like to swap profiles. If I have a AWS_PROFILE
in my .env
or .env.production
will that get picked up or does it need to get set prior to running the command AWS_PROFILE=production npx sst deploy
thdxr
03/09/2022, 8:45 PMRoss Gerbasi
03/09/2022, 9:19 PM.env.local
would work? seems like its not. sst start
or sst deploy
Ross Gerbasi
03/09/2022, 9:21 PMRoss Gerbasi
03/09/2022, 9:24 PMAWS_PROFILE
if its an existing environmental variable, but doesnt look like dotenv loading is going appliedRoss Gerbasi
03/10/2022, 2:06 AMAWS_PROFILE
in commands, however this doesn't work great as most commands are in a package.json
as a script. Each developer will have a different profile name so we can't put this in there and have it in source control.
I would think if AWS_PROFILE
in .env.local
worked that might be the cleanest way.thdxr
03/10/2022, 2:23 AMAWS_PROFILE=company-personal
thdxr
03/10/2022, 2:24 AMthdxr
03/10/2022, 2:25 AM[profile ironbay-dev]
sso_start_url = <https://ironbay.awsapps.com/start>
sso_region = us-east-2
sso_account_id = 280826753141
sso_role_name = AdministratorAccess
region = us-east-2
credential_process = aws-sso-util credential-process --profile ironbay-dev
This is my personal aws account but I still give it a generic ironbay-dev
namethdxr
03/10/2022, 2:25 AMironbay-thdxr
which is what it actually isRoss Gerbasi
03/10/2022, 2:25 AMRoss Gerbasi
03/10/2022, 2:26 AMthdxr
03/10/2022, 2:27 AMRoss Gerbasi
03/10/2022, 2:28 AMnpm run deploy
or do all its own npx sst
commandsthdxr
03/10/2022, 2:52 AMthdxr
03/10/2022, 2:52 AMRoss Gerbasi
03/10/2022, 2:53 AMsst
commands directly with npx
and baking profile into scripts will keep people from deploying to the wrong place. just need everyone to make a profile to follow a standard.
Probably the simplest solution.