How to fix this? `Do not set the "env" prop while...
# help
g
How to fix this?
Do not set the "env" prop while initializing "MyStack" stack. Use the "AWS_PROFILE" environment variable and "--region" CLI option instead.
I am just passing an env just like this
new MyStack(app, 'MyStack', {
env: {
account: '123456789012',
region: 'us-east-1'
},
});
r
You have an aws credentials file and possible and aws profile file in the .aws folder in the root of your user profile on your machine. (may be different on Windows) You should set the AWS_PROFILE to match the user profile from those files that you want to use for your app. If you want to set default function props, like env, use
app.setDefaultFunctionProps()
g
hm, I already defined my AWS_PROFILE when running the app
AWS_PROFILE=my-profile yarn start
r
Ok, cool, then it's probably just a case of removing the env setting from the MyStack constructor and using
app.setDefaultFunctionProps()
instead