既存のLambda関数を更新する方法を教えてください
現在、CloudFormation + S3 + lambdaで自動デプロイを構築しようと考えているのですが、
すでに存在する関数のため失敗してしまいます。
こちらを実現するにはどのようにしたらいいのか、
検索してもなかなか答えに辿り着かないので質問をさせていただきました。
手順としましては、s3にzipファイルを置いて、CloudFormationにtemplate.ymlを読み込んでデプロイをさせる方法で行おうと考えております。
エラーは以下になります
Resource handler returned message: "Function creation failed because the function already exists" (RequestToken: ××××××××××××××××××××××××××××, HandlerErrorCode: AlreadyExists)
template.yaml
Resources: Itokoishi: Type: 'AWS::Lambda::Function' Properties: Code: S3Bucket: 'hogehoge' S3Key: 'lambda.zip' Description: 'LambdaTest' FunctionName: 'hogehoge' Handler: 'lambda_function.lambda_handler' Role: !GetAtt - 'LambdaExecutionRole' - 'Arn' Runtime: 'python3.8' LambdaExecutionRole: Type: 'AWS::IAM::Role' Properties: RoleName: !Sub ${AWS::StackName}-hogehoge-role AssumeRolePolicyDocument: Version: '2012-10-17' Statement: - Effect: 'Allow' Principal: Service: - 'lambda.amazonaws.com' Action: - 'sts:AssumeRole'
よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/09/03 03:25
2022/09/04 07:03 編集