def construct_s3_location_object(location_uri, logical_id, property_name):
if isinstance(location_uri, dict):<EOL><INDENT>if not location_uri.get("<STR_LIT>") or not location_uri.get("<STR_LIT>"):<EOL><INDENT>raise InvalidResourceException(logical_id,<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(property_name))<EOL><DEDENT>s3_pointer = location_uri<EOL><DEDENT>else:<EOL><INDENT>s3_pointer = parse_s3_uri(location_uri)<EOL>if s3_pointer is None:<EOL><INDENT>raise InvalidResourceException(logical_id,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(property_name))<EOL><DEDENT><DEDENT>code = {<EOL>'<STR_LIT>': s3_pointer['<STR_LIT>'],<EOL>'<STR_LIT>': s3_pointer['<STR_LIT>']<EOL>}<EOL>if '<STR_LIT>' in s3_pointer:<EOL><INDENT>code['<STR_LIT>'] = s3_pointer['<STR_LIT>']<EOL><DEDENT>return code<EOL>
Constructs a Lambda `Code` or `Content` property, from the SAM `CodeUri` or `ContentUri` property.
    This follows the current scheme for Lambda Functions and LayerVersions.

    :param dict or string location_uri: s3 location dict or string
    :param string logical_id: logical_id of the resource calling this function
    :param string property_name: name of the property which is used as an input to this function.
    :returns: a Code dict, containing the S3 Bucket, Key, and Version of the Lambda layer code
    :rtype: dict