{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecurityLake.CreateCustomLogSource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Adds a third-party custom source in Amazon Security Lake, from the
-- Amazon Web Services Region where you want to create a custom source.
-- Security Lake can collect logs and events from third-party custom
-- sources. After creating the appropriate IAM role to invoke Glue crawler,
-- use this API to add a custom source name in Security Lake. This
-- operation creates a partition in the Amazon S3 bucket for Security Lake
-- as the target location for log files from the custom source in addition
-- to an associated Glue table and an Glue crawler.
module Amazonka.SecurityLake.CreateCustomLogSource
  ( -- * Creating a Request
    CreateCustomLogSource (..),
    newCreateCustomLogSource,

    -- * Request Lenses
    createCustomLogSource_customSourceName,
    createCustomLogSource_eventClass,
    createCustomLogSource_glueInvocationRoleArn,
    createCustomLogSource_logProviderAccountId,

    -- * Destructuring the Response
    CreateCustomLogSourceResponse (..),
    newCreateCustomLogSourceResponse,

    -- * Response Lenses
    createCustomLogSourceResponse_httpStatus,
    createCustomLogSourceResponse_customDataLocation,
    createCustomLogSourceResponse_glueCrawlerName,
    createCustomLogSourceResponse_glueDatabaseName,
    createCustomLogSourceResponse_glueTableName,
    createCustomLogSourceResponse_logProviderAccessRoleArn,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecurityLake.Types

-- | /See:/ 'newCreateCustomLogSource' smart constructor.
data CreateCustomLogSource = CreateCustomLogSource'
  { -- | The name for a third-party custom source. This must be a Regionally
    -- unique value.
    CreateCustomLogSource -> Text
customSourceName :: Prelude.Text,
    -- | The Open Cybersecurity Schema Framework (OCSF) event class which
    -- describes the type of data that the custom source will send to Security
    -- Lake.
    CreateCustomLogSource -> OcsfEventClass
eventClass :: OcsfEventClass,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role to be used by the Glue crawler. The recommended IAM policies
    -- are:
    --
    -- -   The managed policy @AWSGlueServiceRole@
    --
    -- -   A custom policy granting access to your Amazon S3 Data Lake
    CreateCustomLogSource -> Text
glueInvocationRoleArn :: Prelude.Text,
    -- | The Amazon Web Services account ID of the custom source that will write
    -- logs and events into the Amazon S3 Data Lake.
    CreateCustomLogSource -> Text
logProviderAccountId :: Prelude.Text
  }
  deriving (CreateCustomLogSource -> CreateCustomLogSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomLogSource -> CreateCustomLogSource -> Bool
$c/= :: CreateCustomLogSource -> CreateCustomLogSource -> Bool
== :: CreateCustomLogSource -> CreateCustomLogSource -> Bool
$c== :: CreateCustomLogSource -> CreateCustomLogSource -> Bool
Prelude.Eq, ReadPrec [CreateCustomLogSource]
ReadPrec CreateCustomLogSource
Int -> ReadS CreateCustomLogSource
ReadS [CreateCustomLogSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomLogSource]
$creadListPrec :: ReadPrec [CreateCustomLogSource]
readPrec :: ReadPrec CreateCustomLogSource
$creadPrec :: ReadPrec CreateCustomLogSource
readList :: ReadS [CreateCustomLogSource]
$creadList :: ReadS [CreateCustomLogSource]
readsPrec :: Int -> ReadS CreateCustomLogSource
$creadsPrec :: Int -> ReadS CreateCustomLogSource
Prelude.Read, Int -> CreateCustomLogSource -> ShowS
[CreateCustomLogSource] -> ShowS
CreateCustomLogSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomLogSource] -> ShowS
$cshowList :: [CreateCustomLogSource] -> ShowS
show :: CreateCustomLogSource -> String
$cshow :: CreateCustomLogSource -> String
showsPrec :: Int -> CreateCustomLogSource -> ShowS
$cshowsPrec :: Int -> CreateCustomLogSource -> ShowS
Prelude.Show, forall x. Rep CreateCustomLogSource x -> CreateCustomLogSource
forall x. CreateCustomLogSource -> Rep CreateCustomLogSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCustomLogSource x -> CreateCustomLogSource
$cfrom :: forall x. CreateCustomLogSource -> Rep CreateCustomLogSource x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomLogSource' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'customSourceName', 'createCustomLogSource_customSourceName' - The name for a third-party custom source. This must be a Regionally
-- unique value.
--
-- 'eventClass', 'createCustomLogSource_eventClass' - The Open Cybersecurity Schema Framework (OCSF) event class which
-- describes the type of data that the custom source will send to Security
-- Lake.
--
-- 'glueInvocationRoleArn', 'createCustomLogSource_glueInvocationRoleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be used by the Glue crawler. The recommended IAM policies
-- are:
--
-- -   The managed policy @AWSGlueServiceRole@
--
-- -   A custom policy granting access to your Amazon S3 Data Lake
--
-- 'logProviderAccountId', 'createCustomLogSource_logProviderAccountId' - The Amazon Web Services account ID of the custom source that will write
-- logs and events into the Amazon S3 Data Lake.
newCreateCustomLogSource ::
  -- | 'customSourceName'
  Prelude.Text ->
  -- | 'eventClass'
  OcsfEventClass ->
  -- | 'glueInvocationRoleArn'
  Prelude.Text ->
  -- | 'logProviderAccountId'
  Prelude.Text ->
  CreateCustomLogSource
newCreateCustomLogSource :: Text -> OcsfEventClass -> Text -> Text -> CreateCustomLogSource
newCreateCustomLogSource
  Text
pCustomSourceName_
  OcsfEventClass
pEventClass_
  Text
pGlueInvocationRoleArn_
  Text
pLogProviderAccountId_ =
    CreateCustomLogSource'
      { $sel:customSourceName:CreateCustomLogSource' :: Text
customSourceName =
          Text
pCustomSourceName_,
        $sel:eventClass:CreateCustomLogSource' :: OcsfEventClass
eventClass = OcsfEventClass
pEventClass_,
        $sel:glueInvocationRoleArn:CreateCustomLogSource' :: Text
glueInvocationRoleArn = Text
pGlueInvocationRoleArn_,
        $sel:logProviderAccountId:CreateCustomLogSource' :: Text
logProviderAccountId = Text
pLogProviderAccountId_
      }

-- | The name for a third-party custom source. This must be a Regionally
-- unique value.
createCustomLogSource_customSourceName :: Lens.Lens' CreateCustomLogSource Prelude.Text
createCustomLogSource_customSourceName :: Lens' CreateCustomLogSource Text
createCustomLogSource_customSourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSource' {Text
customSourceName :: Text
$sel:customSourceName:CreateCustomLogSource' :: CreateCustomLogSource -> Text
customSourceName} -> Text
customSourceName) (\s :: CreateCustomLogSource
s@CreateCustomLogSource' {} Text
a -> CreateCustomLogSource
s {$sel:customSourceName:CreateCustomLogSource' :: Text
customSourceName = Text
a} :: CreateCustomLogSource)

