Repository: aws/aws-sam-cli

Issue:
Feature request: Add AWS_LAMBDA_INITIALIZATION_TYPE environment variable
<!-- Make sure we don't have an existing Issue for the feature you are requesting (both open and closed). -->

### Describe your idea/feature/enhancement

According to the [official AWS documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html) there is a environment variable named `AWS_LAMBDA_INITIALIZATION_TYPE` that can contains following values: `on-demand`, `provisioned-concurrency`, or `snap-start`. Since SAM is intended to emulate Lambda in local environment, so, its good if SAM can include this env var with the value `on-demand`, for example. 

### Proposal

Add this environment variable.

Discussion:

Patch:
diff --git a/samcli/local/lambdafn/env_vars.py b/samcli/local/lambdafn/env_vars.py
index ebf52ce5..87d0ae28 100644
--- a/samcli/local/lambdafn/env_vars.py
+++ b/samcli/local/lambdafn/env_vars.py
@@ -176,6 +176,7 @@ class EnvironmentVariables:
             "AWS_ACCESS_KEY_ID": self.aws_creds.get("key", self._DEFAULT_AWS_CREDS["key"]),
             "AWS_SECRET_ACCESS_KEY": self.aws_creds.get("secret", self._DEFAULT_AWS_CREDS["secret"]),
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
         }
 
         # Session Token should be added **only** if the input creds have a token and the value is not empty.


Test patch:
diff --git a/tests/unit/local/lambdafn/test_env_vars.py b/tests/unit/local/lambdafn/test_env_vars.py
index f831bfe6..4259028d 100644
--- a/tests/unit/local/lambdafn/test_env_vars.py
+++ b/tests/unit/local/lambdafn/test_env_vars.py
@@ -122,6 +122,7 @@ class TestEnvironmentVariables_resolve(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             "AWS_REGION": "some region",
             "AWS_DEFAULT_REGION": "some region",
             "AWS_ACCESS_KEY_ID": "some key",
@@ -151,6 +152,7 @@ class TestEnvironmentVariables_resolve(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             "AWS_REGION": "us-east-1",
             "AWS_ACCESS_KEY_ID": "defaultkey",
             "AWS_SECRET_ACCESS_KEY": "defaultsecret",
@@ -184,6 +186,7 @@ class TestEnvironmentVariables_resolve(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             "AWS_REGION": "us-east-1",
             "AWS_ACCESS_KEY_ID": "defaultkey",
             "AWS_SECRET_ACCESS_KEY": "defaultsecret",
@@ -225,6 +228,7 @@ class TestEnvironmentVariables_resolve(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             "AWS_REGION": "us-east-1",
             "AWS_ACCESS_KEY_ID": "defaultkey",
             "AWS_SECRET_ACCESS_KEY": "defaultsecret",
@@ -282,6 +286,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             "AWS_SESSION_TOKEN": "some other token",
         }
 
@@ -300,6 +305,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             # Default values assigned to these variables
             "AWS_REGION": "us-east-1",
             "AWS_DEFAULT_REGION": "us-east-1",
@@ -323,6 +329,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             # Values from the input creds
             "AWS_REGION": "some other region",
             "AWS_DEFAULT_REGION": "some other region",
@@ -346,6 +353,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             # Default values assigned to these variables
             "AWS_REGION": "us-east-1",
             "AWS_DEFAULT_REGION": "us-east-1",
@@ -369,6 +377,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             # Default values assigned to these variables
             "AWS_REGION": "us-east-1",
             "AWS_DEFAULT_REGION": "us-east-1",
@@ -393,6 +402,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             # Default values assigned to these variables
             "AWS_REGION": "us-east-1",
             "AWS_DEFAULT_REGION": "us-east-1",
@@ -417,6 +427,7 @@ class TestEnvironmentVariables_get_aws_variables(TestCase):
             "AWS_LAMBDA_LOG_GROUP_NAME": "myCustomLogGroup",
             "AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
             "AWS_ACCOUNT_ID": "123456789012",
+            "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
             # Default values assigned to these variables
             "AWS_REGION": "us-east-1",
             "AWS_DEFAULT_REGION": "us-east-1",