简体   繁体   English

如何使用 AWS SAM 更新现有 lambda function

[英]How to update existing lambda function using AWS SAM

I have some lambda functions that have been created before moving to AWS SAM.我有一些在迁移到 AWS SAM 之前创建的 lambda 函数。 I would like to update my existing lambda function using AWS SAM.我想使用 AWS SAM 更新我现有的 lambda function。 What would be the process of referencing the lambda function in AWS SAM.在 AWS SAM 中引用 lambda function 的过程是什么。 I have a lambda function already created called: hello.我已经创建了一个 lambda function,名为:你好。

How would I update the lambda function using AWS SAM?如何使用 AWS SAM 更新 lambda function? below is my sam template.yaml file下面是我的山姆模板。yaml 文件

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: CD Demo Lambda
Resources:
  hello:
    Type: 'AWS::Serverless::Function'
    Properties:
      Handler: lambda_function.lambda_handler
      Runtime: python3.7
      CodeUri: ./s3lambda
      FunctionName: hello
      MemorySize: 128
      Timeout: 03       

As AWS SAM uses Cloudformation for deploying resources.由于AWS SAM使用Cloudformation来部署资源。

You need to import the lambdas Importing existing resources into a stack in the cloudformation stack.您需要将 lambdas 导入现有资源到cloudformation堆栈中的堆栈中。

The documentation states that you cannot import resources to AWS SAM Templates.文档指出您无法将资源导入 AWS SAM 模板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS SAM-如何将参数传递给Lambda函数 - AWS SAM - How to pass parameters to Lambda Function API 网关的 lambda 的 AWS SAM 更新函数代码 - AWS SAM update function code of lambda of an API Gateway 如何使用 AWS 代码部署而不使用 SAM 部署简单的 AWS lambda function? - How do i deploy a simple AWS lambda function using AWS code deploy without using SAM? 使用 AWS SAM 3 秒后 AWS Lambda 函数超时 - AWS Lambda function Timedout after 3 sec using AWS SAM 使用AWS持续集成/部署更新现有Lambda函数 - Update Existing Lambda Function Using AWS Continuous Integration/Deployment 如何更新在 AWS SAM/CodePipeline 中定义/部署的 Lambda 代码? - How to update Lambda code defined/deployed in AWS SAM/CodePipeline? AWS CodePipline (CI/CD) 更新现有 AWS Lambda 的代码(不是使用 CloudFormation 或 SAM 创建) - AWS CodePipline (CI/CD) to update the code of an existing AWS Lambda (not created with CloudFormation or SAM) 如何读取 .NET lambda 函数中的 aws sam 参数 - How to read aws sam parameter in .NET lambda function 如何使用 SAM 在本地运行 C++ AWS Lambda Function? - How to run a C++ AWS Lambda Function locally with SAM? 如何使用 lambda function AWS SAM 添加策略以访问密钥 - How to add policy to access secret with lambda function AWS SAM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM