We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Region from Env Vars or profile are not respected for ALL commands but package and deploy
The region option in SAM CLI was changed between 0.7.0 and 0.8.0 to add the default explicitly on the [command line option](https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/cli/options.py#L44). This causes the region to always be set and not allow boto3 to do its resolving of credentials and regions, which is used to set the correct values into the docker container.

Current workaround is to explicitly set the region when invoking a function or interacting with commands that interact with AWS Services.

Fix is in #811

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `samcli/cli/options.py`
Content:
```
1 """
2 This file contains common CLI options common to all commands. As we add more commands, this will
3 become a repository of options that other commands could use when needed.
4 """
5 
6 import click
7 
8 from .context import Context
9 
10 
11 def debug_option(f):
12     """
13     Configures --debug option for CLI
14 
15     :param f: Callback Function to be passed to Click
16     """
17     def callback(ctx, param, value):
18         state = ctx.ensure_object(Context)
19         state.debug = value
20         return value
21 
22     return click.option('--debug',
23                         expose_value=False,
24                         is_flag=True,
25                         envvar="SAM_DEBUG",
26                         help='Turn on debug logging to print debug message generated by SAM CLI.',
27                         callback=callback)(f)
28 
29 
30 def region_option(f):
31     """
32     Configures --region option for CLI
33 
34     :param f: Callback Function to be passed to Click
35     """
36     def callback(ctx, param, value):
37         state = ctx.ensure_object(Context)
38         state.region = value
39         return value
40 
41     return click.option('--region',
42                         expose_value=False,
43                         help='Set the AWS Region of the service (e.g. us-east-1).',
44                         default='us-east-1',
45                         callback=callback)(f)
46 
47 
48 def profile_option(f):
49     """
50     Configures --profile option for CLI
51 
52     :param f: Callback Function to be passed to Click
53     """
54     def callback(ctx, param, value):
55         state = ctx.ensure_object(Context)
56         state.profile = value
57         return value
58 
59     return click.option('--profile',
60                         expose_value=False,
61                         help='Select a specific profile from your credential file to get AWS credentials.',
62                         callback=callback)(f)
63
```

Path: `samcli/__init__.py`
Content:
```
1 """
2 SAM CLI version
3 """
4 
5 __version__ = '0.8.0'
6
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/samcli/__init__.py b/samcli/__init__.py
--- a/samcli/__init__.py
+++ b/samcli/__init__.py
@@ -2,4 +2,4 @@
 SAM CLI version
 """
 
-__version__ = '0.8.0'
+__version__ = '0.8.1'
diff --git a/samcli/cli/options.py b/samcli/cli/options.py
--- a/samcli/cli/options.py
+++ b/samcli/cli/options.py
@@ -41,7 +41,6 @@
     return click.option('--region',
                         expose_value=False,
                         help='Set the AWS Region of the service (e.g. us-east-1).',
-                        default='us-east-1',
                         callback=callback)(f)

{"golden_diff": "diff --git a/samcli/__init__.py b/samcli/__init__.py\n--- a/samcli/__init__.py\n+++ b/samcli/__init__.py\n@@ -2,4 +2,4 @@\n SAM CLI version\n \"\"\"\n \n-__version__ = '0.8.0'\n+__version__ = '0.8.1'\ndiff --git a/samcli/cli/options.py b/samcli/cli/options.py\n--- a/samcli/cli/options.py\n+++ b/samcli/cli/options.py\n@@ -41,7 +41,6 @@\n     return click.option('--region',\n                         expose_value=False,\n                         help='Set the AWS Region of the service (e.g. us-east-1).',\n-                        default='us-east-1',\n                         callback=callback)(f)\n", "issue": "Region from Env Vars or profile are not respected for ALL commands but package and deploy\nThe region option in SAM CLI was changed between 0.7.0 and 0.8.0 to add the default explicitly on the [command line option](https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/cli/options.py#L44). This causes the region to always be set and not allow boto3 to do its resolving of credentials and regions, which is used to set the correct values into the docker container.\r\n\r\nCurrent workaround is to explicitly set the region when invoking a function or interacting with commands that interact with AWS Services.\r\n\r\nFix is in #811\n", "before_files": [{"content": "\"\"\"\nThis file contains common CLI options common to all commands. As we add more commands, this will\nbecome a repository of options that other commands could use when needed.\n\"\"\"\n\nimport click\n\nfrom .context import Context\n\n\ndef debug_option(f):\n    \"\"\"\n    Configures --debug option for CLI\n\n    :param f: Callback Function to be passed to Click\n    \"\"\"\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(Context)\n        state.debug = value\n        return value\n\n    return click.option('--debug',\n                        expose_value=False,\n                        is_flag=True,\n                        envvar=\"SAM_DEBUG\",\n                        help='Turn on debug logging to print debug message generated by SAM CLI.',\n                        callback=callback)(f)\n\n\ndef region_option(f):\n    \"\"\"\n    Configures --region option for CLI\n\n    :param f: Callback Function to be passed to Click\n    \"\"\"\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(Context)\n        state.region = value\n        return value\n\n    return click.option('--region',\n                        expose_value=False,\n                        help='Set the AWS Region of the service (e.g. us-east-1).',\n                        default='us-east-1',\n                        callback=callback)(f)\n\n\ndef profile_option(f):\n    \"\"\"\n    Configures --profile option for CLI\n\n    :param f: Callback Function to be passed to Click\n    \"\"\"\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(Context)\n        state.profile = value\n        return value\n\n    return click.option('--profile',\n                        expose_value=False,\n                        help='Select a specific profile from your credential file to get AWS credentials.',\n                        callback=callback)(f)\n", "path": "samcli/cli/options.py"}, {"content": "\"\"\"\nSAM CLI version\n\"\"\"\n\n__version__ = '0.8.0'\n", "path": "samcli/__init__.py"}], "after_files": [{"content": "\"\"\"\nThis file contains common CLI options common to all commands. As we add more commands, this will\nbecome a repository of options that other commands could use when needed.\n\"\"\"\n\nimport click\n\nfrom .context import Context\n\n\ndef debug_option(f):\n    \"\"\"\n    Configures --debug option for CLI\n\n    :param f: Callback Function to be passed to Click\n    \"\"\"\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(Context)\n        state.debug = value\n        return value\n\n    return click.option('--debug',\n                        expose_value=False,\n                        is_flag=True,\n                        envvar=\"SAM_DEBUG\",\n                        help='Turn on debug logging to print debug message generated by SAM CLI.',\n                        callback=callback)(f)\n\n\ndef region_option(f):\n    \"\"\"\n    Configures --region option for CLI\n\n    :param f: Callback Function to be passed to Click\n    \"\"\"\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(Context)\n        state.region = value\n        return value\n\n    return click.option('--region',\n                        expose_value=False,\n                        help='Set the AWS Region of the service (e.g. us-east-1).',\n                        callback=callback)(f)\n\n\ndef profile_option(f):\n    \"\"\"\n    Configures --profile option for CLI\n\n    :param f: Callback Function to be passed to Click\n    \"\"\"\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(Context)\n        state.profile = value\n        return value\n\n    return click.option('--profile',\n                        expose_value=False,\n                        help='Select a specific profile from your credential file to get AWS credentials.',\n                        callback=callback)(f)\n", "path": "samcli/cli/options.py"}, {"content": "\"\"\"\nSAM CLI version\n\"\"\"\n\n__version__ = '0.8.1'\n", "path": "samcli/__init__.py"}]}