{"action":"created","issue":{"url":"https://api.github.com/repos/boto/boto3/issues/422","labels_url":"https://api.github.com/repos/boto/boto3/issues/422/labels{/name}","comments_url":"https://api.github.com/repos/boto/boto3/issues/422/comments","events_url":"https://api.github.com/repos/boto/boto3/issues/422/events","html_url":"https://github.com/boto/boto3/issues/422","id":124262696,"number":422,"title":"boto3 help with resources not available","user":{"login":"brianbruggeman","id":1350114,"avatar_url":"https://avatars.githubusercontent.com/u/1350114?v=3","gravatar_id":"","url":"https://api.github.com/users/brianbruggeman","html_url":"https://github.com/brianbruggeman","followers_url":"https://api.github.com/users/brianbruggeman/followers","following_url":"https://api.github.com/users/brianbruggeman/following{/other_user}","gists_url":"https://api.github.com/users/brianbruggeman/gists{/gist_id}","starred_url":"https://api.github.com/users/brianbruggeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianbruggeman/subscriptions","organizations_url":"https://api.github.com/users/brianbruggeman/orgs","repos_url":"https://api.github.com/users/brianbruggeman/repos","events_url":"https://api.github.com/users/brianbruggeman/events{/privacy}","received_events_url":"https://api.github.com/users/brianbruggeman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-29T20:17:59Z","updated_at":"2015-12-30T04:49:18Z","closed_at":null,"body":"I have some python code:\r\n\r\n    import boto3\r\n    import boto.ec2\r\n\r\n    def connect(**options):\r\n        aws_key = options.get('aws_key')\r\n        aws_secret = options.get('aws_secret')\r\n        region = options.get('region')\r\n\r\n        session = boto3.Session(aws_access_key_id=aws_key, was_secret_access_key=aws_secret, region_name=region)\r\n\r\n        # this fails\r\n        boto3_ec2 = session.get_resource('ec2')\r\n        # session.get_available_resources()  is []\r\n             \r\n        # this succeeds\r\n        ec2 = boto.ec2.connect_to_region(region, aws_access_key_id=aws_key, aws_secret_access_key=aws_secret)\r\n\r\n\r\nMy question:  What am I doing wrong with boto3?  At the moment boto3 is a non-starter for me."},"comment":{"url":"https://api.github.com/repos/boto/boto3/issues/comments/167936106","html_url":"https://github.com/boto/boto3/issues/422#issuecomment-167936106","issue_url":"https://api.github.com/repos/boto/boto3/issues/422","id":167936106,"user":{"login":"Mause","id":1405026,"avatar_url":"https://avatars.githubusercontent.com/u/1405026?v=3","gravatar_id":"","url":"https://api.github.com/users/Mause","html_url":"https://github.com/Mause","followers_url":"https://api.github.com/users/Mause/followers","following_url":"https://api.github.com/users/Mause/following{/other_user}","gists_url":"https://api.github.com/users/Mause/gists{/gist_id}","starred_url":"https://api.github.com/users/Mause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mause/subscriptions","organizations_url":"https://api.github.com/users/Mause/orgs","repos_url":"https://api.github.com/users/Mause/repos","events_url":"https://api.github.com/users/Mause/events{/privacy}","received_events_url":"https://api.github.com/users/Mause/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T04:49:18Z","updated_at":"2015-12-30T04:49:18Z","body":"Corrected the argument name to `boto3.Session`, corrected function name (`get_resource` to `resource`), added region argument. It works.\r\n```py\r\nimport boto3\r\nimport boto.ec2\r\n\r\ndef connect(**options):\r\n    aws_key = options.get('aws_key')\r\n    aws_secret = options.get('aws_secret')\r\n    region = options.get('region')\r\n\r\n    session = boto3.Session(aws_access_key_id=aws_key, aws_secret_access_key=aws_secret, region_name=region)\r\n\r\n    # this fails (no more)\r\n    boto3_ec2 = session.resource('ec2', region)\r\n    # session.get_available_resources()  is []\r\n\r\n    # this succeeds\r\n    ec2 = boto.ec2.connect_to_region(\r\n        region,\r\n        aws_access_key_id=aws_key,\r\n        aws_secret_access_key=aws_secret\r\n    )\r\n```"}}