Closed dinnouti closed 3 years ago
hey @dinnouti - yes, you should be able to set the AWS_PROFILE
environment variable in the workflow config page to target any other named profiles you have in your ~/.aws/config
file.
as a sidenote: this workflow uses the AWS SDK for Go under-the-hood, so any env vars you set in that Alfred config page should be respected by the underlying library. see this page for more details (the README for this workflow also has references to these links for future reference). you can search the page for AWS_PROFILE
to see examples for you specific usage here
please let me know if that answers your question or this isn't working for some reason
I work with several profiles and this will solution will help. Thank you!
for what it's worth, this workflow doesn't yet support switching profiles/env vars on the fly, but can potentially just install multiple versions of it with different prefixes that have different env vars configured (though i have not tested this; you may run into issues with caching). i think that can get you a more seamless way to query different profiles at any given time, if you have the need to actively switch between the profiles (though there will be overhead of maintaining/updating all of them when new releases are pushed)
If the Go script is allowed to read the ~/aws/ files, that would be a easy approach to pick a different profile.
I just tested installing multiple versions and configuring the prefixes for different profiles; and it's working great.
Only issue I ran into alfred_workflow_bundleid
is copied not over when duplicating; since you can't have two Bundle Ids named the same. After you duplicate the Workflow; double click on it to Edit Details, and set the Bundle Id.
Example
Bundle Id: com.ryankoval.aws$Profile-Name
Hi Ryan, great Alfred workflow. I work with several profiles and would be helpful to be able to change profiles. Is it possible to set the AWS profile using the Alfred workflow environment variables?