-- | The Open Cybersecurity Schema Framework (OCSF) event class which
-- describes the type of data that the custom source will send to Security
-- Lake.
createCustomLogSource_eventClass :: Lens.Lens' CreateCustomLogSource OcsfEventClass
createCustomLogSource_eventClass :: Lens' CreateCustomLogSource OcsfEventClass
createCustomLogSource_eventClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSource' {OcsfEventClass
eventClass :: OcsfEventClass
$sel:eventClass:CreateCustomLogSource' :: CreateCustomLogSource -> OcsfEventClass
eventClass} -> OcsfEventClass
eventClass) (\s :: CreateCustomLogSource
s@CreateCustomLogSource' {} OcsfEventClass
a -> CreateCustomLogSource
s {$sel:eventClass:CreateCustomLogSource' :: OcsfEventClass
eventClass = OcsfEventClass
a} :: CreateCustomLogSource)

-- | The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be used by the Glue crawler. The recommended IAM policies
-- are:
--
-- -   The managed policy @AWSGlueServiceRole@
--
-- -   A custom policy granting access to your Amazon S3 Data Lake
createCustomLogSource_glueInvocationRoleArn :: Lens.Lens' CreateCustomLogSource Prelude.Text
createCustomLogSource_glueInvocationRoleArn :: Lens' CreateCustomLogSource Text
createCustomLogSource_glueInvocationRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSource' {Text
glueInvocationRoleArn :: Text
$sel:glueInvocationRoleArn:CreateCustomLogSource' :: CreateCustomLogSource -> Text
glueInvocationRoleArn} -> Text
glueInvocationRoleArn) (\s :: CreateCustomLogSource
s@CreateCustomLogSource' {} Text
a -> CreateCustomLogSource
s {$sel:glueInvocationRoleArn:CreateCustomLogSource' :: Text
glueInvocationRoleArn = Text
a} :: CreateCustomLogSource)

