Пример #1
0
 def do_export(self, resource_id, resource_dict, parent_dir):
     """
     Default export action is to upload artifacts and set the property to
     S3 URL of the uploaded object
     If code signing configuration is provided for function/layer, uploaded artifact
     will be replaced by signed artifact location
     """
     # code signer only accepts files which has '.zip' extension in it
     # so package artifact with '.zip' if it is required to be signed
     should_sign_package = self.code_signer.should_sign_package(resource_id)
     artifact_extension = "zip" if should_sign_package else None
     uploaded_url = upload_local_artifacts(
         resource_id,
         resource_dict,
         self.PROPERTY_NAME,
         parent_dir,
         self.uploader,
         artifact_extension,
     )
     if should_sign_package:
         uploaded_url = self.code_signer.sign_package(
             resource_id, uploaded_url,
             self.uploader.get_version_of_artifact(uploaded_url))
     set_value_from_jmespath(resource_dict, self.PROPERTY_NAME,
                             uploaded_url)
Пример #2
0
    def do_export(self, resource_id, resource_dict, parent_dir):
        """
        Upload to S3 and set property to an dict representing the S3 url
        of the uploaded object
        """

        artifact_s3_url = upload_local_artifacts(resource_id, resource_dict,
                                                 self.PROPERTY_NAME,
                                                 parent_dir, self.uploader)

        parsed_url = S3Uploader.parse_s3_url(
            artifact_s3_url,
            bucket_name_property=self.BUCKET_NAME_PROPERTY,
            object_key_property=self.OBJECT_KEY_PROPERTY,
            version_property=self.VERSION_PROPERTY,
        )
        set_value_from_jmespath(resource_dict, self.PROPERTY_NAME, parsed_url)