Closed sharmmoh1983 closed 2 years ago
What version of SAM CLI are you using? What commands are you using to deploy? What (if any) errors are you experiencing?
As i mentioned above I am using following step in in my github actions
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: aws-actions/setup-sam@v1
# sam build
- run: sam build --use-container
# sam deploy
- run: sam deploy --template-file template-test.yaml .......
There are no errors showing github actions logs and sam build and deploy commands run fine But when i see code on lambda there are no node_modules but the source code do get updated
Thanks for the context. A couple more questions:
@hoffa Thanks for your response Please find the following points
Did it work before, but suddenly stopped working? No it never worked using --template-file , it only works when I run sam deploy without custom template file
# sam deploy
- run: sam deploy .......
In this case node nodules gets deployed .
Would you able to share parts of the template that includes the function?
This is just standard SAM way of defining lambda
Function:
Type: AWS::Serverless::Function
Properties:
CodeUri: lambda/service
Handler: index.handler
FunctionName : !Sub ${Environment}
Runtime: nodejs12.x
Timeout: 10
VpcConfig:
SecurityGroupIds:
- !GetAtt GroupId
SubnetIds:
- !Ref SubnetId
MemorySize: 128
Environment:
Variables:
WSDL_URI : !Ref URI
Role: !GetAtt LambdaRole.Arn
Events:
SystemAPI:
Type: Api
Properties:
RestApiId: !Ref RestApi
Path: /Service
Method: POST
Are you using esbuild by any chance? I am not sure but most likely no
I was able to reproduce it locally:
sam init --name sam-app --runtime nodejs14.x --dependency-manager npm --app-template hello-world
cd sam-app
sam build
sam deploy --guided --template-file template.yaml # No node_modules
sam deploy --template-file template.yaml # Still no node_modules
sam deploy # Now node_modules is there
I'm unable to transfer to issue, so I've instead created one at https://github.com/aws/aws-sam-cli/issues/4203
I'll close this issue in favor of that one. Thanks a lot for reporting the issue! 🙏
When i am trying to run sam deploy with --template-file using aws-actions/setup-sam@v1 node_modules are not getting deployed
Please suggest