import time


def get_template_s3_resource_path(prefix, template_name, include_timestamp=True):
    """
    Constructs s3 resource path for provided template name
    :param prefix: S3 base path (marts after url port and hostname)
    :param template_name: File name minus '.template' suffix and any timestamp portion
    :param include_timestamp: Indicates whether to include the current time in the file name
    :return string: Url of S3 file
    """
    if include_timestamp:
        key_serial = str(int(time.time()))
        template_name += "." + key_serial

    return "%s/%s.template" % (prefix, template_name)