{"action":"created","issue":{"url":"https://api.github.com/repos/beelit94/python-terraform/issues/35","repository_url":"https://api.github.com/repos/beelit94/python-terraform","labels_url":"https://api.github.com/repos/beelit94/python-terraform/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/beelit94/python-terraform/issues/35/comments","events_url":"https://api.github.com/repos/beelit94/python-terraform/issues/35/events","html_url":"https://github.com/beelit94/python-terraform/issues/35","id":298358841,"number":35,"title":"output to text file or to sdout","user":{"login":"dragan979","id":29802460,"avatar_url":"https://avatars1.githubusercontent.com/u/29802460?v=4","gravatar_id":"","url":"https://api.github.com/users/dragan979","html_url":"https://github.com/dragan979","followers_url":"https://api.github.com/users/dragan979/followers","following_url":"https://api.github.com/users/dragan979/following{/other_user}","gists_url":"https://api.github.com/users/dragan979/gists{/gist_id}","starred_url":"https://api.github.com/users/dragan979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragan979/subscriptions","organizations_url":"https://api.github.com/users/dragan979/orgs","repos_url":"https://api.github.com/users/dragan979/repos","events_url":"https://api.github.com/users/dragan979/events{/privacy}","received_events_url":"https://api.github.com/users/dragan979/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-19T17:51:18Z","updated_at":"2018-02-19T22:51:20Z","closed_at":null,"author_association":"NONE","body":"i couldn't find from closes and opened issues:\r\ni created output.tf to get instance IP\r\n how to pipe tf.output() to text file ?"},"comment":{"url":"https://api.github.com/repos/beelit94/python-terraform/issues/comments/366821232","html_url":"https://github.com/beelit94/python-terraform/issues/35#issuecomment-366821232","issue_url":"https://api.github.com/repos/beelit94/python-terraform/issues/35","id":366821232,"user":{"login":"dragan979","id":29802460,"avatar_url":"https://avatars1.githubusercontent.com/u/29802460?v=4","gravatar_id":"","url":"https://api.github.com/users/dragan979","html_url":"https://github.com/dragan979","followers_url":"https://api.github.com/users/dragan979/followers","following_url":"https://api.github.com/users/dragan979/following{/other_user}","gists_url":"https://api.github.com/users/dragan979/gists{/gist_id}","starred_url":"https://api.github.com/users/dragan979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragan979/subscriptions","organizations_url":"https://api.github.com/users/dragan979/orgs","repos_url":"https://api.github.com/users/dragan979/repos","events_url":"https://api.github.com/users/dragan979/events{/privacy}","received_events_url":"https://api.github.com/users/dragan979/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T22:51:20Z","updated_at":"2018-02-19T22:51:20Z","author_association":"NONE","body":"thanks, meanwhile i found a workaround, search tfstate file and extract IP, then write it to txt file\r\n\r\n```\r\nfinal2=os.path.join(final_path,'terraform.tfstate')\r\n    json_data=open(final2)\r\n    data1 = json.load(json_data)\r\n    json_data.close()\r\n    filename=\"/home/ja/terraform-course/demo-2b/\"+user+\".txt\"\r\n    print(filename)\r\n    for i in range (0, len (data1['modules'])):\r\n     ip=','.join(data1['modules'][i]['outputs']['id']['value'])\r\n    sys.stdout = open(filename,'wt')\r\n    print(\"Username is:\"+\" \"+ user+\".Password is Passw0rd01234.IP addrress is:\"+ip)\r\n\r\n```"}}
{"actor":{"display_login":"dragan979"}}