Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ future==0.16.0
futures==3.2.0; python_version < '3'
hjson==3.0.1
jmespath==0.9.3
kappa==0.6.0
-e git+https://github.com/jneves/kappa@9156d35127b0d09b8f7c99f4d7f7f3733f168514#egg=kappa
lambda-packages==0.20.0
pip>=9.0.1, <=10.1.0
python-dateutil>=2.6.1, <2.7.0
Expand Down
9 changes: 6 additions & 3 deletions zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2364,10 +2364,10 @@ def schedule_events(self, lambda_arn, lambda_name, events, default=True):
http://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html
"""

# The two stream sources - DynamoDB and Kinesis - are working differently than the other services (pull vs push)
# The stream sources - DynamoDB, Kinesis and SQS - are working differently than the other services (pull vs push)
# and do not require event permissions. They do require additional permissions on the Lambda roles though.
# http://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html
pull_services = ['dynamodb', 'kinesis']
pull_services = ['dynamodb', 'kinesis', 'sqs']

# XXX: Not available in Lambda yet.
# We probably want to execute the latest code.
Expand Down Expand Up @@ -2612,7 +2612,10 @@ def unschedule_events(self, events, lambda_arn=None, lambda_name=None, excluded_
function,
self.boto_session
)
print("Removed event " + name + " (" + str(event_source['events']) + ").")
print("Removed event {}{}.".format(
name,
" ({})".format(str(event_source['events'])) if 'events' in event_source else '')
)

###
# Async / SNS
Expand Down
7 changes: 6 additions & 1 deletion zappa/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def copytree(src, dst, metadata=True, symlinks=False, ignore=None):
When `metadata` is False, file metadata such as permissions and modification
times are not copied.
"""
if os.path.isfile(src):
shutil.copy2(src, dst) if metadata else shutil.copy(src, dst)
return

if not os.path.exists(dst):
os.makedirs(dst)
Expand Down Expand Up @@ -203,6 +206,7 @@ def get_event_source(event_source, lambda_arn, target_function, boto_session, dr
import kappa.event_source.kinesis
import kappa.event_source.s3
import kappa.event_source.sns
import kappa.event_source.sqs
import kappa.event_source.cloudwatch
import kappa.policy
import kappa.role
Expand Down Expand Up @@ -245,6 +249,7 @@ def add(self, function):
'kinesis': kappa.event_source.kinesis.KinesisEventSource,
's3': kappa.event_source.s3.S3EventSource,
'sns': ExtendedSnsEventSource,
'sqs': kappa.event_source.sqs.SqsEventSource,
'events': kappa.event_source.cloudwatch.CloudWatchEventSource
}

Expand Down Expand Up @@ -421,4 +426,4 @@ def titlecase_keys(d):
"""
Takes a dict with keys of type str and returns a new dict with all keys titlecased.
"""
return {k.title(): v for k, v in d.items()}
return {k.title(): v for k, v in d.items()}