We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support for the docker lambda runtime
cfn-lint 0.43.0

This is a feature request for supporting docker lambda sam templates.

Please provide as much information as possible:
* SAM templates produced by aws-sam-cli with the docker deploy option don't pass validation

Running on the template.yaml in the base directory outputs the following:
```
% cfn-lint template.yaml                  
E0001 Error transforming template: Resource with id [HelloWorldFunction] is invalid. 'ImageUri' must be set.
template.yaml:1:1

```

Running on the packaged template at `.aws-sam/build/template.yaml` produces the following:
```
E3002 Invalid Property Resources/HelloWorldFunction/Properties/Code/ImageUri
.aws-sam/build/template.yaml:12:3

E3002 Invalid Property Resources/HelloWorldFunction/Properties/PackageType
.aws-sam/build/template.yaml:12:3

E3003 Property Handler missing at Resources/HelloWorldFunction/Properties
.aws-sam/build/template.yaml:12:3

E3003 Property Runtime missing at Resources/HelloWorldFunction/Properties
.aws-sam/build/template.yaml:12:3

```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/cfnlint/transform.py`
Content:
```
1 """
2 Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 SPDX-License-Identifier: MIT-0
4 """
5 import os
6 import logging
7 import six
8 import samtranslator
9 from samtranslator.parser import parser
10 from samtranslator.translator.translator import Translator
11 from samtranslator.public.exceptions import InvalidDocumentException
12 
13 from cfnlint.helpers import load_resource, convert_dict, format_json_string
14 from cfnlint.data import Serverless
15 from cfnlint.rules import Match, TransformError
16 LOGGER = logging.getLogger('cfnlint')
17 
18 samtranslator_logger = logging.getLogger('samtranslator')
19 samtranslator_logger.setLevel(logging.CRITICAL)
20 
21 class Transform(object):
22     """
23     Application Serverless Module tranform Wrapper.
24     Based on code from AWS SAM CLI:
25     https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/commands/validate/lib/sam_template_validator.py
26     """
27 
28     def __init__(self, filename, template, region):
29         """
30         Initialize Transform class
31         """
32         self._filename = filename
33         self._template = template
34         self._region = region
35         self._parameters = {}
36 
37         self._managed_policy_map = self.load_managed_policies()
38         self._sam_parser = parser.Parser()
39 
40     def template(self):
41         """Get the template"""
42         return self._template
43 
44     def load_managed_policies(self):
45         """
46         Load the ManagedPolicies locally, based on the AWS-CLI:
47         https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/lib/samlib/default_managed_policies.json
48         """
49         return load_resource(Serverless, 'ManagedPolicies.json')
50 
51     def _replace_local_codeuri(self):
52         """
53         Replaces the CodeUri in AWS::Serverless::Function and DefinitionUri in
54         AWS::Serverless::Api to a fake S3 Uri. This is to support running the
55         SAM Translator with valid values for these fields. If this is not done,
56         the template is invalid in the eyes of SAM Translator (the translator
57         does not support local paths)
58         """
59 
60         all_resources = self._template.get('Resources', {})
61 
62         template_globals = self._template.get('Globals', {})
63         auto_publish_alias = template_globals.get('Function', {}).get('AutoPublishAlias')
64         if isinstance(auto_publish_alias, dict):
65             if len(auto_publish_alias) == 1:
66                 for k, v in auto_publish_alias.items():
67                     if k == 'Ref':
68                         if v in self._template.get('Parameters'):
69                             self._parameters[v] = 'Alias'
70 
71 
72         for _, resource in all_resources.items():
73 
74             resource_type = resource.get('Type')
75             resource_dict = resource.get('Properties')
76 
77             if resource_type == 'AWS::Serverless::Function':
78 
79                 Transform._update_to_s3_uri('CodeUri', resource_dict)
80                 auto_publish_alias = resource_dict.get('AutoPublishAlias')
81                 if isinstance(auto_publish_alias, dict):
82                     if len(auto_publish_alias) == 1:
83                         for k, v in auto_publish_alias.items():
84                             if k == 'Ref':
85                                 if v in self._template.get('Parameters'):
86                                     self._parameters[v] = 'Alias'
87             if resource_type in ['AWS::Serverless::LayerVersion']:
88                 if resource_dict.get('ContentUri'):
89                     Transform._update_to_s3_uri('ContentUri', resource_dict)
90             if resource_type == 'AWS::Serverless::Application':
91                 if resource_dict.get('Location'):
92                     resource_dict['Location'] = ''
93                     Transform._update_to_s3_uri('Location', resource_dict)
94             if resource_type == 'AWS::Serverless::Api':
95                 if ('DefinitionBody' not in resource_dict and
96                         'Auth' not in resource_dict and 'Cors' not in resource_dict):
97                     Transform._update_to_s3_uri('DefinitionUri', resource_dict)
98                 else:
99                     resource_dict['DefinitionBody'] = ''
100             if resource_type == 'AWS::Serverless::StateMachine' and resource_dict.get('DefinitionUri'):
101                 Transform._update_to_s3_uri('DefinitionUri', resource_dict)
102 
103     def transform_template(self):
104         """
105         Transform the Template using the Serverless Application Model.
106         """
107         matches = []
108 
109         try:
110             # Output the SAM Translator version in debug mode
111             LOGGER.info('SAM Translator: %s', samtranslator.__version__)
112 
113             sam_translator = Translator(
114                 managed_policy_map=self._managed_policy_map,
115                 sam_parser=self._sam_parser)
116 
117             self._replace_local_codeuri()
118 
119             # Tell SAM to use the region we're linting in, this has to be
120             # controlled using the default AWS mechanisms, see also:
121             # https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/translator/arn_generator.py
122             LOGGER.info('Setting AWS_DEFAULT_REGION to %s', self._region)
123             os.environ['AWS_DEFAULT_REGION'] = self._region
124 
125             self._template = convert_dict(
126                 sam_translator.translate(sam_template=self._template,
127                                          parameter_values=self._parameters))
128 
129             LOGGER.info('Transformed template: \n%s',
130                         format_json_string(self._template))
131         except InvalidDocumentException as e:
132             message = 'Error transforming template: {0}'
133             for cause in e.causes:
134                 matches.append(Match(
135                     1, 1,
136                     1, 1,
137                     self._filename,
138                     TransformError(), message.format(cause.message)))
139         except Exception as e:  # pylint: disable=W0703
140             LOGGER.debug('Error transforming template: %s', str(e))
141             LOGGER.debug('Stack trace: %s', e, exc_info=True)
142             message = 'Error transforming template: {0}'
143             matches.append(Match(
144                 1, 1,
145                 1, 1,
146                 self._filename,
147                 TransformError(), message.format(str(e))))
148 
149         return matches
150 
151     @staticmethod
152     def is_s3_uri(uri):
153         """
154         Checks the uri and determines if it is a valid S3 Uri
155         Parameters
156         ----------
157         uri str, required
158             Uri to check
159         Returns
160         -------
161         bool
162             Returns True if the uri given is an S3 uri, otherwise False
163         """
164         return isinstance(uri, six.string_types) and uri.startswith('s3://')
165 
166     @staticmethod
167     def _update_to_s3_uri(
168             property_key, resource_property_dict,
169             s3_uri_value='s3://bucket/value'):
170         """
171         Updates the 'property_key' in the 'resource_property_dict' to the
172         value of 's3_uri_value'
173         Note: The function will mutate the resource_property_dict that is pass
174         in Parameters
175         ----------
176         property_key str, required
177             Key in the resource_property_dict
178         resource_property_dict dict, required
179             Property dictionary of a Resource in the template to replace
180         s3_uri_value str, optional
181             Value to update the value of the property_key to
182         """
183         uri_property = resource_property_dict.get(property_key, '.')
184 
185         # ignore if dict or already an S3 Uri
186         if isinstance(uri_property, dict):
187             if len(uri_property) == 1:
188                 for k in uri_property.keys():
189                     if k == 'Ref':
190                         resource_property_dict[property_key] = s3_uri_value
191             return
192         if Transform.is_s3_uri(uri_property):
193             return
194 
195         resource_property_dict[property_key] = s3_uri_value
196
```
--- 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/src/cfnlint/transform.py b/src/cfnlint/transform.py
--- a/src/cfnlint/transform.py
+++ b/src/cfnlint/transform.py
@@ -76,7 +76,10 @@
 
             if resource_type == 'AWS::Serverless::Function':
 
-                Transform._update_to_s3_uri('CodeUri', resource_dict)
+                if resource_dict.get('PackageType') == 'Image':
+                    Transform._update_to_s3_uri('ImageUri', resource_dict)
+                else:
+                    Transform._update_to_s3_uri('CodeUri', resource_dict)
                 auto_publish_alias = resource_dict.get('AutoPublishAlias')
                 if isinstance(auto_publish_alias, dict):
                     if len(auto_publish_alias) == 1:

{"golden_diff": "diff --git a/src/cfnlint/transform.py b/src/cfnlint/transform.py\n--- a/src/cfnlint/transform.py\n+++ b/src/cfnlint/transform.py\n@@ -76,7 +76,10 @@\n \n             if resource_type == 'AWS::Serverless::Function':\n \n-                Transform._update_to_s3_uri('CodeUri', resource_dict)\n+                if resource_dict.get('PackageType') == 'Image':\n+                    Transform._update_to_s3_uri('ImageUri', resource_dict)\n+                else:\n+                    Transform._update_to_s3_uri('CodeUri', resource_dict)\n                 auto_publish_alias = resource_dict.get('AutoPublishAlias')\n                 if isinstance(auto_publish_alias, dict):\n                     if len(auto_publish_alias) == 1:\n", "issue": "Support for the docker lambda runtime\ncfn-lint 0.43.0\r\n\r\nThis is a feature request for supporting docker lambda sam templates.\r\n\r\nPlease provide as much information as possible:\r\n* SAM templates produced by aws-sam-cli with the docker deploy option don't pass validation\r\n\r\nRunning on the template.yaml in the base directory outputs the following:\r\n```\r\n% cfn-lint template.yaml                  \r\nE0001 Error transforming template: Resource with id [HelloWorldFunction] is invalid. 'ImageUri' must be set.\r\ntemplate.yaml:1:1\r\n\r\n```\r\n\r\nRunning on the packaged template at `.aws-sam/build/template.yaml` produces the following:\r\n```\r\nE3002 Invalid Property Resources/HelloWorldFunction/Properties/Code/ImageUri\r\n.aws-sam/build/template.yaml:12:3\r\n\r\nE3002 Invalid Property Resources/HelloWorldFunction/Properties/PackageType\r\n.aws-sam/build/template.yaml:12:3\r\n\r\nE3003 Property Handler missing at Resources/HelloWorldFunction/Properties\r\n.aws-sam/build/template.yaml:12:3\r\n\r\nE3003 Property Runtime missing at Resources/HelloWorldFunction/Properties\r\n.aws-sam/build/template.yaml:12:3\r\n\r\n```\n", "before_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\nimport os\nimport logging\nimport six\nimport samtranslator\nfrom samtranslator.parser import parser\nfrom samtranslator.translator.translator import Translator\nfrom samtranslator.public.exceptions import InvalidDocumentException\n\nfrom cfnlint.helpers import load_resource, convert_dict, format_json_string\nfrom cfnlint.data import Serverless\nfrom cfnlint.rules import Match, TransformError\nLOGGER = logging.getLogger('cfnlint')\n\nsamtranslator_logger = logging.getLogger('samtranslator')\nsamtranslator_logger.setLevel(logging.CRITICAL)\n\nclass Transform(object):\n    \"\"\"\n    Application Serverless Module tranform Wrapper.\n    Based on code from AWS SAM CLI:\n    https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/commands/validate/lib/sam_template_validator.py\n    \"\"\"\n\n    def __init__(self, filename, template, region):\n        \"\"\"\n        Initialize Transform class\n        \"\"\"\n        self._filename = filename\n        self._template = template\n        self._region = region\n        self._parameters = {}\n\n        self._managed_policy_map = self.load_managed_policies()\n        self._sam_parser = parser.Parser()\n\n    def template(self):\n        \"\"\"Get the template\"\"\"\n        return self._template\n\n    def load_managed_policies(self):\n        \"\"\"\n        Load the ManagedPolicies locally, based on the AWS-CLI:\n        https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/lib/samlib/default_managed_policies.json\n        \"\"\"\n        return load_resource(Serverless, 'ManagedPolicies.json')\n\n    def _replace_local_codeuri(self):\n        \"\"\"\n        Replaces the CodeUri in AWS::Serverless::Function and DefinitionUri in\n        AWS::Serverless::Api to a fake S3 Uri. This is to support running the\n        SAM Translator with valid values for these fields. If this is not done,\n        the template is invalid in the eyes of SAM Translator (the translator\n        does not support local paths)\n        \"\"\"\n\n        all_resources = self._template.get('Resources', {})\n\n        template_globals = self._template.get('Globals', {})\n        auto_publish_alias = template_globals.get('Function', {}).get('AutoPublishAlias')\n        if isinstance(auto_publish_alias, dict):\n            if len(auto_publish_alias) == 1:\n                for k, v in auto_publish_alias.items():\n                    if k == 'Ref':\n                        if v in self._template.get('Parameters'):\n                            self._parameters[v] = 'Alias'\n\n\n        for _, resource in all_resources.items():\n\n            resource_type = resource.get('Type')\n            resource_dict = resource.get('Properties')\n\n            if resource_type == 'AWS::Serverless::Function':\n\n                Transform._update_to_s3_uri('CodeUri', resource_dict)\n                auto_publish_alias = resource_dict.get('AutoPublishAlias')\n                if isinstance(auto_publish_alias, dict):\n                    if len(auto_publish_alias) == 1:\n                        for k, v in auto_publish_alias.items():\n                            if k == 'Ref':\n                                if v in self._template.get('Parameters'):\n                                    self._parameters[v] = 'Alias'\n            if resource_type in ['AWS::Serverless::LayerVersion']:\n                if resource_dict.get('ContentUri'):\n                    Transform._update_to_s3_uri('ContentUri', resource_dict)\n            if resource_type == 'AWS::Serverless::Application':\n                if resource_dict.get('Location'):\n                    resource_dict['Location'] = ''\n                    Transform._update_to_s3_uri('Location', resource_dict)\n            if resource_type == 'AWS::Serverless::Api':\n                if ('DefinitionBody' not in resource_dict and\n                        'Auth' not in resource_dict and 'Cors' not in resource_dict):\n                    Transform._update_to_s3_uri('DefinitionUri', resource_dict)\n                else:\n                    resource_dict['DefinitionBody'] = ''\n            if resource_type == 'AWS::Serverless::StateMachine' and resource_dict.get('DefinitionUri'):\n                Transform._update_to_s3_uri('DefinitionUri', resource_dict)\n\n    def transform_template(self):\n        \"\"\"\n        Transform the Template using the Serverless Application Model.\n        \"\"\"\n        matches = []\n\n        try:\n            # Output the SAM Translator version in debug mode\n            LOGGER.info('SAM Translator: %s', samtranslator.__version__)\n\n            sam_translator = Translator(\n                managed_policy_map=self._managed_policy_map,\n                sam_parser=self._sam_parser)\n\n            self._replace_local_codeuri()\n\n            # Tell SAM to use the region we're linting in, this has to be\n            # controlled using the default AWS mechanisms, see also:\n            # https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/translator/arn_generator.py\n            LOGGER.info('Setting AWS_DEFAULT_REGION to %s', self._region)\n            os.environ['AWS_DEFAULT_REGION'] = self._region\n\n            self._template = convert_dict(\n                sam_translator.translate(sam_template=self._template,\n                                         parameter_values=self._parameters))\n\n            LOGGER.info('Transformed template: \\n%s',\n                        format_json_string(self._template))\n        except InvalidDocumentException as e:\n            message = 'Error transforming template: {0}'\n            for cause in e.causes:\n                matches.append(Match(\n                    1, 1,\n                    1, 1,\n                    self._filename,\n                    TransformError(), message.format(cause.message)))\n        except Exception as e:  # pylint: disable=W0703\n            LOGGER.debug('Error transforming template: %s', str(e))\n            LOGGER.debug('Stack trace: %s', e, exc_info=True)\n            message = 'Error transforming template: {0}'\n            matches.append(Match(\n                1, 1,\n                1, 1,\n                self._filename,\n                TransformError(), message.format(str(e))))\n\n        return matches\n\n    @staticmethod\n    def is_s3_uri(uri):\n        \"\"\"\n        Checks the uri and determines if it is a valid S3 Uri\n        Parameters\n        ----------\n        uri str, required\n            Uri to check\n        Returns\n        -------\n        bool\n            Returns True if the uri given is an S3 uri, otherwise False\n        \"\"\"\n        return isinstance(uri, six.string_types) and uri.startswith('s3://')\n\n    @staticmethod\n    def _update_to_s3_uri(\n            property_key, resource_property_dict,\n            s3_uri_value='s3://bucket/value'):\n        \"\"\"\n        Updates the 'property_key' in the 'resource_property_dict' to the\n        value of 's3_uri_value'\n        Note: The function will mutate the resource_property_dict that is pass\n        in Parameters\n        ----------\n        property_key str, required\n            Key in the resource_property_dict\n        resource_property_dict dict, required\n            Property dictionary of a Resource in the template to replace\n        s3_uri_value str, optional\n            Value to update the value of the property_key to\n        \"\"\"\n        uri_property = resource_property_dict.get(property_key, '.')\n\n        # ignore if dict or already an S3 Uri\n        if isinstance(uri_property, dict):\n            if len(uri_property) == 1:\n                for k in uri_property.keys():\n                    if k == 'Ref':\n                        resource_property_dict[property_key] = s3_uri_value\n            return\n        if Transform.is_s3_uri(uri_property):\n            return\n\n        resource_property_dict[property_key] = s3_uri_value\n", "path": "src/cfnlint/transform.py"}], "after_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\nimport os\nimport logging\nimport six\nimport samtranslator\nfrom samtranslator.parser import parser\nfrom samtranslator.translator.translator import Translator\nfrom samtranslator.public.exceptions import InvalidDocumentException\n\nfrom cfnlint.helpers import load_resource, convert_dict, format_json_string\nfrom cfnlint.data import Serverless\nfrom cfnlint.rules import Match, TransformError\nLOGGER = logging.getLogger('cfnlint')\n\nsamtranslator_logger = logging.getLogger('samtranslator')\nsamtranslator_logger.setLevel(logging.CRITICAL)\n\nclass Transform(object):\n    \"\"\"\n    Application Serverless Module tranform Wrapper.\n    Based on code from AWS SAM CLI:\n    https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/commands/validate/lib/sam_template_validator.py\n    \"\"\"\n\n    def __init__(self, filename, template, region):\n        \"\"\"\n        Initialize Transform class\n        \"\"\"\n        self._filename = filename\n        self._template = template\n        self._region = region\n        self._parameters = {}\n\n        self._managed_policy_map = self.load_managed_policies()\n        self._sam_parser = parser.Parser()\n\n    def template(self):\n        \"\"\"Get the template\"\"\"\n        return self._template\n\n    def load_managed_policies(self):\n        \"\"\"\n        Load the ManagedPolicies locally, based on the AWS-CLI:\n        https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/lib/samlib/default_managed_policies.json\n        \"\"\"\n        return load_resource(Serverless, 'ManagedPolicies.json')\n\n    def _replace_local_codeuri(self):\n        \"\"\"\n        Replaces the CodeUri in AWS::Serverless::Function and DefinitionUri in\n        AWS::Serverless::Api to a fake S3 Uri. This is to support running the\n        SAM Translator with valid values for these fields. If this is not done,\n        the template is invalid in the eyes of SAM Translator (the translator\n        does not support local paths)\n        \"\"\"\n\n        all_resources = self._template.get('Resources', {})\n\n        template_globals = self._template.get('Globals', {})\n        auto_publish_alias = template_globals.get('Function', {}).get('AutoPublishAlias')\n        if isinstance(auto_publish_alias, dict):\n            if len(auto_publish_alias) == 1:\n                for k, v in auto_publish_alias.items():\n                    if k == 'Ref':\n                        if v in self._template.get('Parameters'):\n                            self._parameters[v] = 'Alias'\n\n\n        for _, resource in all_resources.items():\n\n            resource_type = resource.get('Type')\n            resource_dict = resource.get('Properties')\n\n            if resource_type == 'AWS::Serverless::Function':\n\n                if resource_dict.get('PackageType') == 'Image':\n                    Transform._update_to_s3_uri('ImageUri', resource_dict)\n                else:\n                    Transform._update_to_s3_uri('CodeUri', resource_dict)\n                auto_publish_alias = resource_dict.get('AutoPublishAlias')\n                if isinstance(auto_publish_alias, dict):\n                    if len(auto_publish_alias) == 1:\n                        for k, v in auto_publish_alias.items():\n                            if k == 'Ref':\n                                if v in self._template.get('Parameters'):\n                                    self._parameters[v] = 'Alias'\n            if resource_type in ['AWS::Serverless::LayerVersion']:\n                if resource_dict.get('ContentUri'):\n                    Transform._update_to_s3_uri('ContentUri', resource_dict)\n            if resource_type == 'AWS::Serverless::Application':\n                if resource_dict.get('Location'):\n                    resource_dict['Location'] = ''\n                    Transform._update_to_s3_uri('Location', resource_dict)\n            if resource_type == 'AWS::Serverless::Api':\n                if ('DefinitionBody' not in resource_dict and\n                        'Auth' not in resource_dict and 'Cors' not in resource_dict):\n                    Transform._update_to_s3_uri('DefinitionUri', resource_dict)\n                else:\n                    resource_dict['DefinitionBody'] = ''\n            if resource_type == 'AWS::Serverless::StateMachine' and resource_dict.get('DefinitionUri'):\n                Transform._update_to_s3_uri('DefinitionUri', resource_dict)\n\n    def transform_template(self):\n        \"\"\"\n        Transform the Template using the Serverless Application Model.\n        \"\"\"\n        matches = []\n\n        try:\n            # Output the SAM Translator version in debug mode\n            LOGGER.info('SAM Translator: %s', samtranslator.__version__)\n\n            sam_translator = Translator(\n                managed_policy_map=self._managed_policy_map,\n                sam_parser=self._sam_parser)\n\n            self._replace_local_codeuri()\n\n            # Tell SAM to use the region we're linting in, this has to be\n            # controlled using the default AWS mechanisms, see also:\n            # https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/translator/arn_generator.py\n            LOGGER.info('Setting AWS_DEFAULT_REGION to %s', self._region)\n            os.environ['AWS_DEFAULT_REGION'] = self._region\n\n            self._template = convert_dict(\n                sam_translator.translate(sam_template=self._template,\n                                         parameter_values=self._parameters))\n\n            LOGGER.info('Transformed template: \\n%s',\n                        format_json_string(self._template))\n        except InvalidDocumentException as e:\n            message = 'Error transforming template: {0}'\n            for cause in e.causes:\n                matches.append(Match(\n                    1, 1,\n                    1, 1,\n                    self._filename,\n                    TransformError(), message.format(cause.message)))\n        except Exception as e:  # pylint: disable=W0703\n            LOGGER.debug('Error transforming template: %s', str(e))\n            LOGGER.debug('Stack trace: %s', e, exc_info=True)\n            message = 'Error transforming template: {0}'\n            matches.append(Match(\n                1, 1,\n                1, 1,\n                self._filename,\n                TransformError(), message.format(str(e))))\n\n        return matches\n\n    @staticmethod\n    def is_s3_uri(uri):\n        \"\"\"\n        Checks the uri and determines if it is a valid S3 Uri\n        Parameters\n        ----------\n        uri str, required\n            Uri to check\n        Returns\n        -------\n        bool\n            Returns True if the uri given is an S3 uri, otherwise False\n        \"\"\"\n        return isinstance(uri, six.string_types) and uri.startswith('s3://')\n\n    @staticmethod\n    def _update_to_s3_uri(\n            property_key, resource_property_dict,\n            s3_uri_value='s3://bucket/value'):\n        \"\"\"\n        Updates the 'property_key' in the 'resource_property_dict' to the\n        value of 's3_uri_value'\n        Note: The function will mutate the resource_property_dict that is pass\n        in Parameters\n        ----------\n        property_key str, required\n            Key in the resource_property_dict\n        resource_property_dict dict, required\n            Property dictionary of a Resource in the template to replace\n        s3_uri_value str, optional\n            Value to update the value of the property_key to\n        \"\"\"\n        uri_property = resource_property_dict.get(property_key, '.')\n\n        # ignore if dict or already an S3 Uri\n        if isinstance(uri_property, dict):\n            if len(uri_property) == 1:\n                for k in uri_property.keys():\n                    if k == 'Ref':\n                        resource_property_dict[property_key] = s3_uri_value\n            return\n        if Transform.is_s3_uri(uri_property):\n            return\n\n        resource_property_dict[property_key] = s3_uri_value\n", "path": "src/cfnlint/transform.py"}]}