LogSubscriptionFilter
Provides a CloudWatch Logs subscription filter resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var testLambdafunctionLogfilter = new Aws.CloudWatch.LogSubscriptionFilter("testLambdafunctionLogfilter", new Aws.CloudWatch.LogSubscriptionFilterArgs
{
DestinationArn = aws_kinesis_stream.Test_logstream.Arn,
Distribution = "Random",
FilterPattern = "logtype test",
LogGroup = "/aws/lambda/example_lambda_name",
RoleArn = aws_iam_role.Iam_for_lambda.Arn,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudwatch"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudwatch.NewLogSubscriptionFilter(ctx, "testLambdafunctionLogfilter", &cloudwatch.LogSubscriptionFilterArgs{
DestinationArn: pulumi.String(aws_kinesis_stream.Test_logstream.Arn),
Distribution: pulumi.String("Random"),
FilterPattern: pulumi.String("logtype test"),
LogGroup: pulumi.String("/aws/lambda/example_lambda_name"),
RoleArn: pulumi.String(aws_iam_role.Iam_for_lambda.Arn),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
test_lambdafunction_logfilter = aws.cloudwatch.LogSubscriptionFilter("testLambdafunctionLogfilter",
destination_arn=aws_kinesis_stream["test_logstream"]["arn"],
distribution="Random",
filter_pattern="logtype test",
log_group="/aws/lambda/example_lambda_name",
role_arn=aws_iam_role["iam_for_lambda"]["arn"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testLambdafunctionLogfilter = new aws.cloudwatch.LogSubscriptionFilter("test_lambdafunction_logfilter", {
destinationArn: aws_kinesis_stream_test_logstream.arn,
distribution: "Random",
filterPattern: "logtype test",
logGroup: "/aws/lambda/example_lambda_name",
roleArn: aws_iam_role_iam_for_lambda.arn,
});Create a LogSubscriptionFilter Resource
new LogSubscriptionFilter(name: string, args: LogSubscriptionFilterArgs, opts?: CustomResourceOptions);def LogSubscriptionFilter(resource_name, opts=None, destination_arn=None, distribution=None, filter_pattern=None, log_group=None, name=None, role_arn=None, __props__=None);func NewLogSubscriptionFilter(ctx *Context, name string, args LogSubscriptionFilterArgs, opts ...ResourceOption) (*LogSubscriptionFilter, error)public LogSubscriptionFilter(string name, LogSubscriptionFilterArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args LogSubscriptionFilterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LogSubscriptionFilterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LogSubscriptionFilterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
LogSubscriptionFilter Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The LogSubscriptionFilter resource accepts the following input properties:
- Destination
Arn string The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- Filter
Pattern string A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- Log
Group string The name of the log group to associate the subscription filter with
- Distribution string
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”.
- Name string
A name for the subscription filter
- Role
Arn string 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- Destination
Arn string The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- Filter
Pattern string A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- Log
Group interface{} The name of the log group to associate the subscription filter with
- Distribution string
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”.
- Name string
A name for the subscription filter
- Role
Arn string 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- destination
Arn string The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- filter
Pattern string A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- log
Group string | LogGroup The name of the log group to associate the subscription filter with
- distribution string
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”.
- name string
A name for the subscription filter
- role
Arn string 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- destination_
arn str The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- filter_
pattern str A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- log_
group string | str The name of the log group to associate the subscription filter with
- distribution str
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”.
- name str
A name for the subscription filter
- role_
arn str 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
Outputs
All input properties are implicitly available as output properties. Additionally, the LogSubscriptionFilter resource produces the following output properties:
Look up an Existing LogSubscriptionFilter Resource
Get an existing LogSubscriptionFilter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LogSubscriptionFilterState, opts?: CustomResourceOptions): LogSubscriptionFilterstatic get(resource_name, id, opts=None, destination_arn=None, distribution=None, filter_pattern=None, log_group=None, name=None, role_arn=None, __props__=None);func GetLogSubscriptionFilter(ctx *Context, name string, id IDInput, state *LogSubscriptionFilterState, opts ...ResourceOption) (*LogSubscriptionFilter, error)public static LogSubscriptionFilter Get(string name, Input<string> id, LogSubscriptionFilterState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Destination
Arn string The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- Distribution string
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”.
- Filter
Pattern string A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- Log
Group string The name of the log group to associate the subscription filter with
- Name string
A name for the subscription filter
- Role
Arn string 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- Destination
Arn string The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- Distribution string
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”.
- Filter
Pattern string A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- Log
Group interface{} The name of the log group to associate the subscription filter with
- Name string
A name for the subscription filter
- Role
Arn string 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- destination
Arn string The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- distribution string
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”.
- filter
Pattern string A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- log
Group string | LogGroup The name of the log group to associate the subscription filter with
- name string
A name for the subscription filter
- role
Arn string 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- destination_
arn str The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
- distribution str
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”.
- filter_
pattern str A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
- log_
group string | str The name of the log group to associate the subscription filter with
- name str
A name for the subscription filter
- role_
arn str 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.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.