Class LogDataProtectionPolicy


  • public class LogDataProtectionPolicy
    extends com.pulumi.resources.CustomResource
    Provides a CloudWatch Log Data Protection Policy resource. Read more about protecting sensitive user data in the [User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html). ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatch.LogGroup;
     import com.pulumi.aws.cloudwatch.LogGroupArgs;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.cloudwatch.LogDataProtectionPolicy;
     import com.pulumi.aws.cloudwatch.LogDataProtectionPolicyArgs;
     import static com.pulumi.codegen.internal.Serialization.*;
     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 example = new LogGroup("example", LogGroupArgs.builder()
                 .name("example")
                 .build());
     
             var exampleBucket = new Bucket("exampleBucket", BucketArgs.builder()
                 .bucket("example")
                 .build());
     
             var exampleLogDataProtectionPolicy = new LogDataProtectionPolicy("exampleLogDataProtectionPolicy", LogDataProtectionPolicyArgs.builder()
                 .logGroupName(example.name())
                 .policyDocument(exampleBucket.bucket().applyValue(_bucket -> serializeJson(
                     jsonObject(
                         jsonProperty("Name", "Example"),
                         jsonProperty("Version", "2021-06-01"),
                         jsonProperty("Statement", jsonArray(
                             jsonObject(
                                 jsonProperty("Sid", "Audit"),
                                 jsonProperty("DataIdentifier", jsonArray("arn:aws:dataprotection::aws:data-identifier/EmailAddress")),
                                 jsonProperty("Operation", jsonObject(
                                     jsonProperty("Audit", jsonObject(
                                         jsonProperty("FindingsDestination", jsonObject(
                                             jsonProperty("S3", jsonObject(
                                                 jsonProperty("Bucket", _bucket)
                                             ))
                                         ))
                                     ))
                                 ))
                             ), 
                             jsonObject(
                                 jsonProperty("Sid", "Redact"),
                                 jsonProperty("DataIdentifier", jsonArray("arn:aws:dataprotection::aws:data-identifier/EmailAddress")),
                                 jsonProperty("Operation", jsonObject(
                                     jsonProperty("Deidentify", jsonObject(
                                         jsonProperty("MaskConfig", jsonObject(
     
                                         ))
                                     ))
                                 ))
                             )
                         ))
                     ))))
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `logGroupName` (String) Name of the log group. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Data Protection Policies using `logGroupName`. For example: ```sh $ pulumi import aws:cloudwatch/logDataProtectionPolicy:LogDataProtectionPolicy example my-log-group ```
    • 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
      static LogDataProtectionPolicy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, LogDataProtectionPolicyState 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> logGroupName()  
      com.pulumi.core.Output<java.lang.String> policyDocument()  
      com.pulumi.core.Output<java.lang.String> region()  
      • 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

      • LogDataProtectionPolicy

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

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

        public LogDataProtectionPolicy​(java.lang.String name,
                                       LogDataProtectionPolicyArgs 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

      • logGroupName

        public com.pulumi.core.Output<java.lang.String> logGroupName()
        Returns:
        The name of the log group under which the log stream is to be created.
      • policyDocument

        public com.pulumi.core.Output<java.lang.String> policyDocument()
        Returns:
        Specifies the data protection policy in JSON. Read more at [Data protection policy syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data-start.html#mask-sensitive-log-data-policysyntax).
      • 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.
      • get

        public static LogDataProtectionPolicy get​(java.lang.String name,
                                                  com.pulumi.core.Output<java.lang.String> id,
                                                  @Nullable
                                                  LogDataProtectionPolicyState 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.