Fix log retrieval for lambdas.
@@ -53,7 +53,7 @@ const (
cloudTaskType = tokens.Type("cloud:task:Task")
// AWS resource types
- awsServerlessFunctionTypeName = "aws:serverless:Function"
+ awsLambdaFunctionTypeName = "aws:lambda/function:Function"
awsLogGroupTypeName = "aws:cloudwatch/logGroup:LogGroup"
)
@@ -62,12 +62,13 @@ func (ops *cloudOpsProvider) GetLogs(query LogQuery) (*[]LogEntry, error) {
logging.V(6).Infof("GetLogs[%v]", state.URN)
switch state.Type {
case cloudFunctionType:
- // We get the aws:serverless:Function child and request it's logs, parsing out the user-visible content from
- // those logs to project into our own log output, but leaving out explicit Lambda metadata.
+ // We get the aws:lambda/function:Function child and request it's logs, parsing out the
+ // user-visible content from those logs to project into our own log output, but leaving out
+ // explicit Lambda metadata.
name := string(state.URN.Name())
- serverlessFunction, ok := ops.component.GetChild(awsServerlessFunctionTypeName, name)
+ serverlessFunction, ok := ops.component.GetChild(awsLambdaFunctionTypeName, name)
if !ok {
- logging.V(6).Infof("Child resource (type %v, name %v) not found", awsServerlessFunctionTypeName, name)
+ logging.V(6).Infof("Child resource (type %v, name %v) not found", awsLambdaFunctionTypeName, name)
return nil, nil
}
rawLogs, err := serverlessFunction.OperationsProvider(ops.config).GetLogs(query)
@@ -94,9 +95,9 @@ func (ops *cloudOpsProvider) GetLogs(query LogQuery) (*[]LogEntry, error) {
// live Lambda logs from individual functions, de-duplicating the results, to piece together the full set of
// logs.
name := string(state.URN.Name())
- serverlessFunction, ok := ops.component.GetChild(awsServerlessFunctionTypeName, name)
+ serverlessFunction, ok := ops.component.GetChild(awsLambdaFunctionTypeName, name)
if !ok {
- logging.V(6).Infof("Child resource (type %v, name %v) not found", awsServerlessFunctionTypeName, name)
+ logging.V(6).Infof("Child resource (type %v, name %v) not found", awsLambdaFunctionTypeName, name)
return nil, nil
}
rawLogs, err := serverlessFunction.OperationsProvider(ops.config).GetLogs(query)
