{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kops/issues/4451","repository_url":"https://api.github.com/repos/kubernetes/kops","labels_url":"https://api.github.com/repos/kubernetes/kops/issues/4451/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kops/issues/4451/comments","events_url":"https://api.github.com/repos/kubernetes/kops/issues/4451/events","html_url":"https://github.com/kubernetes/kops/issues/4451","id":297731484,"number":4451,"title":"kops requires environment variable AWS_REGION to be set","user":{"login":"iMartyn","id":962908,"avatar_url":"https://avatars0.githubusercontent.com/u/962908?v=4","gravatar_id":"","url":"https://api.github.com/users/iMartyn","html_url":"https://github.com/iMartyn","followers_url":"https://api.github.com/users/iMartyn/followers","following_url":"https://api.github.com/users/iMartyn/following{/other_user}","gists_url":"https://api.github.com/users/iMartyn/gists{/gist_id}","starred_url":"https://api.github.com/users/iMartyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iMartyn/subscriptions","organizations_url":"https://api.github.com/users/iMartyn/orgs","repos_url":"https://api.github.com/users/iMartyn/repos","events_url":"https://api.github.com/users/iMartyn/events{/privacy}","received_events_url":"https://api.github.com/users/iMartyn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-16T09:58:06Z","updated_at":"2018-03-01T16:43:27Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"1. What `kops` version are you running? The command `kops version`, will display\r\n this information.\r\nVersion 1.8.0 (git-5099bc5) but also reproduced on master\r\n\r\n2. What Kubernetes version are you running? `kubectl version` will print the\r\n version if a cluster is running or provide the Kubernetes version specified as\r\n a `kops` flag.\r\nClient Version: version.Info{Major:\"1\", Minor:\"10+\", GitVersion:\"v1.10.0-alpha.1\", GitCommit:\"4956e65d5926c02840cc0854d423ac31af29065f\", GitTreeState:\"clean\", BuildDate:\"2017-12-18T21:03:10Z\", GoVersion:\"go1.9.2\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"8\", GitVersion:\"v1.8.7\", GitCommit:\"b30876a5539f09684ff9fde266fda10b37738c9c\", GitTreeState:\"clean\", BuildDate:\"2018-01-16T21:52:38Z\", GoVersion:\"go1.8.3\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n\r\n3. What cloud provider are you using?\r\nAWS\r\n\r\n4. What commands did you run?  What is the simplest way to reproduce this issue?\r\n```\r\nexport KOPS_STATE_S3_ACL=bucket-owner-full-control\r\nexport KOPS_STATE_STORE=s3://some-kops-state/\r\nexport AWS_PROFILE=staging_k8s_account\r\nexport AWS_DEFAULT_PROFILE=staging_k8s_account\r\nexport AWS_SDK_LOAD_CONFIG=1\r\nkops update cluster --target=terraform --out=some_dir/ --name thecluster.name.com\r\ngrep AWS_REGION some_dir/terraform/data/aws_launch_configuration_master-eu-west-1a.masters.thecluster.name.com_user_data\r\n```\r\n\r\n5. What happened after the commands executed?\r\nThere is no output from the grep\r\n\r\n6. What did you expect to happen?\r\nThe userdata should have AWS_REGION=eu-west-1 in the config as that is default in my ~/.aws/config file.\r\nThe lack of this causes nodeup to have to brute force the region for the s3 bucket which requires the `ec2:DescribeRegion` permission.  Whilst that permission is going to default into kops, that's still inefficient and what really bugs me is that creating terraform from the cluster yaml on different machines results in different terraform (this to me is a no-no).\r\n\r\n7. Please provide your cluster manifest. \r\nI don't think this is relevant to this bug as the codepath for checking the AWS_REGION env var is not related to loading the cluster yaml"},"comment":{"url":"https://api.github.com/repos/kubernetes/kops/issues/comments/369653261","html_url":"https://github.com/kubernetes/kops/issues/4451#issuecomment-369653261","issue_url":"https://api.github.com/repos/kubernetes/kops/issues/4451","id":369653261,"user":{"login":"itskingori","id":703786,"avatar_url":"https://avatars2.githubusercontent.com/u/703786?v=4","gravatar_id":"","url":"https://api.github.com/users/itskingori","html_url":"https://github.com/itskingori","followers_url":"https://api.github.com/users/itskingori/followers","following_url":"https://api.github.com/users/itskingori/following{/other_user}","gists_url":"https://api.github.com/users/itskingori/gists{/gist_id}","starred_url":"https://api.github.com/users/itskingori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itskingori/subscriptions","organizations_url":"https://api.github.com/users/itskingori/orgs","repos_url":"https://api.github.com/users/itskingori/repos","events_url":"https://api.github.com/users/itskingori/events{/privacy}","received_events_url":"https://api.github.com/users/itskingori/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T16:43:27Z","updated_at":"2018-03-01T16:43:27Z","author_association":"MEMBER","body":"@iMartyn agreed!"}}
{"actor":{"display_login":"itskingori"}}