Tag: serverless

AWS Lambda出现意外的行为

我做了什么 我使用aws-kotlin-jvm-maven模板创建了一个使用无服务器cli的项目。 之后,我用这种方式编辑了我的serverless.yml模板: service: test provider: name: aws runtime: java8 region: eu-west-1 package: artifact: target/test-1.0.0.jar functions: hello: handler: com.example.Handler events: – schedule: rate(2 minutes) 我已经这样编辑我的Handler: class Handler:RequestHandler<Map, ApiGatewayResponse> { override fun handleRequest(input:Map, context:Context):ApiGatewayResponse { BasicConfigurator.configure() LOG.info(“Hello, World!”) return ApiGatewayResponse() } companion object { private val LOG = Logger.getLogger(Handler::class.java) } } 我期待着我的Lambda每两分钟运行一次,记录一个“Hello,World!” 在CloudWatch上,每2分钟一次。 我的问题 我在cloudWatch日志中find的是以下内容: 第一轮:“你好,世界!” […]