{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- |
-- Module      : Amazonka.CloudWatchLogs
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Derived from API version @2014-03-28@ of the AWS service descriptions, licensed under Apache 2.0.
--
-- You can use Amazon CloudWatch Logs to monitor, store, and access your
-- log files from EC2 instances, CloudTrail, and other sources. You can
-- then retrieve the associated log data from CloudWatch Logs using the
-- CloudWatch console, CloudWatch Logs commands in the Amazon Web Services
-- CLI, CloudWatch Logs API, or CloudWatch Logs SDK.
--
-- You can use CloudWatch Logs to:
--
-- -   __Monitor logs from EC2 instances in real-time__: You can use
--     CloudWatch Logs to monitor applications and systems using log data.
--     For example, CloudWatch Logs can track the number of errors that
--     occur in your application logs and send you a notification whenever
--     the rate of errors exceeds a threshold that you specify. CloudWatch
--     Logs uses your log data for monitoring so no code changes are
--     required. For example, you can monitor application logs for specific
--     literal terms (such as \"NullReferenceException\") or count the
--     number of occurrences of a literal term at a particular position in
--     log data (such as \"404\" status codes in an Apache access log).
--     When the term you are searching for is found, CloudWatch Logs
--     reports the data to a CloudWatch metric that you specify.
--
-- -   __Monitor CloudTrail logged events__: You can create alarms in
--     CloudWatch and receive notifications of particular API activity as
--     captured by CloudTrail. You can use the notification to perform
--     troubleshooting.
--
-- -   __Archive log data__: You can use CloudWatch Logs to store your log
--     data in highly durable storage. You can change the log retention
--     setting so that any log events older than this setting are
--     automatically deleted. The CloudWatch Logs agent makes it easy to
--     quickly send both rotated and non-rotated log data off of a host and
--     into the log service. You can then access the raw log data when you
--     need it.
module Amazonka.CloudWatchLogs
  ( -- * Service Configuration
    defaultService,

    -- * Errors
    -- $errors

    -- ** InvalidParameterException
    _InvalidParameterException,

    -- ** InvalidSequenceTokenException
    _InvalidSequenceTokenException,

    -- ** UnrecognizedClientException
    _UnrecognizedClientException,

    -- ** ResourceAlreadyExistsException
    _ResourceAlreadyExistsException,

    -- ** OperationAbortedException
    _OperationAbortedException,

    -- ** MalformedQueryException
    _MalformedQueryException,

    -- ** ServiceUnavailableException
    _ServiceUnavailableException,

    -- ** DataAlreadyAcceptedException
    _DataAlreadyAcceptedException,

    -- ** InvalidOperationException
    _InvalidOperationException,

    -- ** ResourceNotFoundException
    _ResourceNotFoundException,

    -- ** LimitExceededException
    _LimitExceededException,

    -- * Waiters
    -- $waiters

    -- * Operations
    -- $operations

    -- ** GetLogGroupFields
    GetLogGroupFields (GetLogGroupFields'),
    newGetLogGroupFields,
    GetLogGroupFieldsResponse (GetLogGroupFieldsResponse'),
    newGetLogGroupFieldsResponse,

    -- ** GetLogRecord
    GetLogRecord (GetLogRecord'),
    newGetLogRecord,
    GetLogRecordResponse (GetLogRecordResponse'),
    newGetLogRecordResponse,

    -- ** DescribeDestinations (Paginated)
    DescribeDestinations (DescribeDestinations'),
    newDescribeDestinations,
    DescribeDestinationsResponse (DescribeDestinationsResponse'),
    newDescribeDestinationsResponse,

    -- ** UntagLogGroup
    UntagLogGroup (UntagLogGroup'),
    newUntagLogGroup,
    UntagLogGroupResponse (UntagLogGroupResponse'),
    newUntagLogGroupResponse,

    -- ** StopQuery
    StopQuery (StopQuery'),
    newStopQuery,
    StopQueryResponse (StopQueryResponse'),
    newStopQueryResponse,

    -- ** CreateExportTask
    CreateExportTask (CreateExportTask'),
    newCreateExportTask,
    CreateExportTaskResponse (CreateExportTaskResponse'),
    newCreateExportTaskResponse,

    -- ** PutDestination
    PutDestination (PutDestination'),
    newPutDestination,
    PutDestinationResponse (PutDestinationResponse'),
    newPutDestinationResponse,

    -- ** DescribeSubscriptionFilters (Paginated)
    DescribeSubscriptionFilters (DescribeSubscriptionFilters'),
    newDescribeSubscriptionFilters,
    DescribeSubscriptionFiltersResponse (DescribeSubscriptionFiltersResponse'),
    newDescribeSubscriptionFiltersResponse,

    -- ** GetLogEvents
    GetLogEvents (GetLogEvents'),
    newGetLogEvents,
    GetLogEventsResponse (GetLogEventsResponse'),
    newGetLogEventsResponse,

    -- ** DescribeLogGroups (Paginated)
    DescribeLogGroups (DescribeLogGroups'),
    newDescribeLogGroups,
    DescribeLogGroupsResponse (DescribeLogGroupsResponse'),
    newDescribeLogGroupsResponse,

    -- ** DeleteDestination
    DeleteDestination (DeleteDestination'),
    newDeleteDestination,
    DeleteDestinationResponse (DeleteDestinationResponse'),
    newDeleteDestinationResponse,

    -- ** DisassociateKmsKey
    DisassociateKmsKey (DisassociateKmsKey'),
    newDisassociateKmsKey,
    DisassociateKmsKeyResponse (DisassociateKmsKeyResponse'),
    newDisassociateKmsKeyResponse,

    -- ** FilterLogEvents (Paginated)
    FilterLogEvents (FilterLogEvents'),
    newFilterLogEvents,
    FilterLogEventsResponse (FilterLogEventsResponse'),
    newFilterLogEventsResponse,

    -- ** DeleteQueryDefinition
    DeleteQueryDefinition (DeleteQueryDefinition'),
    newDeleteQueryDefinition,
    DeleteQueryDefinitionResponse (DeleteQueryDefinitionResponse'),
    newDeleteQueryDefinitionResponse,

    -- ** PutQueryDefinition
    PutQueryDefinition (PutQueryDefinition'),
    newPutQueryDefinition,
    PutQueryDefinitionResponse (PutQueryDefinitionResponse'),
    newPutQueryDefinitionResponse,

    -- ** TagLogGroup
    TagLogGroup (TagLogGroup'),
    newTagLogGroup,
    TagLogGroupResponse (TagLogGroupResponse'),
    newTagLogGroupResponse,

    -- ** DescribeResourcePolicies (Paginated)
    DescribeResourcePolicies (DescribeResourcePolicies'),
    newDescribeResourcePolicies,
    DescribeResourcePoliciesResponse (DescribeResourcePoliciesResponse'),
    newDescribeResourcePoliciesResponse,

    -- ** DescribeQueryDefinitions
    DescribeQueryDefinitions (DescribeQueryDefinitions'),
    newDescribeQueryDefinitions,
    DescribeQueryDefinitionsResponse (DescribeQueryDefinitionsResponse'),
    newDescribeQueryDefinitionsResponse,

    -- ** DeleteLogStream
    DeleteLogStream (DeleteLogStream'),
    newDeleteLogStream,
    DeleteLogStreamResponse (DeleteLogStreamResponse'),
    newDeleteLogStreamResponse,

    -- ** DescribeQueries (Paginated)
    DescribeQueries (DescribeQueries'),
    newDescribeQueries,
    DescribeQueriesResponse (DescribeQueriesResponse'),
    newDescribeQueriesResponse,

    -- ** CreateLogStream
    CreateLogStream (CreateLogStream'),
    newCreateLogStream,
    CreateLogStreamResponse (CreateLogStreamResponse'),
    newCreateLogStreamResponse,

    -- ** CreateLogGroup
    CreateLogGroup (CreateLogGroup'),
    newCreateLogGroup,
    CreateLogGroupResponse (CreateLogGroupResponse'),
    newCreateLogGroupResponse,

    -- ** DescribeExportTasks (Paginated)
    DescribeExportTasks (DescribeExportTasks'),
    newDescribeExportTasks,
    DescribeExportTasksResponse (DescribeExportTasksResponse'),
    newDescribeExportTasksResponse,

    -- ** CancelExportTask
    CancelExportTask (CancelExportTask'),
    newCancelExportTask,
    CancelExportTaskResponse (CancelExportTaskResponse'),
    newCancelExportTaskResponse,

    -- ** PutSubscriptionFilter
    PutSubscriptionFilter (PutSubscriptionFilter'),
    newPutSubscriptionFilter,
    PutSubscriptionFilterResponse (PutSubscriptionFilterResponse'),
    newPutSubscriptionFilterResponse,

    -- ** StartQuery
    StartQuery (StartQuery'),
    newStartQuery,
    StartQueryResponse (StartQueryResponse'),
    newStartQueryResponse,

    -- ** DeleteLogGroup
    DeleteLogGroup (DeleteLogGroup'),
    newDeleteLogGroup,
    DeleteLogGroupResponse (DeleteLogGroupResponse'),
    newDeleteLogGroupResponse,

    -- ** DeleteSubscriptionFilter
    DeleteSubscriptionFilter (DeleteSubscriptionFilter'),
    newDeleteSubscriptionFilter,
    DeleteSubscriptionFilterResponse (DeleteSubscriptionFilterResponse'),
    newDeleteSubscriptionFilterResponse,

    -- ** PutLogEvents
    PutLogEvents (PutLogEvents'),
    newPutLogEvents,
    PutLogEventsResponse (PutLogEventsResponse'),
    newPutLogEventsResponse,

    -- ** DescribeMetricFilters (Paginated)
    DescribeMetricFilters (DescribeMetricFilters'),
    newDescribeMetricFilters,
    DescribeMetricFiltersResponse (DescribeMetricFiltersResponse'),
    newDescribeMetricFiltersResponse,

    -- ** TestMetricFilter
    TestMetricFilter (TestMetricFilter'),
    newTestMetricFilter,
    TestMetricFilterResponse (TestMetricFilterResponse'),
    newTestMetricFilterResponse,

    -- ** PutDestinationPolicy
    PutDestinationPolicy (PutDestinationPolicy'),
    newPutDestinationPolicy,
    PutDestinationPolicyResponse (PutDestinationPolicyResponse'),
    newPutDestinationPolicyResponse,

    -- ** PutMetricFilter
    PutMetricFilter (PutMetricFilter'),
    newPutMetricFilter,
    PutMetricFilterResponse (PutMetricFilterResponse'),
    newPutMetricFilterResponse,

    -- ** DeleteRetentionPolicy
    DeleteRetentionPolicy (DeleteRetentionPolicy'),
    newDeleteRetentionPolicy,
    DeleteRetentionPolicyResponse (DeleteRetentionPolicyResponse'),
    newDeleteRetentionPolicyResponse,

    -- ** DeleteMetricFilter
    DeleteMetricFilter (DeleteMetricFilter'),
    newDeleteMetricFilter,
    DeleteMetricFilterResponse (DeleteMetricFilterResponse'),
    newDeleteMetricFilterResponse,

    -- ** PutRetentionPolicy
    PutRetentionPolicy (PutRetentionPolicy'),
    newPutRetentionPolicy,
    PutRetentionPolicyResponse (PutRetentionPolicyResponse'),
    newPutRetentionPolicyResponse,

    -- ** ListTagsLogGroup
    ListTagsLogGroup (ListTagsLogGroup'),
    newListTagsLogGroup,
    ListTagsLogGroupResponse (ListTagsLogGroupResponse'),
    newListTagsLogGroupResponse,

    -- ** PutResourcePolicy
    PutResourcePolicy (PutResourcePolicy'),
    newPutResourcePolicy,
    PutResourcePolicyResponse (PutResourcePolicyResponse'),
    newPutResourcePolicyResponse,

    -- ** DeleteResourcePolicy
    DeleteResourcePolicy (DeleteResourcePolicy'),
    newDeleteResourcePolicy,
    DeleteResourcePolicyResponse (DeleteResourcePolicyResponse'),
    newDeleteResourcePolicyResponse,

    -- ** AssociateKmsKey
    AssociateKmsKey (AssociateKmsKey'),
    newAssociateKmsKey,
    AssociateKmsKeyResponse (AssociateKmsKeyResponse'),
    newAssociateKmsKeyResponse,

    -- ** GetQueryResults
    GetQueryResults (GetQueryResults'),
    newGetQueryResults,
    GetQueryResultsResponse (GetQueryResultsResponse'),
    newGetQueryResultsResponse,

    -- ** DescribeLogStreams (Paginated)
    DescribeLogStreams (DescribeLogStreams'),
    newDescribeLogStreams,
    DescribeLogStreamsResponse (DescribeLogStreamsResponse'),
    newDescribeLogStreamsResponse,

    -- * Types

    -- ** Distribution
    Distribution (..),

    -- ** ExportTaskStatusCode
    ExportTaskStatusCode (..),

    -- ** OrderBy
    OrderBy (..),

    -- ** QueryStatus
    QueryStatus (..),

    -- ** StandardUnit
    StandardUnit (..),

    -- ** Destination
    Destination (Destination'),
    newDestination,

    -- ** ExportTask
    ExportTask (ExportTask'),
    newExportTask,

    -- ** ExportTaskExecutionInfo
    ExportTaskExecutionInfo (ExportTaskExecutionInfo'),
    newExportTaskExecutionInfo,

    -- ** ExportTaskStatus
    ExportTaskStatus (ExportTaskStatus'),
    newExportTaskStatus,

    -- ** FilteredLogEvent
    FilteredLogEvent (FilteredLogEvent'),
    newFilteredLogEvent,

    -- ** InputLogEvent
    InputLogEvent (InputLogEvent'),
    newInputLogEvent,

    -- ** LogGroup
    LogGroup (LogGroup'),
    newLogGroup,

    -- ** LogGroupField
    LogGroupField (LogGroupField'),
    newLogGroupField,

    -- ** LogStream
    LogStream (LogStream'),
    newLogStream,

    -- ** MetricFilter
    MetricFilter (MetricFilter'),
    newMetricFilter,

    -- ** MetricFilterMatchRecord
    MetricFilterMatchRecord (MetricFilterMatchRecord'),
    newMetricFilterMatchRecord,

    -- ** MetricTransformation
    MetricTransformation (MetricTransformation'),
    newMetricTransformation,

    -- ** OutputLogEvent
    OutputLogEvent (OutputLogEvent'),
    newOutputLogEvent,

    -- ** QueryDefinition
    QueryDefinition (QueryDefinition'),
    newQueryDefinition,

    -- ** QueryInfo
    QueryInfo (QueryInfo'),
    newQueryInfo,

    -- ** QueryStatistics
    QueryStatistics (QueryStatistics'),
    newQueryStatistics,

    -- ** RejectedLogEventsInfo
    RejectedLogEventsInfo (RejectedLogEventsInfo'),
    newRejectedLogEventsInfo,

    -- ** ResourcePolicy
    ResourcePolicy (ResourcePolicy'),
    newResourcePolicy,

    -- ** ResultField
    ResultField (ResultField'),
    newResultField,

    -- ** SearchedLogStream
    SearchedLogStream (SearchedLogStream'),
    newSearchedLogStream,

    -- ** SubscriptionFilter
    SubscriptionFilter (SubscriptionFilter'),
    newSubscriptionFilter,
  )
where

import Amazonka.CloudWatchLogs.AssociateKmsKey
import Amazonka.CloudWatchLogs.CancelExportTask
import Amazonka.CloudWatchLogs.CreateExportTask
import Amazonka.CloudWatchLogs.CreateLogGroup
import Amazonka.CloudWatchLogs.CreateLogStream
import Amazonka.CloudWatchLogs.DeleteDestination
import Amazonka.CloudWatchLogs.DeleteLogGroup
import Amazonka.CloudWatchLogs.DeleteLogStream
import Amazonka.CloudWatchLogs.DeleteMetricFilter
import Amazonka.CloudWatchLogs.DeleteQueryDefinition
import Amazonka.CloudWatchLogs.DeleteResourcePolicy
import Amazonka.CloudWatchLogs.DeleteRetentionPolicy
import Amazonka.CloudWatchLogs.DeleteSubscriptionFilter
import Amazonka.CloudWatchLogs.DescribeDestinations
import Amazonka.CloudWatchLogs.DescribeExportTasks
import Amazonka.CloudWatchLogs.DescribeLogGroups
import Amazonka.CloudWatchLogs.DescribeLogStreams
import Amazonka.CloudWatchLogs.DescribeMetricFilters
import Amazonka.CloudWatchLogs.DescribeQueries
import Amazonka.CloudWatchLogs.DescribeQueryDefinitions
import Amazonka.CloudWatchLogs.DescribeResourcePolicies
import Amazonka.CloudWatchLogs.DescribeSubscriptionFilters
import Amazonka.CloudWatchLogs.DisassociateKmsKey
import Amazonka.CloudWatchLogs.FilterLogEvents
import Amazonka.CloudWatchLogs.GetLogEvents
import Amazonka.CloudWatchLogs.GetLogGroupFields
import Amazonka.CloudWatchLogs.GetLogRecord
import Amazonka.CloudWatchLogs.GetQueryResults
import Amazonka.CloudWatchLogs.Lens
import Amazonka.CloudWatchLogs.ListTagsLogGroup
import Amazonka.CloudWatchLogs.PutDestination
import Amazonka.CloudWatchLogs.PutDestinationPolicy
import Amazonka.CloudWatchLogs.PutLogEvents
import Amazonka.CloudWatchLogs.PutMetricFilter
import Amazonka.CloudWatchLogs.PutQueryDefinition
import Amazonka.CloudWatchLogs.PutResourcePolicy
import Amazonka.CloudWatchLogs.PutRetentionPolicy
import Amazonka.CloudWatchLogs.PutSubscriptionFilter
import Amazonka.CloudWatchLogs.StartQuery
import Amazonka.CloudWatchLogs.StopQuery
import Amazonka.CloudWatchLogs.TagLogGroup
import Amazonka.CloudWatchLogs.TestMetricFilter
import Amazonka.CloudWatchLogs.Types
import Amazonka.CloudWatchLogs.UntagLogGroup
import Amazonka.CloudWatchLogs.Waiters

-- $errors
-- Error matchers are designed for use with the functions provided by
-- <http://hackage.haskell.org/package/lens/docs/Control-Exception-Lens.html Control.Exception.Lens>.
-- This allows catching (and rethrowing) service specific errors returned
-- by 'CloudWatchLogs'.

-- $operations
-- Some AWS operations return results that are incomplete and require subsequent
-- requests in order to obtain the entire result set. The process of sending
-- subsequent requests to continue where a previous request left off is called
-- pagination. For example, the 'ListObjects' operation of Amazon S3 returns up to
-- 1000 objects at a time, and you must send subsequent requests with the
-- appropriate Marker in order to retrieve the next page of results.
--
-- Operations that have an 'AWSPager' instance can transparently perform subsequent
-- requests, correctly setting Markers and other request facets to iterate through
-- the entire result set of a truncated API operation. Operations which support
-- this have an additional note in the documentation.
--
-- Many operations have the ability to filter results on the server side. See the
-- individual operation parameters for details.

-- $waiters
-- Waiters poll by repeatedly sending a request until some remote success condition
-- configured by the 'Wait' specification is fulfilled. The 'Wait' specification
-- determines how many attempts should be made, in addition to delay and retry strategies.