Class LogSubscriptionFilter


  • public class LogSubscriptionFilter
    extends com.pulumi.resources.CustomResource
    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.ArrayList;
     import java.util.Arrays;
     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()
                 .name("test_lambdafunction_logfilter")
                 .roleArn(iamForLambda.arn())
                 .logGroup("/aws/lambda/example_lambda_name")
                 .filterPattern("logtype test")
                 .destinationArn(testLogstream.arn())
                 .distribution("Random")
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `logGroupName` (String) Name of the log group. * `name` (String) Name of the subscription filter. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Subscription Filters using `logGroupName` and `name` separated by a vertical bar (`|`). For example: ```sh $ pulumi import aws:cloudwatch/logSubscriptionFilter:LogSubscriptionFilter example example-group|example-filter ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.Boolean> applyOnTransformedLogs()  
      com.pulumi.core.Output<java.lang.String> destinationArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> distribution()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> emitSystemFields()  
      com.pulumi.core.Output<java.lang.String> filterPattern()  
      static LogSubscriptionFilter get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, LogSubscriptionFilterState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> logGroup()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> roleArn()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LogSubscriptionFilter

        public LogSubscriptionFilter​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • LogSubscriptionFilter

        public LogSubscriptionFilter​(java.lang.String name,
                                     LogSubscriptionFilterArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • LogSubscriptionFilter

        public LogSubscriptionFilter​(java.lang.String name,
                                     LogSubscriptionFilterArgs args,
                                     @Nullable
                                     com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • applyOnTransformedLogs

        public com.pulumi.core.Output<java.lang.Boolean> applyOnTransformedLogs()
        Returns:
        Boolean to indicate whether to apply the subscription filter on the transformed version of the log events instead of the original ingested log events. Defaults to `false`. Valid only for log groups that have an active log transformer.
      • destinationArn

        public com.pulumi.core.Output<java.lang.String> destinationArn()
        Returns:
        ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
      • distribution

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> distribution()
        Returns:
        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".
      • emitSystemFields

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> emitSystemFields()
        Returns:
        List of system fields to include in the log events sent to the subscription destination. These fields provide source information for centralized log data in the forwarded payload. Valid values: `"@aws.account"`, `"@aws.region"`, `"@source.log"`. To remove this argument after it has been set, specify an empty list `[]` explicitly to avoid perpetual differences.
      • filterPattern

        public com.pulumi.core.Output<java.lang.String> filterPattern()
        Returns:
        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](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).
      • logGroup

        public com.pulumi.core.Output<java.lang.String> logGroup()
        Returns:
        Name of the log group to associate the subscription filter with.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name for the subscription filter.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • roleArn

        public com.pulumi.core.Output<java.lang.String> roleArn()
        Returns:
        ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery. 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.
      • get

        public static LogSubscriptionFilter get​(java.lang.String name,
                                                com.pulumi.core.Output<java.lang.String> id,
                                                @Nullable
                                                LogSubscriptionFilterState state,
                                                @Nullable
                                                com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.