From 13a58f94fb73a94fd9248a455163ac8fc71c3bf7 Mon Sep 17 00:00:00 2001 From: "s.hirose" Date: Tue, 27 Aug 2024 15:08:48 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8D=20create=20sqs=20and=20lambda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lambda/functions/sample/lambda_function.py | 5 +++++ templates/lambda/lambda-sample.yml | 14 -------------- 2 files changed, 5 insertions(+), 14 deletions(-) create mode 100644 templates/lambda/functions/sample/lambda_function.py diff --git a/templates/lambda/functions/sample/lambda_function.py b/templates/lambda/functions/sample/lambda_function.py new file mode 100644 index 0000000..a471233 --- /dev/null +++ b/templates/lambda/functions/sample/lambda_function.py @@ -0,0 +1,5 @@ +def lambda_handler(event, context) -> str: + """Lambdaのエントリーポイント + """ + print(event["Records"][0]["body"]) + return "finish lambda" diff --git a/templates/lambda/lambda-sample.yml b/templates/lambda/lambda-sample.yml index e4dbfed..1a543cd 100644 --- a/templates/lambda/lambda-sample.yml +++ b/templates/lambda/lambda-sample.yml @@ -15,12 +15,8 @@ Metadata: - Label: default: "Lambda Configuration" Parameters: - - LambdaProtectedSubnet1 - - LambdaProtectedSubnet2 - - LambdaSecurityGroupID - LambdaArchiveBucketName - LambdaArchiveBucketObjectKey - - ParametersSecretsLambdaExtensionArn - Handler - MemorySize - Timeout @@ -50,11 +46,6 @@ Parameters: LambdaArchiveBucketObjectKey: Description: "Enter the S3 bucket object key for Lambda zip archive." Type: String - # @see https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/ps-integration-lambda-extensions.html#ps-integration-lambda-extensions-add - ParametersSecretsLambdaExtensionArn: - Description: "Enter the Lambda Extension ARN for AWS Parameters and Secrets." - Type: String - Default: arn:aws:lambda:ap-northeast-1:133490724326:layer:AWS-Parameters-and-Secrets-Lambda-Extension:11 Handler: Description: "Enter the Lambda function name to delete data. (default: lambda_function.lambda_handler)" Type: String @@ -93,8 +84,6 @@ Resources: Code: S3Bucket: !Ref LambdaArchiveBucketName S3Key: !Ref LambdaArchiveBucketObjectKey - Layers: - - !Ref ParametersSecretsLambdaExtensionArn FunctionName: !Sub ${ProjectName}-${Environment} Description: "サンプル用Lambda 関数" Handler: !Ref Handler @@ -147,9 +136,6 @@ Resources: - ec2:CreateNetworkInterface - ec2:DescribeNetworkInterfaces - ec2:DeleteNetworkInterface - - ssm:GetParameter - - ssm:GetParameters - - kms:Decrypt Resource: "*" - Effect: Allow Action: logs:CreateLogGroup