當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript aws-sdk.Lambda類代碼示例

本文整理匯總了TypeScript中aws-sdk.Lambda的典型用法代碼示例。如果您正苦於以下問題:TypeScript Lambda類的具體用法?TypeScript Lambda怎麽用?TypeScript Lambda使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Lambda類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: callGraphQl

 static async callGraphQl() {
   const query = `
     query ($shop_id:ID) {
       shop_info(shop_id: $shop_id){
         shop_id
       }
     }
   `;
   const vars = { shop_id: 1 };
   const lambda = new AWS.Lambda({ region: 'ap-northeast-2' });
   const result = await lambda.invoke({
     FunctionName: 'MySampleServiceGraphQl',
     Payload: JSON.stringify({ query, operationName: '', variables: vars }),
   }).promise();
   console.log(result);
 }
開發者ID:june1123,項目名稱:testSources,代碼行數:16,代碼來源:DataHelper.ts

示例2: getLambdaPolicy

 private async getLambdaPolicy() {
   return this._awsLambda
     .getPolicy({
       FunctionName: this._lambdaFunctionName
     })
     .promise();
 }
開發者ID:loopingz,項目名稱:webda-shell,代碼行數:7,代碼來源:lambda.ts

示例3:

 promise.then(() => {
   return this._awsLambda
     .deleteFunction({
       FunctionName: fct.FunctionName,
       Qualifier: versions[i].Version
     })
     .promise();
 });
開發者ID:loopingz,項目名稱:webda-shell,代碼行數:8,代碼來源:lambda.ts

示例4: removeLambdaPermission

 private async removeLambdaPermission(sid) {
   return this._awsLambda
     .removePermission({
       FunctionName: this._lambdaFunctionName,
       StatementId: sid
     })
     .promise();
 }
開發者ID:loopingz,項目名稱:webda-shell,代碼行數:8,代碼來源:lambda.ts

示例5: updateLambdaFunction

 private async updateLambdaFunction() {
   this.stepper("Updating Lambda function");
   var params = {
     FunctionName: this._lambdaFunctionName,
     Publish: true
   };
   await this.addPackageToUpdateFunction(params);
   let fct = await this._awsLambda.updateFunctionCode(params).promise();
   await this.cleanVersions(fct);
   var updateConfigurationParams = {
     MemorySize: this._lambdaMemorySize,
     FunctionName: this._lambdaFunctionName,
     Handler: this._lambdaHandler,
     Role: this._lambdaRole,
     Runtime: "nodejs8.10",
     Timeout: this._lambdaTimeout,
     Description: "Deployed with Webda for API: " + this._restApiName
   };
   await this._awsLambda
     .updateFunctionConfiguration(updateConfigurationParams)
     .promise();
 }
開發者ID:loopingz,項目名稱:webda-shell,代碼行數:22,代碼來源:lambda.ts

示例6: Promise

 return new Promise((ok, fail) => {
   console.log(`Deleting version ${version.Version} of lambda function "${version.FunctionName}"...`);
   lambda.deleteFunction({
     FunctionName: version.FunctionName,
     Qualifier: version.Version
   }, (err, result) => {
     if (err) {
       return fail(err);
     }
     ok(result);
   });
 });
開發者ID:colinmathews,項目名稱:deploy-lambda,代碼行數:12,代碼來源:delete-old-versions.ts

示例7: Promise

 return new Promise((ok, fail) => {
   console.log(`Re-pointing lambda alias "${config.lambdaAlias}" for ${version.FunctionName}...`);
   lambda.updateAlias({
     FunctionName: version.FunctionName,
     Name: config.lambdaAlias,
     FunctionVersion: version.Version
   }, (err, result) => {
     if (err) {
       return fail(err);
     }
     ok(result);
   });
 });
開發者ID:colinmathews,項目名稱:deploy-lambda,代碼行數:13,代碼來源:publish-functions.ts


注:本文中的aws-sdk.Lambda類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。