Skip to content

Commit

Permalink
Feature/fix metadata append (#3)
Browse files Browse the repository at this point in the history
* Fix append call to dict for metadata

* Add property for metadata

* Add metadata parameter from config
  • Loading branch information
tarunmenon95 authored Dec 6, 2023
1 parent 781bf1b commit 90b0788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lambdas/s3_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def deploy_artifact(source_bucket, zip_key, dest_bucket, dest_key='', filters=[]
content_type = mimetypes.guess_type(filename)[0]
if content_type is None:
content_type = 'binary/octet-stream'
metadata.append({'deployment': zip_key})
metadata['deployment'] = zip_key
s3_resource.meta.client.upload_fileobj(
filter_deployment(filename, z.open(filename), filters),
Bucket=dest_bucket,
Expand Down
2 changes: 2 additions & 0 deletions s3-deployer.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
CloudFormation do

deployment_filter = external_parameters.fetch(:deployment_filter, nil)
deployment_metadata = external_parameters.fetch(:deployment_metadata, nil)

Resource("S3DeployerCR") do
Type 'Custom::S3Deployer'
Expand All @@ -11,6 +12,7 @@
Property 'DeploymentBucket', Ref(:DeploymentBucket)
Property 'DeploymentKey', Ref(:DeploymentKey)
Property 'DeploymentFilter', FnSub(deployment_filter.to_json()) unless deployment_filter.nil?
Property 'DeploymentMetaData', FnSub(deployment_metadata.to_json()) unless deployment_metadata.nil?
end

end

0 comments on commit 90b0788

Please sign in to comment.