{"action":"created","issue":{"url":"https://api.github.com/repos/apex/apex/issues/513","repository_url":"https://api.github.com/repos/apex/apex","labels_url":"https://api.github.com/repos/apex/apex/issues/513/labels{/name}","comments_url":"https://api.github.com/repos/apex/apex/issues/513/comments","events_url":"https://api.github.com/repos/apex/apex/issues/513/events","html_url":"https://github.com/apex/apex/issues/513","id":169132832,"number":513,"title":"Fallback to project.json or function.json for unknown environment","user":{"login":"maksymkazakov","id":10164630,"avatar_url":"https://avatars.githubusercontent.com/u/10164630?v=3","gravatar_id":"","url":"https://api.github.com/users/maksymkazakov","html_url":"https://github.com/maksymkazakov","followers_url":"https://api.github.com/users/maksymkazakov/followers","following_url":"https://api.github.com/users/maksymkazakov/following{/other_user}","gists_url":"https://api.github.com/users/maksymkazakov/gists{/gist_id}","starred_url":"https://api.github.com/users/maksymkazakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maksymkazakov/subscriptions","organizations_url":"https://api.github.com/users/maksymkazakov/orgs","repos_url":"https://api.github.com/users/maksymkazakov/repos","events_url":"https://api.github.com/users/maksymkazakov/events{/privacy}","received_events_url":"https://api.github.com/users/maksymkazakov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-03T13:35:06Z","updated_at":"2016-08-03T16:33:33Z","closed_at":null,"body":"I use three environments in my project: testing, staging and prod.\r\nI've specified three project configs: project.testing.json, project.staging.json and project.prod.json. For the function.json I was not going to introduce any env-related changes and kept that one file. From the documentation I understood that there will be a fallback to default JSON config if there is no corresponding env-related one. I got it wrong as I realized now. So, fine, I can create those env-related function configs, not a problem. The issue is that I need to copy all settings into each project/function config and then support the changes in all of them.\r\n\r\nFeature request: Would be great to have either config sections as in INI files for each of existing environments, or have this logic:\r\n- lookup for default config file and using it if found\r\n- lookup for env-related config and merging it with default one, if found\r\n\r\nIn case of config sections there can be a single project.json file like this:\r\n```\r\n{\r\n  \"default\": {\r\n    \"runtime\": \"nodejs4.3\",\r\n    \"role\": \"arn:aws:...\",\r\n    ...\r\n  },\r\n  \"testing\": {\r\n    \"environment\": {\r\n      \"APP_ENV\": \"testing\",\r\n      \"SERVICE_URL\": \"https://testing.myservice.com\"\r\n    }\r\n  }\r\n  \"staging\": {\r\n    \"environment\": {\r\n      \"APP_ENV\": \"staging\",\r\n      \"SERVICE_URL\": \"https://staging.myservice.com\"\r\n    }\r\n  },\r\n  \"prod\": { ... }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/apex/apex/issues/comments/237291011","html_url":"https://github.com/apex/apex/issues/513#issuecomment-237291011","issue_url":"https://api.github.com/repos/apex/apex/issues/513","id":237291011,"user":{"login":"maksymkazakov","id":10164630,"avatar_url":"https://avatars.githubusercontent.com/u/10164630?v=3","gravatar_id":"","url":"https://api.github.com/users/maksymkazakov","html_url":"https://github.com/maksymkazakov","followers_url":"https://api.github.com/users/maksymkazakov/followers","following_url":"https://api.github.com/users/maksymkazakov/following{/other_user}","gists_url":"https://api.github.com/users/maksymkazakov/gists{/gist_id}","starred_url":"https://api.github.com/users/maksymkazakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maksymkazakov/subscriptions","organizations_url":"https://api.github.com/users/maksymkazakov/orgs","repos_url":"https://api.github.com/users/maksymkazakov/repos","events_url":"https://api.github.com/users/maksymkazakov/events{/privacy}","received_events_url":"https://api.github.com/users/maksymkazakov/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T16:33:32Z","updated_at":"2016-08-03T16:33:32Z","body":"And again about envs, I've just stuck with need to create separate .tf files for AWS provisioning. Right now there is no difference in file for different envs, so I have to create env-named folders and put symlinks in them pointing to actual Terraform config. Would be great to avoid this too."}}
{"actor":{"display_login":"maksymkazakov"}}