chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Schedule lambda function not created when executing "chalice package"

Open bulv1ne opened this issue 9 years ago • 3 comments

I have a small chalice app with 1 schedule. When executing chalice deploy it creates 2 lambda functions, 1 for the index function and 1 for the schedule. Everything works fine here.

When executing chalice package --stage prod packaged-app and following the guide https://chalice.readthedocs.io/en/latest/topics/cfn.html my index lambda function is created but my scheduled lambda function is not created. I double checked the CloudWatch Log Groups and nothing regarding the scheduled function is found (after waiting some minutes).

Chalice version:

$ chalice --version
chalice 1.0.2

How to reproduce:

$ chalice package --stage prod packaged-app
Creating deployment package.
$ aws cloudformation package --template-file packaged-app/sam.json --s3-bucket workbuster-app --output-template-file packaged-app/packaged.yaml
Uploading to fd6a415a63eb05e952c9b8c4291f4144  5375136 / 5375136.0  (100.00%)
Successfully packaged artifacts and wrote output template to file packaged-app/packaged.yaml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file /home/ec2-user/projects/my_app/packaged-app/packaged.yaml --stack-name <YOUR STACK NAME>
$ aws cloudformation deploy --template-file /home/ec2-user/projects/my_app/packaged-app/packaged.yaml --stack-name myapp --capabilities CAPABILITY_IAM
Waiting for changeset to be created..
Waiting for stack create/update to complete
Successfully created/updated stack - myapp
$ aws cloudformation list-stack-resources --stack-name myapp --output table --query "StackResourceSummaries"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|                                                                                ListStackResources                                                                                |
+--------------------------+---------------------------------------+------------------------------------------------------------+------------------+-------------------------------+
|   LastUpdatedTimestamp   |           LogicalResourceId           |                    PhysicalResourceId                      | ResourceStatus   |         ResourceType          |
+--------------------------+---------------------------------------+------------------------------------------------------------+------------------+-------------------------------+
|  2017-09-07T07:23:17.008Z|  APIHandler                           |  myapp-APIHandler-NBMGTB62I2GV                             |  CREATE_COMPLETE |  AWS::Lambda::Function        |
|  2017-09-07T07:23:10.029Z|  APIHandlerRole                       |  myapp-APIHandlerRole-7Y84IUAIS45N                         |  CREATE_COMPLETE |  AWS::IAM::Role               |
|  2017-09-07T07:23:33.081Z|  APIHandlerindexget6a99PermissionTest |  myapp-APIHandlerindexget6a99PermissionTest-1EGG1INB0UPS7  |  CREATE_COMPLETE |  AWS::Lambda::Permission      |
|  2017-09-07T07:23:33.083Z|  APIHandlerindexget6a99Permissionapi  |  myapp-APIHandlerindexget6a99Permissionapi-14ICT6CB7LEFR   |  CREATE_COMPLETE |  AWS::Lambda::Permission      |
|  2017-09-07T07:23:20.238Z|  RestAPI                              |  gxummqsx7c                                                |  CREATE_COMPLETE |  AWS::ApiGateway::RestApi     |
|  2017-09-07T07:23:23.765Z|  RestAPIDeployment5545a82c34          |  akl0ro                                                    |  CREATE_COMPLETE |  AWS::ApiGateway::Deployment  |
|  2017-09-07T07:23:27.300Z|  RestAPIapiStage                      |  api                                                       |  CREATE_COMPLETE |  AWS::ApiGateway::Stage       |
+--------------------------+---------------------------------------+------------------------------------------------------------+------------------+-------------------------------+

bulv1ne avatar Sep 07 '17 07:09 bulv1ne

Thanks for reporting. We'll get this updated.

jamesls avatar Sep 11 '17 16:09 jamesls

@jamesls , Looks like same issue with pure lambda functions too.

achautha avatar Sep 22 '17 10:09 achautha

Closing out issue, this has been addressed with the rewrite of the deployer (https://github.com/aws/chalice/issues/604), for both scheduled events and pure lambda functions.

jamesls avatar May 17 '18 15:05 jamesls