Log Subscription Filter
Provides a CloudWatch Logs subscription filter resource.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogSubscriptionFilter;
import com.pulumi.aws.cloudwatch.LogSubscriptionFilterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testLambdafunctionLogfilter = new LogSubscriptionFilter("testLambdafunctionLogfilter", LogSubscriptionFilterArgs.builder()
.roleArn(aws_iam_role.iam_for_lambda().arn())
.logGroup("/aws/lambda/example_lambda_name")
.filterPattern("logtype test")
.destinationArn(aws_kinesis_stream.test_logstream().arn())
.distribution("Random")
.build());
}
}
Import
CloudWatch Logs subscription filter can be imported using the log group name and subscription filter name separated by |
.
$ pulumi import aws:cloudwatch/logSubscriptionFilter:LogSubscriptionFilter test_lambdafunction_logfilter /aws/lambda/example_lambda_name|test_lambdafunction_logfilter
Properties
The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are "Random" and "ByLogStream".
A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events. Use empty string ""
to match everything. For more information, see the Amazon CloudWatch Logs User Guide.
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use aws.lambda.Permission
resource for granting access from CloudWatch logs to the destination Lambda function.