{"action":"created","issue":{"url":"https://api.github.com/repos/jaws-framework/JAWS/issues/255","labels_url":"https://api.github.com/repos/jaws-framework/JAWS/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/jaws-framework/JAWS/issues/255/comments","events_url":"https://api.github.com/repos/jaws-framework/JAWS/issues/255/events","html_url":"https://github.com/jaws-framework/JAWS/issues/255","id":112413879,"number":255,"title":"Fix Programmatic Support","user":{"login":"ac360","id":2752551,"avatar_url":"https://avatars.githubusercontent.com/u/2752551?v=3","gravatar_id":"","url":"https://api.github.com/users/ac360","html_url":"https://github.com/ac360","followers_url":"https://api.github.com/users/ac360/followers","following_url":"https://api.github.com/users/ac360/following{/other_user}","gists_url":"https://api.github.com/users/ac360/gists{/gist_id}","starred_url":"https://api.github.com/users/ac360/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ac360/subscriptions","organizations_url":"https://api.github.com/users/ac360/orgs","repos_url":"https://api.github.com/users/ac360/repos","events_url":"https://api.github.com/users/ac360/events{/privacy}","received_events_url":"https://api.github.com/users/ac360/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-20T16:56:51Z","updated_at":"2015-10-20T18:52:01Z","closed_at":null,"body":"There are two outstanding issues that prevent JAWS from being used programmatically:\r\n\r\n* It is context aware in CLI mode, but has no idea where the project folder is located in programmatic mode.\r\n* Getting credentials is impossible because it doesn't know where the project is and therefore the project's `admin.env`.  Further, some actions are meant to be run outside of a project anyway and still need access to AWS credentials (e.g., ProjectCreate).\r\n\r\nTo fix both of these, I propose the following changes:\r\n\r\n* Allow a `projectPath` attr to be included in the JAWS instance config object.\r\n* Allow `apiKeys` or `profile` to be included in the JAWS instance config object\r\n\r\nThe flow looks like this:\r\n\r\n* JAWS is instantiated\r\n* Checks if interactive\r\n* Checks if within a project.  If `projectPath` is set, it overrides.\r\n* Checks for `admin.env`.  If `apiKeys` or `profile` is set, it overrides.\r\n\r\nLastly, I suggest we not configure the AWS SDK included with JAWS via profile and only do it via API Keys for simplicity.  We can grab the API Keys either from the profile or from the `config` object, and using them we only have to configure the AWS SDK to be set one way.\r\n"},"comment":{"url":"https://api.github.com/repos/jaws-framework/JAWS/issues/comments/149665916","html_url":"https://github.com/jaws-framework/JAWS/issues/255#issuecomment-149665916","issue_url":"https://api.github.com/repos/jaws-framework/JAWS/issues/255","id":149665916,"user":{"login":"ac360","id":2752551,"avatar_url":"https://avatars.githubusercontent.com/u/2752551?v=3","gravatar_id":"","url":"https://api.github.com/users/ac360","html_url":"https://github.com/ac360","followers_url":"https://api.github.com/users/ac360/followers","following_url":"https://api.github.com/users/ac360/following{/other_user}","gists_url":"https://api.github.com/users/ac360/gists{/gist_id}","starred_url":"https://api.github.com/users/ac360/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ac360/subscriptions","organizations_url":"https://api.github.com/users/ac360/orgs","repos_url":"https://api.github.com/users/ac360/repos","events_url":"https://api.github.com/users/ac360/events{/privacy}","received_events_url":"https://api.github.com/users/ac360/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T18:52:01Z","updated_at":"2015-10-20T18:52:01Z","body":"Ok.  I definitely like the `JAWS_ADMIN_AWS_PROFILE` env var change.\r\n\r\nYes, jaws will detect project path if it is not provided in config object.  \r\n\r\nOk, let's remove the profile param from all `JawsAws` methods.  And provide one method to set it.\r\n\r\nI disagree with providing only `profile` as the option.  I feel `profile` is restrictive because it is looking for a local file in a specific place.  I have a feeling JAWS will be used programmatically in lots of different contexts, possibly wrapped in lots of different tools.  Allowing API Keys in the JAWS instance config is a very common pattern.  I'd like to allow either api keys or profile in instance config.  One or the other can be used.  I've looked into it and this will require only minimal changes."}}