Closed mnapoli closed 2 years ago
@mkarsene I'm surprised that provider.profile
doesn't work. Could you clarify:
serverless deploy
in the same directory as serverless.yml
?serverless deploy
in the same directory as serverless-compose.yml
?I'm trying to identify if the issue is related to Compose or not.
Have you managed to make the profiles work before using Compose?
@mnapoli I am using serverless.ts but I assume this has no effect on any of this?
provider.profile
doesnt work at all: neither with compose nor without, associating profiles to stages or just stating provider.profile: devProfile
path: "same-directory-as-serverless-ts"
in the serverless-compose.ts
. I thought that if I don't include the path, it would assume the serverless.ts
is within the same directoy as the serverless-compose.ts
, But it threw a no path error. Tried path: ""
,path: "./"
and path: "."
Still no joy....set AWS_PROFILE=my-profile-name
though. The first time didn't work as I'd used export AWS_PROFILE
instead of set AWS_PROFILE
on a windows machine. My badGot it. serverless.ts
instead of serverless.yml
should have no impact here.
Could you post the full serverless.ts
file (with sensitive parts removed)? I want to see if there's anything else that might override the AWS profile configuration.
Regarding serverless-compose.ts
, you cannot set '.'
or ''
as a path: the service has to be in a different directory. This is because else serverless deploy
cannot decide if it should run Compose or Serverless Framework (because both config files are in the same directory).
This is something we want to improve/solve in the future.
I believe my issue was that I'd set the AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
env params in windows. These somehow took precedence over the provider.profile
variable in any serverless.ts
. deleting those from the windows env solved it...
Hey @mkarsene - that's definitely the case - the environment variables always take precedence over the profile
setting
👍
Let's close this issue then as it seems the problem was identified.
I think we can close this issue then...thanks @mnapoli
I am having a similar issue to that one, where I am having a Makefile that basically loads up the AWS credential inside a profile. We are using the same Makefile
for other services with serveless just fine.
In this case here; we are creating a newly monorepo service with serverless-compose
with multiple packages, I am trying to set the aws-profile
for deploying. However the following issues happened when we tried the 3 approaches mentioned earlier.
@aws sts get-caller-identity --profile serverless
inside the Makefile
, the correct credentials were loaded.
I have 3 AWS profiles setup on my system. Howver, I am having issues with using any of these profiles except the default one. None of the options above work for me.
provider.profile
is not workingAWS_PROFILE
environment variable Each time, it always uses the default profile, regardless of what I put in...Originally posted by @mkarsene in https://github.com/serverless/compose/issues/113#issuecomment-1126948205