{"action":"created","issue":{"url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale/issues/129","repository_url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale","labels_url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale/issues/129/comments","events_url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale/issues/129/events","html_url":"https://github.com/exoscale/terraform-provider-exoscale/issues/129","id":328525001,"node_id":"MDU6SXNzdWUzMjg1MjUwMDE=","number":129,"title":"Crash when providing API key and secret from environment variable","user":{"login":"markschmid","id":6959615,"node_id":"MDQ6VXNlcjY5NTk2MTU=","avatar_url":"https://avatars1.githubusercontent.com/u/6959615?v=4","gravatar_id":"","url":"https://api.github.com/users/markschmid","html_url":"https://github.com/markschmid","followers_url":"https://api.github.com/users/markschmid/followers","following_url":"https://api.github.com/users/markschmid/following{/other_user}","gists_url":"https://api.github.com/users/markschmid/gists{/gist_id}","starred_url":"https://api.github.com/users/markschmid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markschmid/subscriptions","organizations_url":"https://api.github.com/users/markschmid/orgs","repos_url":"https://api.github.com/users/markschmid/repos","events_url":"https://api.github.com/users/markschmid/events{/privacy}","received_events_url":"https://api.github.com/users/markschmid/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-06-01T13:42:50Z","updated_at":"2018-06-04T13:19:35Z","closed_at":"2018-06-04T10:28:30Z","author_association":"NONE","body":"I'd like to provide the API key and the secret as env variables rather than in the configs (.tf) files.\r\nMaybe I'm doing something wrong, but terraform crashes. I've tried to re-init terraform, but it does not help.\r\n\r\n1. Environment variables\r\n```\r\n[minibaby:~/tftest] mark% env | grep EXOSCALE\r\nEXOSCALE_API_KEY=EXOfoo\r\nEXOSCALE_SECRET_KEY=bar\r\n```\r\n\r\n2. Provider config (config.tf) with commented out values\r\n```\r\nprovider \"exoscale\" {\r\n  version = \"~> 0.9\"\r\n  #key = \"${var.apikey}\"\r\n  #secret = \"${var.secret}\"\r\n}\r\n```\r\n\r\n3. Running terraform\r\n```\r\n[minibaby:~/tftest] mark% terraform plan\r\nRefreshing Terraform state in-memory prior to plan...\r\nThe refreshed state will be used to calculate this plan, but will not be\r\npersisted to local or remote state storage.\r\n\r\ndata.template_file.init[1]: Refreshing state...\r\ndata.template_file.init[0]: Refreshing state...\r\ndata.template_cloudinit_config.xyz-test-lb-config[0]: Refreshing state...\r\ndata.template_cloudinit_config.xyz-test-lb-config[1]: Refreshing state...\r\n\r\n------------------------------------------------------------------------\r\n\r\nError: Error running plan: 1 error(s) occurred:\r\n\r\n* provider.exoscale: unexpected EOF\r\n\r\npanic: runtime error: invalid memory address or nil pointer dereference\r\n2018-06-01T13:39:08.350Z [DEBUG] plugin.terraform-provider-exoscale_v0.9.22_x1: [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xaefe10]\r\n... lots of stack trace messages ...\r\n```\r\n\r\nIt looks as if it does not like the `provider \"exoscale\" {}` config lacking the `key` and `secret` element for some reason(?)\r\n\r\nTerraform v0.11.7\r\n+ provider.exoscale v0.9.22\r\n+ provider.template v1.0.0\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale/issues/comments/394351516","html_url":"https://github.com/exoscale/terraform-provider-exoscale/issues/129#issuecomment-394351516","issue_url":"https://api.github.com/repos/exoscale/terraform-provider-exoscale/issues/129","id":394351516,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDM1MTUxNg==","user":{"login":"markschmid","id":6959615,"node_id":"MDQ6VXNlcjY5NTk2MTU=","avatar_url":"https://avatars1.githubusercontent.com/u/6959615?v=4","gravatar_id":"","url":"https://api.github.com/users/markschmid","html_url":"https://github.com/markschmid","followers_url":"https://api.github.com/users/markschmid/followers","following_url":"https://api.github.com/users/markschmid/following{/other_user}","gists_url":"https://api.github.com/users/markschmid/gists{/gist_id}","starred_url":"https://api.github.com/users/markschmid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markschmid/subscriptions","organizations_url":"https://api.github.com/users/markschmid/orgs","repos_url":"https://api.github.com/users/markschmid/repos","events_url":"https://api.github.com/users/markschmid/events{/privacy}","received_events_url":"https://api.github.com/users/markschmid/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T13:19:35Z","updated_at":"2018-06-04T13:19:35Z","author_association":"NONE","body":"```\r\n[minibaby:~/tftest] mark% docker run -i -t -v `pwd`:/app/ -w /app/ neoos-tf plan\r\nRefreshing Terraform state in-memory prior to plan...\r\nThe refreshed state will be used to calculate this plan, but will not be\r\npersisted to local or remote state storage.\r\n\r\ndata.template_file.init[0]: Refreshing state...\r\ndata.template_file.init[1]: Refreshing state...\r\ndata.template_cloudinit_config.rega-test-lb-config[0]: Refreshing state...\r\ndata.template_cloudinit_config.rega-test-lb-config[1]: Refreshing state...\r\n\r\nError: Error refreshing state: 1 error(s) occurred:\r\n\r\n* provider.exoscale: key (), secret are missing, or config file not found within: /app/cloudstack.ini, /app/cloudstack.ini\r\n```\r\n\r\nI'm running terraform in docker and mounting the directory with all my .tf files in the docker container in \"/app\". But, thinking some more about it, my shell environment is (of course) not available in the docker context (and for terraform). This could be why it's still failing for me now... Is that a possibility?"}}
{"actor":{"display_login":"markschmid"}}