serverless / serverless/examples
Lambda function will skip inline function.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 4.4k
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 3
Description
Hi all, Currently I am using serverless for deploying my code into AWS Lambda function to stop the AWS code deploy latest deployments. So I am using AWS node SDK for this and verified my code locally by using the command sls offline i works good. While deployed on AWS, the Lambda function will skip the sdk function.
Anyone, please help to resolve the problem. Here my code
`var AWS = require('aws-sdk');
AWS.config = new AWS.Config();
AWS.config.accessKeyId = "access_key";
AWS.config.secretAccessKey = "secret_key";
AWS.config.region = "region";
var codedeploy = new AWS.CodeDeploy();
module.exports.hello = async (event) => {
var params = {
applicationName: 'application_name',
deploymentGroupName: "Deployment group name",
includeOnlyStatuses: ['InProgress', 'Succeeded'],
};
codedeploy.listDeployments(params, (err, data) => {
console.log('------------ Going to list deployment----------------')
let deployment_id = data.deployments[0]
if (err) console.log(err, err.stack); // an error occurred
else {
var params = {
deploymentId: deployment_id, /* required */
autoRollbackEnabled: true || false
};
} // successful response
});
};`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the module.exports.hello Lambda handler and compare its behavior under sls offline with the deployed AWS Lambda function. Verify whether the CodeDeploy SDK call runs in the deployed environment and whether its callback reports an error; done means the deployed function reliably reaches and handles that call.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript, node.js
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100