{"action":"opened","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/1974","repository_url":"https://api.github.com/repos/serverless/serverless","labels_url":"https://api.github.com/repos/serverless/serverless/issues/1974/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/1974/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/1974/events","html_url":"https://github.com/serverless/serverless/issues/1974","id":173611320,"number":1974,"title":"Variables with numeric values cause unexpected results","user":{"login":"seliger","id":861931,"avatar_url":"https://avatars.githubusercontent.com/u/861931?v=3","gravatar_id":"","url":"https://api.github.com/users/seliger","html_url":"https://github.com/seliger","followers_url":"https://api.github.com/users/seliger/followers","following_url":"https://api.github.com/users/seliger/following{/other_user}","gists_url":"https://api.github.com/users/seliger/gists{/gist_id}","starred_url":"https://api.github.com/users/seliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seliger/subscriptions","organizations_url":"https://api.github.com/users/seliger/orgs","repos_url":"https://api.github.com/users/seliger/repos","events_url":"https://api.github.com/users/seliger/events{/privacy}","received_events_url":"https://api.github.com/users/seliger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-27T19:24:59Z","updated_at":"2016-08-27T19:24:59Z","closed_at":null,"body":"<!--\r\n1. Please check if an issue already exists so there are no duplicates\r\n2. Check out and follow our Guidelines: https://github.com/serverless/serverless/blob/master/CONTRIBUTING.md\r\n2. Fill out the whole template so we have a good overview on the issue\r\n3. Please follow the template, otherwise we'll have to ask you to update it\r\n4. Remove any template data that isn't necessary for your issue\r\n-->\r\n\r\n# This is a BUG REPORT\r\n\r\n## Description\r\n\r\nI added a variable with a numeric value like so:\r\n\r\n`sls variables set -t stage -s prod -k accountid -v 1234567890`\r\n\r\nThis completed successfully. I then referenced that variable inside my s-resources-cf.json file, something like this:\r\n\r\n```\r\n{\r\n  \"Resource\": [\r\n      \"arn:aws:dynamodb:${region}:${accountid}:table/Ratings\",\r\n      \"arn:aws:dynamodb:${region}:${accountid}:table/Ratings/index/*\",\r\n      \"arn:aws:dynamodb:${region}:${accountid}:table/UserFeedback\",\r\n      \"arn:aws:dynamodb:${region}:${accountid}:table/UserFeedback/index/*\",\r\n      \"arn:aws:dynamodb:${region}:${accountid}:table/UserProfiles\",\r\n      \"arn:aws:dynamodb:${region}:${accountid}:table/UserProfiles/index/*\"\r\n  ]\r\n}\r\n```\r\n\r\nThe goal being to replace hard coded values for region and account number with variables. Running the diff command as such:\r\n\r\n`sls resources diff`\r\n\r\nAny line that had the numeric value would be COMPLETELY replaced by the numeric value, instead of the value being replaced in the middle of the line. \r\n\r\n![image](https://cloud.githubusercontent.com/assets/861931/18029577/b785f7c6-6c69-11e6-8fb7-2e16041a93fb.png)\r\n\r\nThis image demonstrates the unexpected result.\r\n\r\nThere are no errors or stack traces. Except that later deploys fail because the generated resources manifest is corrupt.\r\n\r\nIf I unset the variable, run the set command, and place double quotes around the value, it then works as expected.\r\n\r\n`sls variables set -t stage -s prod -k accountid -v \"1234567890\"`\r\n\r\nThere is no requirement here for the value to actually be numeric. I simply did not put double quotes around it because I was not trying to do something like manage for spaces, etc.\r\n\r\nSimilar or dependent issues:\r\n* None that I could find\r\n\r\n## Additional Data\r\n\r\n* ***Serverless Framework Version you're using:*** 0.5.6\r\n* ***Operating System:*** Ubuntu 16.04 xu6_64\r\n* ***Stack Trace:*** None\r\n* ***Provider Error messages:*** None\r\n"}}
{"actor":{"display_login":"seliger"}}