{"action":"created","issue":{"url":"https://api.github.com/repos/apex/apex/issues/528","repository_url":"https://api.github.com/repos/apex/apex","labels_url":"https://api.github.com/repos/apex/apex/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/apex/apex/issues/528/comments","events_url":"https://api.github.com/repos/apex/apex/issues/528/events","html_url":"https://github.com/apex/apex/issues/528","id":171593270,"number":528,"title":"Apex deploy not idempotent in either config or code","user":{"login":"skabbes","id":592178,"avatar_url":"https://avatars.githubusercontent.com/u/592178?v=3","gravatar_id":"","url":"https://api.github.com/users/skabbes","html_url":"https://github.com/skabbes","followers_url":"https://api.github.com/users/skabbes/followers","following_url":"https://api.github.com/users/skabbes/following{/other_user}","gists_url":"https://api.github.com/users/skabbes/gists{/gist_id}","starred_url":"https://api.github.com/users/skabbes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skabbes/subscriptions","organizations_url":"https://api.github.com/users/skabbes/orgs","repos_url":"https://api.github.com/users/skabbes/repos","events_url":"https://api.github.com/users/skabbes/events{/privacy}","received_events_url":"https://api.github.com/users/skabbes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-17T07:36:47Z","updated_at":"2016-08-17T18:37:36Z","closed_at":null,"body":"Apex version 0.10.2\r\nApex platform: Go\r\nMac OSX Yosemite 10.10.5\r\n\r\nWhen I try to `apex deploy` new versions of the code are _always_ deployed, the config is detected as if it has changed as well.  Even in back-to-back calls to `apex deploy` functions and configs are updated.  I also deployed 2 different versions, downloaded the zip files from the lambda UI and diffed the files - they did not differ.\r\n\r\n** Info I am not sure whether it is relevant or not **\r\n* I didn't notice this when I did the apex hello world example\r\n* I do not have a function.json file\r\n* \".go\" files are apexignored\r\n* I am running in a VPC\r\n* I have 2 \"instances\" of apex running on my AWS account in order to isolate different IAM roles necessary\r\n* I have added custom defined policies to my lambda role\r\n* I have all of my lambda functions connected to CloudWatch events\r\n\r\n**Project.json**\r\n```json\r\n{\r\n  \"name\": \"infra\",\r\n  \"description\": \"This is a set of functions that will be used to manage infra\",\r\n  \"runtime\": \"golang\",\r\n  \"memory\": 128,\r\n  \"timeout\": 120,\r\n  \"role\": \"arn:aws:iam::AWS_ACCOUNT_ID:role/infra_lambda_function\",\r\n  \"environment\": {},\r\n  \"vpc\": {\r\n    \"securityGroups\": [\r\n      \"sg-SG1\"\r\n    ],\r\n    \"subnets\": [\r\n      \"subnet-A\",\r\n      \"subnet-B\",\r\n      \"subnet-C\"\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n**.apexignore**\r\n```\r\n.*go\r\n```\r\n\r\n`apex deploy trigger_buildbot -l debug`\r\n```text\r\n   • loading functions in functions\r\n   • loading function in functions/trigger_buildbot\r\n   • deploying 1 functions    \r\n   • deploying                 function=trigger_buildbot\r\n   • creating build            function=trigger_buildbot\r\n   • injecting prelude         function=trigger_buildbot\r\n   • hook                      command=GOOS=linux GOARCH=amd64 go build -o main *.go function=trigger_buildbot hook=build\r\n   • adding env                env=map[LAMBDA_FUNCTION_NAME:infra_trigger_buildbot APEX_FUNCTION_NAME:trigger_buildbot] function=trigger_buildbot\r\n   • add shim                  function=trigger_buildbot\r\n   • add file to zip           file=main function=trigger_buildbot\r\n   • created build (2.6 MB)    function=trigger_buildbot\r\n   • fetching config           function=trigger_buildbot\r\n   • config changed            function=trigger_buildbot\r\n   • updating config           function=trigger_buildbot\r\n   • updating function         function=trigger_buildbot\r\n   • updated alias current     function=trigger_buildbot version=20\r\n   • function updated          function=trigger_buildbot name=infra_trigger_buildbot version=20\r\n   • cleaning up version: 10   function=trigger_buildbot\r\n   • cleaning 1 functions     \r\n   • hook                      command=rm -f main function=trigger_buildbot hook=clean\r\n   • conditional flush         above_duration=24h0m0s above_size=500 age=38m33.282169122s size=73\r\n   • close     \r\n```\r\n\r\nI also notice this warning in Lambda:\r\n\r\n<img width=\"1148\" alt=\"screenshot 2016-08-17 00 31 16\" src=\"https://cloud.githubusercontent.com/assets/592178/17728086/3ca9d676-6412-11e6-8657-30f9d321bc78.png\">\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apex/apex/issues/comments/240506179","html_url":"https://github.com/apex/apex/issues/528#issuecomment-240506179","issue_url":"https://api.github.com/repos/apex/apex/issues/528","id":240506179,"user":{"login":"skabbes","id":592178,"avatar_url":"https://avatars.githubusercontent.com/u/592178?v=3","gravatar_id":"","url":"https://api.github.com/users/skabbes","html_url":"https://github.com/skabbes","followers_url":"https://api.github.com/users/skabbes/followers","following_url":"https://api.github.com/users/skabbes/following{/other_user}","gists_url":"https://api.github.com/users/skabbes/gists{/gist_id}","starred_url":"https://api.github.com/users/skabbes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skabbes/subscriptions","organizations_url":"https://api.github.com/users/skabbes/orgs","repos_url":"https://api.github.com/users/skabbes/repos","events_url":"https://api.github.com/users/skabbes/events{/privacy}","received_events_url":"https://api.github.com/users/skabbes/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T18:37:35Z","updated_at":"2016-08-17T18:37:35Z","body":"Ah, that makes sense why the code keep being deployed - thanks. I believe the problems is that the canonical representation of the security groups and subnets on AWS doesn't respect the order in which apex sends them necessarily.\r\n\r\nAlthough the type is an array, it really represents a set.  I'll take a stab at fixing this in a PR.  Thanks for the help!\r\n\r\nhttps://github.com/apex/apex/blob/263e85b1e922e1398ad3c9078499dd50eea304bd/function/function.go#L748-L758\r\n\r\n"}}
{"actor":{"display_login":"skabbes"}}