-- | The Amazon Web Services account ID of the custom source that will write
-- logs and events into the Amazon S3 Data Lake.
createCustomLogSource_logProviderAccountId :: Lens.Lens' CreateCustomLogSource Prelude.Text
createCustomLogSource_logProviderAccountId :: Lens' CreateCustomLogSource Text
createCustomLogSource_logProviderAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSource' {Text
logProviderAccountId :: Text
$sel:logProviderAccountId:CreateCustomLogSource' :: CreateCustomLogSource -> Text
logProviderAccountId} -> Text
logProviderAccountId) (\s :: CreateCustomLogSource
s@CreateCustomLogSource' {} Text
a -> CreateCustomLogSource
s {$sel:logProviderAccountId:CreateCustomLogSource' :: Text
logProviderAccountId = Text
a} :: CreateCustomLogSource)

instance Core.AWSRequest CreateCustomLogSource where
  type
    AWSResponse CreateCustomLogSource =
      CreateCustomLogSourceResponse
  request :: (Service -> Service)
-> CreateCustomLogSource -> Request CreateCustomLogSource
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateCustomLogSource
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCustomLogSource)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateCustomLogSourceResponse
CreateCustomLogSourceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"customDataLocation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"glueCrawlerName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"glueDatabaseName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"glueTableName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"logProviderAccessRoleArn")
      )

instance Prelude.Hashable CreateCustomLogSource where
  hashWithSalt :: Int -> CreateCustomLogSource -> Int
hashWithSalt Int
_salt CreateCustomLogSource' {Text
OcsfEventClass
logProviderAccountId :: Text
glueInvocationRoleArn :: Text
eventClass :: OcsfEventClass
customSourceName :: Text
$sel:logProviderAccountId:CreateCustomLogSource' :: CreateCustomLogSource -> Text
$sel:glueInvocationRoleArn:CreateCustomLogSource' :: CreateCustomLogSource -> Text
$sel:eventClass:CreateCustomLogSource' :: CreateCustomLogSource -> OcsfEventClass
$sel:customSourceName:CreateCustomLogSource' :: CreateCustomLogSource -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
customSourceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OcsfEventClass
eventClass
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
glueInvocationRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
logProviderAccountId

instance Prelude.NFData CreateCustomLogSource where
  rnf :: CreateCustomLogSource -> ()
rnf CreateCustomLogSource' {Text
OcsfEventClass
logProviderAccountId :: Text
glueInvocationRoleArn :: Text
eventClass :: OcsfEventClass
customSourceName :: Text
$sel:logProviderAccountId:CreateCustomLogSource' :: CreateCustomLogSource -> Text
$sel:glueInvocationRoleArn:CreateCustomLogSource' :: CreateCustomLogSource -> Text
$sel:eventClass:CreateCustomLogSource' :: CreateCustomLogSource -> OcsfEventClass
$sel:customSourceName:CreateCustomLogSource' :: CreateCustomLogSource -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
customSourceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OcsfEventClass
eventClass
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
glueInvocationRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
logProviderAccountId

instance Data.ToHeaders CreateCustomLogSource where
  toHeaders :: CreateCustomLogSource -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateCustomLogSource where
  toJSON :: CreateCustomLogSource -> Value
toJSON CreateCustomLogSource' {Text
OcsfEventClass
logProviderAccountId :: Text
glueInvocationRoleArn :: Text
eventClass :: OcsfEventClass
customSourceName :: Text
$sel:logProviderAccountId:CreateCustomLogSource' :: CreateCustomLogSource -> Text
$sel:glueInvocationRoleArn:CreateCustomLogSource' :: CreateCustomLogSource -> Text
$sel:eventClass:CreateCustomLogSource' :: CreateCustomLogSource -> OcsfEventClass
$sel:customSourceName:CreateCustomLogSource' :: CreateCustomLogSource -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"customSourceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
customSourceName),
            forall a. a -> Maybe a
