I would like to use aws-cli’s config and credentials files as env variables in my serverless.yml file but can’t seem to find documentation on how this is done.
Ideally I have profiles for different environments (prod vs dev) where I have 2 different AWS accounts to split dev/staging away from production environments.
The best I can tell is that serverless will grab profile’s aws access key and secret just for running deploy but doesn’t load profile config data as environment variables…
yeah, after running through that, it doesn’t consider .aws/config.
But if using --aws-profile, does that set an env variable anywhere that can be used in the serverless.yml file?
If you execute some command like sls invoke -f test-function --aws-profile test in this situation,
Then the serverless-cli considers only .aws/credentials.
I think the serverless-cli considers .aws/credentials first.
Try again after remove the same id in the .aws/credentials.