copilot init expects default profiles to be configured. It would be great to support multiple profiles. I really require this feature as I work with multiple clients. I end up accidentally running a task against different client's AWS Creds.
So I plan to contribute this feature. I can submit a PR for the same.
Here is how I would go about this:
copilot init will take a --profile <PROFILE_NAME> argument. When --profile flag is not given , it will default to default copilot [app/svc/env] init with the same behavior.I just want your inputs on one more thing. Is it okay to save this profile info in copilot/.workspace file?
It would be something like this:
application:my-awesome-app-name
profile:my-aws-cli-profile
If not, where else would you guys suggest to put this info in?
Keep in mind that you can always override default with the AWS_PROFILE environment variable, e.g. AWS_PROFILE=foo copilot init.
Holy Cow, I did not know that is how it worked. Thanks for pointing out. Then I think this resolves my issues as well. I will close this Issue. Then I think we should update this is docs as well. The Docs made it seem like it supports only default profile. Thanks for the info.
Most helpful comment
Keep in mind that you can always override
defaultwith theAWS_PROFILEenvironment variable, e.g.AWS_PROFILE=foo copilot init.