Updated README a bit, added some informational output to various commands.
Showing
3 changed files
with
10 additions
and
8 deletions
... | @@ -33,7 +33,7 @@ Where ``command`` is one of: | ... | @@ -33,7 +33,7 @@ Where ``command`` is one of: |
33 | 33 | ||
34 | * deploy - deploy the CloudFormation template containing the IAM roles and zip the function and upload it to AWS Lambda | 34 | * deploy - deploy the CloudFormation template containing the IAM roles and zip the function and upload it to AWS Lambda |
35 | * test - send test data to the new Lambda function | 35 | * test - send test data to the new Lambda function |
36 | -* tail - display the most recent log events for the function | 36 | +* tail - display the most recent log events for the function (remember that it can take several minutes before log events are available from CloudWatch) |
37 | * add-event-source - hook up an event source to your Lambda function | 37 | * add-event-source - hook up an event source to your Lambda function |
38 | * delete - delete the CloudFormation stack containing the IAM roles and delete the Lambda function | 38 | * delete - delete the CloudFormation stack containing the IAM roles and delete the Lambda function |
39 | 39 | ... | ... |
... | @@ -56,31 +56,33 @@ def set_debug_logger(logger_names=['kappa'], stream=None): | ... | @@ -56,31 +56,33 @@ def set_debug_logger(logger_names=['kappa'], stream=None): |
56 | default=False, | 56 | default=False, |
57 | help='Turn on debugging output' | 57 | help='Turn on debugging output' |
58 | ) | 58 | ) |
59 | -@click.option( | ||
60 | - '--dryrun/--no-dryrun', | ||
61 | - default=False, | ||
62 | - help='Do not send the email' | ||
63 | -) | ||
64 | @click.argument( | 59 | @click.argument( |
65 | 'command', | 60 | 'command', |
66 | required=True, | 61 | required=True, |
67 | type=click.Choice(['deploy', 'test', 'tail', 'add-event-source', 'delete']) | 62 | type=click.Choice(['deploy', 'test', 'tail', 'add-event-source', 'delete']) |
68 | ) | 63 | ) |
69 | -def main(config=None, debug=False, dryrun=False, command=None): | 64 | +def main(config=None, debug=False, command=None): |
70 | if debug: | 65 | if debug: |
71 | set_debug_logger() | 66 | set_debug_logger() |
72 | config = yaml.load(config) | 67 | config = yaml.load(config) |
73 | kappa = Kappa(config) | 68 | kappa = Kappa(config) |
74 | if command == 'deploy': | 69 | if command == 'deploy': |
70 | + click.echo('Deploying ...') | ||
75 | kappa.deploy() | 71 | kappa.deploy() |
76 | elif command == 'test': | 72 | elif command == 'test': |
73 | + click.echo('Sending test data ...') | ||
77 | kappa.test() | 74 | kappa.test() |
75 | + click.echo('...done') | ||
78 | elif command == 'tail': | 76 | elif command == 'tail': |
79 | kappa.tail() | 77 | kappa.tail() |
80 | elif command == 'delete': | 78 | elif command == 'delete': |
79 | + click.echo('Deleting ...') | ||
81 | kappa.delete() | 80 | kappa.delete() |
81 | + click.echo('...done') | ||
82 | elif command == 'add-event-source': | 82 | elif command == 'add-event-source': |
83 | + click.echo('Adding event source ...') | ||
83 | kappa.add_event_source() | 84 | kappa.add_event_source() |
85 | + click.echo('...done') | ||
84 | 86 | ||
85 | 87 | ||
86 | if __name__ == '__main__': | 88 | if __name__ == '__main__': | ... | ... |
... | @@ -57,12 +57,12 @@ class Kappa(object): | ... | @@ -57,12 +57,12 @@ class Kappa(object): |
57 | Capabilities=['CAPABILITY_IAM']) | 57 | Capabilities=['CAPABILITY_IAM']) |
58 | done = False | 58 | done = False |
59 | while not done: | 59 | while not done: |
60 | + time.sleep(1) | ||
60 | response = cfn.describe_stacks(StackName=stack_name) | 61 | response = cfn.describe_stacks(StackName=stack_name) |
61 | status = response['Stacks'][0]['StackStatus'] | 62 | status = response['Stacks'][0]['StackStatus'] |
62 | LOG.debug('Stack status is: %s', status) | 63 | LOG.debug('Stack status is: %s', status) |
63 | if status in self.completed_states: | 64 | if status in self.completed_states: |
64 | done = True | 65 | done = True |
65 | - time.sleep(1) | ||
66 | 66 | ||
67 | def get_role_arn(self, role_name): | 67 | def get_role_arn(self, role_name): |
68 | role_arn = None | 68 | role_arn = None | ... | ... |
-
Please register or login to post a comment