@@ -45,22 +45,25 @@ def update_collection(name, root, long_poll, concurrency):
45
45
@click .option ('--type' , '-t' , type = str , default = 'lambda' )
46
46
@click .option ('--bucket_name' , '-n' , type = str )
47
47
def modify_kickoff (type , bucket_name ):
48
+ func_name = 'kickoff'
49
+
48
50
if type == 's3' :
49
- kickoff_func = resources .lambda_s3_trigger ('kickoff' , bucket_name )
51
+ kickoff_func = resources .lambda_s3_trigger (func_name , bucket_name )
52
+ elif type == 'lambda' :
53
+ kickoff_func = resources .lambda_invoke (func_name )
50
54
else :
51
- kickoff_func = None
52
-
53
- if kickoff_func :
54
- # Add kickoff source event to environment
55
- kickoff_func .update ({'environment' : {
56
- 'EVENT_SOURCE' : type
57
- }})
58
- with open (sls_config_path , 'r' ) as f :
59
- sls_config = yaml .unsafe_load (f )
60
- sls_config ['functions' ]['kickoff' ].update (kickoff_func )
61
-
62
- with open (sls_config_path , 'w' ) as outf :
63
- yaml .dump (sls_config , outf , indent = 1 )
55
+ raise ValueError ("The `type` parameter must be one of ['s3', 'lambda']." )
56
+
57
+ # Add kickoff source event to environment
58
+ kickoff_func .update ({'environment' : {
59
+ 'EVENT_SOURCE' : type
60
+ }})
61
+ with open (sls_config_path , 'r' ) as f :
62
+ sls_config = yaml .unsafe_load (f )
63
+ sls_config ['functions' ]['kickoff' ].update (kickoff_func )
64
+
65
+ with open (sls_config_path , 'w' ) as outf :
66
+ yaml .dump (sls_config , outf , indent = 1 )
64
67
65
68
@stac_updater .command (name = 'add-notifications' )
66
69
@click .option ('--topic_name' , type = str , required = True )
0 commit comments