Skip to content

Commit

Permalink
Fix creation of deployment bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
srisco committed Jan 7, 2020
1 parent 2c6f2cd commit e71519d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scar/providers/aws/lambdafunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ def _get_function_code(self, zip_payload_path: str, supervisor_zip_path: str) ->
FunctionPackager(self.resources_info, supervisor_zip_path).create_zip(zip_payload_path)
if self.function.get('deployment').get('bucket', False):
file_key = f"lambda/{self.function.get('name')}.zip"
S3(self.resources_info).upload_file(bucket=self.function.get('deployment').get('bucket'),
file_path=zip_payload_path,
file_key=file_key)
s3_client = S3(self.resources_info)
s3_client.create_bucket(self.function.get('deployment').get('bucket'))
s3_client.upload_file(bucket=self.function.get('deployment').get('bucket'),
file_path=zip_payload_path,
file_key=file_key)
code = {"S3Bucket": self.function.get('deployment').get('bucket'),
"S3Key": file_key}
else:
Expand Down

0 comments on commit e71519d

Please sign in to comment.