can i use safely a lambda as target when using CloudWatch PutDestination

0

Hello,

I have been playing around a bit with CloudWatch Destinations, my goal is to send logs across accounts. However, in the documentation and in the examples there is only the example with Kineses as destination for the CloudWatch Destinations.

Destination Object

https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_Destination.html here it talks mentioned Kinesis for example.

API Call

In the API description https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html, however, only Kinesis is mentioned. Also in the example only Kineses is mentioned. https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-New.html

Lambda tweak

However, if a Lambda ARN is entered, this also works, the log events are successfully forwarded cross-account to the Lambda functions.

{
    "destinations": [
        {
            "destinationName": "my-name",
            "targetArn": "arn:aws:lambda:eu-central-1:xxxxxxxxxxxx:function:logs",
            "roleArn": "arn:aws:iam::xxxxxxxxxx:role/LambdaRole",
            "accessPolicy": "{......}",
            "arn": "arn:aws:logs:eu-central-1:xxxxxxxxxxxx:destination:logs",
        }
    ]
}

My question is therefore, can there be problems with this, since this is not described in the documentation, is there something to consider?

If it is usable without problems so, it would be nice if the Documentation can be adapted accordingly.

profile picture
已提问 2 年前184 查看次数
1 回答
0

This is fully supported as can be seen in the doc here.

profile pictureAWS
专家
Uri
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则