{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1317","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1317/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1317/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1317/events","html_url":"https://github.com/ansible/ansible-modules-extras/issues/1317","id":119824175,"number":1317,"title":"Cannot create S3 buckets in us-east-1","user":{"login":"edsonmarquezani","id":11199127,"avatar_url":"https://avatars.githubusercontent.com/u/11199127?v=3","gravatar_id":"","url":"https://api.github.com/users/edsonmarquezani","html_url":"https://github.com/edsonmarquezani","followers_url":"https://api.github.com/users/edsonmarquezani/followers","following_url":"https://api.github.com/users/edsonmarquezani/following{/other_user}","gists_url":"https://api.github.com/users/edsonmarquezani/gists{/gist_id}","starred_url":"https://api.github.com/users/edsonmarquezani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsonmarquezani/subscriptions","organizations_url":"https://api.github.com/users/edsonmarquezani/orgs","repos_url":"https://api.github.com/users/edsonmarquezani/repos","events_url":"https://api.github.com/users/edsonmarquezani/events{/privacy}","received_events_url":"https://api.github.com/users/edsonmarquezani/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-01T22:36:03Z","updated_at":"2015-12-07T18:47:49Z","closed_at":"2015-12-07T18:47:49Z","body":"I can't create S3 buckets in *us-east-1* region (US Standard) with *s3_bucket* module. Setting *region* attribute as another region makes it work, but using *us-east-1* throws the following error:\r\n\r\n` <Error><Code>InvalidLocationConstraint</Code><Message>The specified location-constraint is not valid</Message><LocationConstraint>us-east-1</LocationConstraint><RequestId>062E949D00F5D730</RequestId><HostId>fNQfoM+k/ug690XEwWY0MKYlXXOJDHaip6rXLDqfaxKcYJiPSebymIPVVIWYmQ7t</HostId></Error>`\r\n\r\nI know it is from S3 API, which doesn't accept the value *us-east-1*, and if you want to create a bucket in that region, you should omit it. Ok. So, maybe you could blame Boto for it.\r\n\r\nBut, when I don't set a region (not in the task nor environment), I get another error, which I found to be Boto's too.\r\n\r\n`An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: cannot concatenate 'str' and 'NoneType' objects`\r\n\r\nSomehow a null location variable is ending up in this piece of code.\r\n\r\nIn **boto/s3/connection.py**:\r\n\r\n         if location == Location.DEFAULT:\r\n            data = ''\r\n        else:\r\n            data = '<CreateBucketConfiguration><LocationConstraint>' + \\ \r\n                    location + '</LocationConstraint></CreateBucketConfiguration>'\r\n\r\n\r\nI went through Ansible's code, and couldn't understand why this is happening, once it seems to handle that condition.\r\n\r\nIn **ansible/modules/extras/cloud/amazon/s3_bucket.py**:\r\n\r\n    if region in ('us-east-1', '', None):\r\n        # S3ism for the US Standard region\r\n        location = Location.DEFAULT\r\n    else:\r\n        # Boto uses symbolic names for locations but region strings will\r\n        # actually work fine for everything except us-east-1 (US Standard)\r\n        location = region\r\n\r\nSo, is that still a bug, or am I doing something very wrong?\r\n\r\nI'm using the devel branch as for the time of this post and Boto 2.38. I made sure I didn't have an older version of both running here before I filled this bug report. I tried every form of setting the region attribute (with and without quotes, as variable and hardcoded, environment variable). I really can't understand why this is happening.\r\n\r\nI hope you can reproduce it.\r\n\r\nThank you."}}