{"action":"created","issue":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/issues/23","repository_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website","labels_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/issues/23/comments","events_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/issues/23/events","html_url":"https://github.com/california-civic-data-coalition/django-calaccess-downloads-website/pull/23","id":162186016,"number":23,"title":"Store all aws configs in .secrets","user":{"login":"gordonje","id":4304548,"avatar_url":"https://avatars.githubusercontent.com/u/4304548?v=3","gravatar_id":"","url":"https://api.github.com/users/gordonje","html_url":"https://github.com/gordonje","followers_url":"https://api.github.com/users/gordonje/followers","following_url":"https://api.github.com/users/gordonje/following{/other_user}","gists_url":"https://api.github.com/users/gordonje/gists{/gist_id}","starred_url":"https://api.github.com/users/gordonje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gordonje/subscriptions","organizations_url":"https://api.github.com/users/gordonje/orgs","repos_url":"https://api.github.com/users/gordonje/repos","events_url":"https://api.github.com/users/gordonje/events{/privacy}","received_events_url":"https://api.github.com/users/gordonje/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-24T16:44:05Z","updated_at":"2016-06-25T03:46:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/pulls/23","html_url":"https://github.com/california-civic-data-coalition/django-calaccess-downloads-website/pull/23","diff_url":"https://github.com/california-civic-data-coalition/django-calaccess-downloads-website/pull/23.diff","patch_url":"https://github.com/california-civic-data-coalition/django-calaccess-downloads-website/pull/23.patch"},"body":"Currently, devs working locally can have the various aws configurations in two different places: \r\n\r\n1. A .secrets shell script similar to the one we create on the EC2 instance, which can be sourced to load these configurations as environment variables. \r\n2. A aws_config.py file that, when imported, adds these configurations to the fabric env. This is the file that is manipulated by various fab functions.\r\n\r\nThis setup allows the key pair files and EC2 and RDS instances to be dynamic (which has been great for spinning up and terminating instances with various configs, as we continue to figure that out).\r\n\r\nHowever, this set up also allows the most recently created RDS host to get out of sync with the RDS host referenced in the developer's environment, which is what django recognizes (in settings.py). As far, I can tell, there's no way for Python or Fabric to permanently set these environment variables (it was a rather n00b assumption on my part that this would be possible).\r\n\r\nThis pull request resolves this issue by storing all of these configurations in ~/.secrets and reading those configurations from that file into the fabric env. \r\n\r\nOne potential downside: The developer's local .secrets file will need additional configurations (specifically, EC2_HOST and KEY_NAME) that will not be included in the version of this file on the EC2 instance. \r\n\r\nStill, it's possibly a less hacky and simpler approach that what we are currently doing, but would like other eyes on this before merging."},"comment":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/issues/comments/228507999","html_url":"https://github.com/california-civic-data-coalition/django-calaccess-downloads-website/pull/23#issuecomment-228507999","issue_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-downloads-website/issues/23","id":228507999,"user":{"login":"palewire","id":9993,"avatar_url":"https://avatars.githubusercontent.com/u/9993?v=3","gravatar_id":"","url":"https://api.github.com/users/palewire","html_url":"https://github.com/palewire","followers_url":"https://api.github.com/users/palewire/followers","following_url":"https://api.github.com/users/palewire/following{/other_user}","gists_url":"https://api.github.com/users/palewire/gists{/gist_id}","starred_url":"https://api.github.com/users/palewire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palewire/subscriptions","organizations_url":"https://api.github.com/users/palewire/orgs","repos_url":"https://api.github.com/users/palewire/repos","events_url":"https://api.github.com/users/palewire/events{/privacy}","received_events_url":"https://api.github.com/users/palewire/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T03:46:04Z","updated_at":"2016-06-25T03:46:04Z","body":"Alrighty. I think I have it spinning up the server. Now the last and hardest step. Getting the chef bootstrap to take. \r\n\r\nI suspect that I just need to figure out a way to write out a .env file in the prod environment and I'll be good. \r\n\r\nIt might be good to expand the local fabric functions for that to allow for editing the remote file as well."}}
{"actor":{"display_login":"palewire"}}