Prelude.Just (Key
"eventClass" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OcsfEventClass
eventClass),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"glueInvocationRoleArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
glueInvocationRoleArn
              ),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"logProviderAccountId"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
logProviderAccountId
              )
          ]
      )

instance Data.ToPath CreateCustomLogSource where
  toPath :: CreateCustomLogSource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v1/logsources/custom"

instance Data.ToQuery CreateCustomLogSource where
  toQuery :: CreateCustomLogSource -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateCustomLogSourceResponse' smart constructor.
data CreateCustomLogSourceResponse = CreateCustomLogSourceResponse'
  { -- | The response's http status code.
    CreateCustomLogSourceResponse -> Int
httpStatus :: Prelude.Int,
    -- | The location of the partition in the Amazon S3 bucket for Security Lake.
    CreateCustomLogSourceResponse -> Text
customDataLocation :: Prelude.Text,
    -- | The name of the Glue crawler.
    CreateCustomLogSourceResponse -> Text
glueCrawlerName :: Prelude.Text,
    -- | The Glue database where results are written, such as:
    -- @arn:aws:daylight:us-east-1::database\/sometable\/*@.
    CreateCustomLogSourceResponse -> Text
glueDatabaseName :: Prelude.Text,
    -- | The table name of the Glue crawler.
    CreateCustomLogSourceResponse -> Text
glueTableName :: Prelude.Text,
    -- | The ARN of the IAM role to be used by the entity putting logs into your
    -- custom source partition. Security Lake will apply the correct access
    -- policies to this role, but you must first manually create the trust
    -- policy for this role. The IAM role name must start with the text
    -- \'Security Lake\'. The IAM role must trust the @logProviderAccountId@ to
    -- assume the role.
    CreateCustomLogSourceResponse -> Text
logProviderAccessRoleArn :: Prelude.Text
  }
  deriving (CreateCustomLogSourceResponse
-> CreateCustomLogSourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomLogSourceResponse
-> CreateCustomLogSourceResponse -> Bool
$c/= :: CreateCustomLogSourceResponse
-> CreateCustomLogSourceResponse -> Bool
== :: CreateCustomLogSourceResponse
-> CreateCustomLogSourceResponse -> Bool
$c== :: CreateCustomLogSourceResponse
-> CreateCustomLogSourceResponse -> Bool
Prelude.Eq, ReadPrec [CreateCustomLogSourceResponse]
ReadPrec CreateCustomLogSourceResponse
Int -> ReadS CreateCustomLogSourceResponse
ReadS [CreateCustomLogSourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomLogSourceResponse]
$creadListPrec :: ReadPrec [CreateCustomLogSourceResponse]
readPrec :: ReadPrec CreateCustomLogSourceResponse
$creadPrec :: ReadPrec CreateCustomLogSourceResponse
readList :: ReadS [CreateCustomLogSourceResponse]
$creadList :: ReadS [CreateCustomLogSourceResponse]
readsPrec :: Int -> ReadS CreateCustomLogSourceResponse
$creadsPrec :: Int -> ReadS CreateCustomLogSourceResponse
Prelude.Read, Int -> CreateCustomLogSourceResponse -> ShowS
[CreateCustomLogSourceResponse] -> ShowS
CreateCustomLogSourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomLogSourceResponse] -> ShowS
$cshowList :: [CreateCustomLogSourceResponse] -> ShowS
show :: CreateCustomLogSourceResponse -> String
$cshow :: CreateCustomLogSourceResponse -> String
showsPrec :: Int -> CreateCustomLogSourceResponse -> ShowS
$cshowsPrec :: Int -> CreateCustomLogSourceResponse -> ShowS
Prelude.Show, forall x.
Rep CreateCustomLogSourceResponse x
-> CreateCustomLogSourceResponse
forall x.
CreateCustomLogSourceResponse
-> Rep CreateCustomLogSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomLogSourceResponse x
-> CreateCustomLogSourceResponse
$cfrom :: forall x.
CreateCustomLogSourceResponse
-> Rep CreateCustomLogSourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomLogSourceResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'createCustomLogSourceResponse_httpStatus' - The response's http status code.
--
-- 'customDataLocation', 'createCustomLogSourceResponse_customDataLocation' - The location of the partition in the Amazon S3 bucket for Security Lake.
--
-- 'glueCrawlerName', 'createCustomLogSourceResponse_glueCrawlerName' - The name of the Glue crawler.
--
-- 'glueDatabaseName', 'createCustomLogSourceResponse_glueDatabaseName' - The Glue database where results are written, such as:
-- @arn:aws:daylight:us-east-1::database\/sometable\/*@.
--
-- 'glueTableName', 'createCustomLogSourceResponse_glueTableName' - The table name of the Glue crawler.
--
-- 'logProviderAccessRoleArn', 'createCustomLogSourceResponse_logProviderAccessRoleArn' - The ARN of the IAM role to be used by the entity putting logs into your
-- custom source partition. Security Lake will apply the correct access
-- policies to this role, but you must first manually create the trust
-- policy for this role. The IAM role name must start with the text
-- \'Security Lake\'. The IAM role must trust the @logProviderAccountId@ to
-- assume the role.
newCreateCustomLogSourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'customDataLocation'
  Prelude.Text ->
  -- | 'glueCrawlerName'
  Prelude.Text ->
  -- | 'glueDatabaseName'
  Prelude.Text ->
  -- | 'glueTableName'
  Prelude.Text ->
  -- | 'logProviderAccessRoleArn'
  Prelude.Text ->
  CreateCustomLogSourceResponse
newCreateCustomLogSourceResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateCustomLogSourceResponse
newCreateCustomLogSourceResponse
  Int
pHttpStatus_
  Text
pCustomDataLocation_
  Text
pGlueCrawlerName_
  Text
pGlueDatabaseName_
  Text
pGlueTableName_
  Text
pLogProviderAccessRoleArn_ =
    CreateCustomLogSourceResponse'
      { $sel:httpStatus:CreateCustomLogSourceResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:customDataLocation:CreateCustomLogSourceResponse' :: Text
customDataLocation = Text
pCustomDataLocation_,
        $sel:glueCrawlerName:CreateCustomLogSourceResponse' :: Text
glueCrawlerName = Text
pGlueCrawlerName_,
        $sel:glueDatabaseName:CreateCustomLogSourceResponse' :: Text
glueDatabaseName = Text
pGlueDatabaseName_,
        $sel:glueTableName:CreateCustomLogSourceResponse' :: Text
glueTableName = Text
pGlueTableName_,
        $sel:logProviderAccessRoleArn:CreateCustomLogSourceResponse' :: Text
logProviderAccessRoleArn =
          Text
pLogProviderAccessRoleArn_
      }

-- | The response's http status code.
createCustomLogSourceResponse_httpStatus :: Lens.Lens' CreateCustomLogSourceResponse Prelude.Int
createCustomLogSourceResponse_httpStatus :: Lens' CreateCustomLogSourceResponse Int
createCustomLogSourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateCustomLogSourceResponse
s@CreateCustomLogSourceResponse' {} Int
a -> CreateCustomLogSourceResponse
s {$sel:httpStatus:CreateCustomLogSourceResponse' :: Int
httpStatus = Int
a} :: CreateCustomLogSourceResponse)

-- | The location of the partition in the Amazon S3 bucket for Security Lake.
createCustomLogSourceResponse_customDataLocation :: Lens.Lens' CreateCustomLogSourceResponse Prelude.Text
createCustomLogSourceResponse_customDataLocation :: Lens' CreateCustomLogSourceResponse Text
createCustomLogSourceResponse_customDataLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSourceResponse' {Text
customDataLocation :: Text
$sel:customDataLocation:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
customDataLocation} -> Text
customDataLocation) (\s :: CreateCustomLogSourceResponse
s@CreateCustomLogSourceResponse' {} Text
a -> CreateCustomLogSourceResponse
s {$sel:customDataLocation:CreateCustomLogSourceResponse' :: Text
customDataLocation = Text
a} :: CreateCustomLogSourceResponse)

-- | The name of the Glue crawler.
createCustomLogSourceResponse_glueCrawlerName :: Lens.Lens' CreateCustomLogSourceResponse Prelude.Text
createCustomLogSourceResponse_glueCrawlerName :: Lens' CreateCustomLogSourceResponse Text
createCustomLogSourceResponse_glueCrawlerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSourceResponse' {Text
glueCrawlerName :: Text
$sel:glueCrawlerName:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
glueCrawlerName} -> Text
glueCrawlerName) (\s :: CreateCustomLogSourceResponse
s@CreateCustomLogSourceResponse' {} Text
a -> CreateCustomLogSourceResponse
s {$sel:glueCrawlerName:CreateCustomLogSourceResponse' :: Text
glueCrawlerName = Text
a} :: CreateCustomLogSourceResponse)

-- | The Glue database where results are written, such as:
-- @arn:aws:daylight:us-east-1::database\/sometable\/*@.
createCustomLogSourceResponse_glueDatabaseName :: Lens.Lens' CreateCustomLogSourceResponse Prelude.Text
createCustomLogSourceResponse_glueDatabaseName :: Lens' CreateCustomLogSourceResponse Text
createCustomLogSourceResponse_glueDatabaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSourceResponse' {Text
glueDatabaseName :: Text
$sel:glueDatabaseName:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
glueDatabaseName} -> Text
glueDatabaseName) (\s :: CreateCustomLogSourceResponse
s@CreateCustomLogSourceResponse' {} Text
a -> CreateCustomLogSourceResponse
s {$sel:glueDatabaseName:CreateCustomLogSourceResponse' :: Text
glueDatabaseName = Text
a} :: CreateCustomLogSourceResponse)

-- | The table name of the Glue crawler.
createCustomLogSourceResponse_glueTableName :: Lens.Lens' CreateCustomLogSourceResponse Prelude.Text
createCustomLogSourceResponse_glueTableName :: Lens' CreateCustomLogSourceResponse Text
createCustomLogSourceResponse_glueTableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSourceResponse' {Text
glueTableName :: Text
$sel:glueTableName:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
glueTableName} -> Text
glueTableName) (\s :: CreateCustomLogSourceResponse
s@CreateCustomLogSourceResponse' {} Text
a -> CreateCustomLogSourceResponse
s {$sel:glueTableName:CreateCustomLogSourceResponse' :: Text
glueTableName = Text
a} :: CreateCustomLogSourceResponse)

-- | The ARN of the IAM role to be used by the entity putting logs into your
-- custom source partition. Security Lake will apply the correct access
-- policies to this role, but you must first manually create the trust
-- policy for this role. The IAM role name must start with the text
-- \'Security Lake\'. The IAM role must trust the @logProviderAccountId@ to
-- assume the role.
createCustomLogSourceResponse_logProviderAccessRoleArn :: Lens.Lens' CreateCustomLogSourceResponse Prelude.Text
createCustomLogSourceResponse_logProviderAccessRoleArn :: Lens' CreateCustomLogSourceResponse Text
createCustomLogSourceResponse_logProviderAccessRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomLogSourceResponse' {Text
logProviderAccessRoleArn :: Text
$sel:logProviderAccessRoleArn:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
logProviderAccessRoleArn} -> Text
logProviderAccessRoleArn) (\s :: CreateCustomLogSourceResponse
s@CreateCustomLogSourceResponse' {} Text
a -> CreateCustomLogSourceResponse
s {$sel:logProviderAccessRoleArn:CreateCustomLogSourceResponse' :: Text
logProviderAccessRoleArn = Text
a} :: CreateCustomLogSourceResponse)

instance Prelude.NFData CreateCustomLogSourceResponse where
  rnf :: CreateCustomLogSourceResponse -> ()
rnf CreateCustomLogSourceResponse' {Int
Text
logProviderAccessRoleArn :: Text
glueTableName :: Text
glueDatabaseName :: Text
glueCrawlerName :: Text
customDataLocation :: Text
httpStatus :: Int
$sel:logProviderAccessRoleArn:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
$sel:glueTableName:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
$sel:glueDatabaseName:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
$sel:glueCrawlerName:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
$sel:customDataLocation:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Text
$sel:httpStatus:CreateCustomLogSourceResponse' :: CreateCustomLogSourceResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
customDataLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
glueCrawlerName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
glueDatabaseName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
glueTableName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
logProviderAccessRoleArn