Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set AWS profile correctly #158

Open
muddahany opened this issue Sep 8, 2022 · 3 comments
Open

Unable to set AWS profile correctly #158

muddahany opened this issue Sep 8, 2022 · 3 comments

Comments

@muddahany
Copy link

I am having a difficulty setting AWS profile with serverless-compse

We have a Makefile that basically loads up the AWS credentials inside a profile and then use it to deploy.
The following approaches were taken when running the CD:

  • Using aws-profile in the serverless cli params didn't work since it isn't yet supported by sls-compose.
  • Setting the profile name on serverless.yml in the subpackages didn't load the profile but rather used the default one; even though when echoing using @aws sts get-caller-identity --profile serverless inside the Makefile , the correct credentials were loaded.
  • Setting env var with AWS_PROFILE= also does not work and serverless assumes the default profile.

Originally posted by @muddahany in #120 (comment)

@timdev
Copy link

timdev commented Sep 30, 2022

Setting env var with AWS_PROFILE= also does not work and serverless assumes the default profile.

Did you try with AWS_SDK_LOAD_CONFIG=1 in your environment along with AWS_PROFILE?

@jprice-da15252
Copy link

jprice-da15252 commented Dec 18, 2023

I have the same issue and a similar setup as described above.
My issue was due to the proflle not resolving properly in the serverless.yml file, and the default value for an unset environment variable being default:

        profile: ${opt:aws-profile, env:aws-profile, 'default'}

@muddahany
Copy link
Author

I was statically setting a value for it. Anyway we have moved away from this and decided to stick with pnpm and handle shared infrastructure in terraform and export the needed resources ARNs to serverless env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants