Class LogDelivery


  • public class LogDelivery
    extends com.pulumi.resources.CustomResource
    Resource for managing an AWS CloudWatch Logs Delivery. A delivery is a connection between an `aws.cloudwatch.LogDeliverySource` and an `aws.cloudwatch.LogDeliveryDestination`. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatch.LogDelivery;
     import com.pulumi.aws.cloudwatch.LogDeliveryArgs;
     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 LogDelivery("example", LogDeliveryArgs.builder()
                 .deliverySourceName(exampleAwsCloudwatchLogDeliverySource.name())
                 .deliveryDestinationArn(exampleAwsCloudwatchLogDeliveryDestination.arn())
                 .fieldDelimiter(",")
                 .recordFields(            
                     "event_timestamp",
                     "event")
                 .build());
     
         }
     }
     
     
    ### CloudFront Standard Logging (v2) CloudFront delivers access logs through CloudWatch Logs, so a distribution's standard logging (v2) configuration is expressed as a delivery source, a delivery destination, and a delivery. The `recordFields` list selects the access log fields, including `viewer-request-log-data` and `viewer-response-log-data`, which carry the custom data that a viewer request or viewer response CloudFront Function logs with `cf.logCustomData()`.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatch.LogDeliverySource;
     import com.pulumi.aws.cloudwatch.LogDeliverySourceArgs;
     import com.pulumi.aws.cloudwatch.LogDeliveryDestination;
     import com.pulumi.aws.cloudwatch.LogDeliveryDestinationArgs;
     import com.pulumi.aws.cloudwatch.inputs.LogDeliveryDestinationDeliveryDestinationConfigurationArgs;
     import com.pulumi.aws.cloudwatch.LogDelivery;
     import com.pulumi.aws.cloudwatch.LogDeliveryArgs;
     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 LogDeliverySource("example", LogDeliverySourceArgs.builder()
                 .name("cloudfront-access-logs")
                 .logType("ACCESS_LOGS")
                 .resourceArn(exampleAwsCloudfrontDistribution.arn())
                 .build());
     
             var exampleLogDeliveryDestination = new LogDeliveryDestination("exampleLogDeliveryDestination", LogDeliveryDestinationArgs.builder()
                 .deliveryDestinationConfiguration(LogDeliveryDestinationDeliveryDestinationConfigurationArgs.builder()
                     .destinationResourceArn(exampleAwsCloudwatchLogGroup.arn())
                     .build())
                 .name("cloudfront-access-logs")
                 .outputFormat("json")
                 .build());
     
             var exampleLogDelivery = new LogDelivery("exampleLogDelivery", LogDeliveryArgs.builder()
                 .deliverySourceName(example.name())
                 .deliveryDestinationArn(exampleLogDeliveryDestination.arn())
                 .recordFields(            
                     "date",
                     "time",
                     "c-ip",
                     "sc-status",
                     "viewer-request-log-data",
                     "viewer-response-log-data")
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `id` (String) ID of the delivery. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Deliveries using `id`. For example: ```sh $ pulumi import aws:cloudwatch/logDelivery:LogDelivery example jsoGVi4Zq8VlYp9n ```
    • 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.String> arn()  
      com.pulumi.core.Output<java.lang.String> deliveryDestinationArn()  
      com.pulumi.core.Output<java.lang.String> deliverySourceName()  
      com.pulumi.core.Output<java.lang.String> fieldDelimiter()  
      static LogDelivery get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, LogDeliveryState 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.util.List<java.lang.String>> recordFields()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.List<LogDeliveryS3DeliveryConfiguration>> s3DeliveryConfigurations()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • 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

      • LogDelivery

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

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

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

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the delivery.
      • deliveryDestinationArn

        public com.pulumi.core.Output<java.lang.String> deliveryDestinationArn()
        Returns:
        The ARN of the delivery destination to use for this delivery.
      • deliverySourceName

        public com.pulumi.core.Output<java.lang.String> deliverySourceName()
        Returns:
        The name of the delivery source to use for this delivery.
      • fieldDelimiter

        public com.pulumi.core.Output<java.lang.String> fieldDelimiter()
        Returns:
        The field delimiter to use between record fields when the final output format of a delivery is in `plain`, `w3c`, or `raw` format.
      • recordFields

        public com.pulumi.core.Output<java.util.List<java.lang.String>> recordFields()
        Returns:
        The list of record fields to be delivered to the destination, in order. The valid field names vary by the `logType` of the delivery source. For a CloudFront `ACCESS_LOGS` source, see [Configure standard logging (v2)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/standard-logging.html#standard-logging-real-time-log-selection) for the supported values.
      • 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.
      • s3DeliveryConfigurations

        public com.pulumi.core.Output<java.util.List<LogDeliveryS3DeliveryConfiguration>> s3DeliveryConfigurations()
        Returns:
        Parameters that are valid only when the delivery's delivery destination is an S3 bucket.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • get

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