MCPcopy
hub / github.com/serverless/serverless / extendedValidate

Method extendedValidate

packages/serverless/lib/plugins/aws/logs.js:51–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 }
50
51 extendedValidate() {
52 this.validate()
53 // validate function exists in service
54 const functionObject = this.serverless.service.getFunction(
55 this.options.function,
56 )
57 const lambdaName = functionObject.name
58 this.options.interval = this.options.interval || 1000
59 const logGroupClass = this.provider.getLogGroupClass(functionObject)
60 this.options.logGroupName = this.provider.naming.getLogGroupName(
61 lambdaName,
62 { logGroupClass },
63 )
64 if (logGroupClass === LOG_GROUP_CLASSES.INFREQUENT_ACCESS) {
65 throw new ServerlessError(
66 `The "${this.options.function}" function writes to the INFREQUENT_ACCESS log group "${this.options.logGroupName}". This log class does not support the CloudWatch Logs APIs used by "sls logs". Use CloudWatch Logs Insights to read these logs.`,
67 'LOGS_INFREQUENT_ACCESS_NOT_SUPPORTED',
68 { stack: false },
69 )
70 }
71 }
72
73 async getLogStreams() {
74 const params = {

Callers 2

constructorMethod · 0.95
logs.test.jsFile · 0.45

Calls 4

getLogGroupClassMethod · 0.80
getLogGroupNameMethod · 0.80
validateMethod · 0.45
getFunctionMethod · 0.45

Tested by

no test coverage detected