{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.AuditManager.Types.SourceKeyword -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.AuditManager.Types.SourceKeyword where import Amazonka.AuditManager.Types.KeywordInputType 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 -- | The keyword to search for in CloudTrail logs, Config rules, Security Hub -- checks, and Amazon Web Services API names. -- -- To learn more about the supported keywords that you can use when mapping -- a control data source, see the following pages in the /Audit Manager -- User Guide/: -- -- - -- -- - -- -- - -- -- - -- -- /See:/ 'newSourceKeyword' smart constructor. data SourceKeyword = SourceKeyword' { -- | The input method for the keyword. keywordInputType :: Prelude.Maybe KeywordInputType, -- | The value of the keyword that\'s used when mapping a control data -- source. For example, this can be a CloudTrail event name, a rule name -- for Config, a Security Hub control, or the name of an Amazon Web -- Services API call. -- -- If you’re mapping a data source to a rule in Config, the @keywordValue@ -- that you specify depends on the type of rule: -- -- - For -- , -- you can use the rule identifier as the @keywordValue@. You can find -- the rule identifier from the -- . -- -- - Managed rule name: -- -- -- @keywordValue@: @S3_BUCKET_ACL_PROHIBITED@ -- -- - For -- , -- you form the @keywordValue@ by adding the @Custom_@ prefix to the -- rule name. This prefix distinguishes the rule from a managed rule. -- -- - Custom rule name: my-custom-config-rule -- -- @keywordValue@: @Custom_my-custom-config-rule@ -- -- - For -- , -- you form the @keywordValue@ by adding the @Custom_@ prefix to the -- rule name. In addition, you remove the suffix ID that appears at the -- end of the rule name. -- -- - Service-linked rule name: -- CustomRuleForAccount-conformance-pack-szsm1uv0w -- -- @keywordValue@: @Custom_CustomRuleForAccount-conformance-pack@ -- -- - Service-linked rule name: -- OrgConfigRule-s3-bucket-versioning-enabled-dbgzf8ba -- -- @keywordValue@: -- @Custom_OrgConfigRule-s3-bucket-versioning-enabled@ keywordValue :: Prelude.Maybe Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'SourceKeyword' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'keywordInputType', 'sourceKeyword_keywordInputType' - The input method for the keyword. -- -- 'keywordValue', 'sourceKeyword_keywordValue' - The value of the keyword that\'s used when mapping a control data -- source. For example, this can be a CloudTrail event name, a rule name -- for Config, a Security Hub control, or the name of an Amazon Web -- Services API call. -- -- If you’re mapping a data source to a rule in Config, the @keywordValue@ -- that you specify depends on the type of rule: -- -- - For -- , -- you can use the rule identifier as the @keywordValue@. You can find -- the rule identifier from the -- . -- -- - Managed rule name: -- -- -- @keywordValue@: @S3_BUCKET_ACL_PROHIBITED@ -- -- - For -- , -- you form the @keywordValue@ by adding the @Custom_@ prefix to the -- rule name. This prefix distinguishes the rule from a managed rule. -- -- - Custom rule name: my-custom-config-rule -- -- @keywordValue@: @Custom_my-custom-config-rule@ -- -- - For -- , -- you form the @keywordValue@ by adding the @Custom_@ prefix to the -- rule name. In addition, you remove the suffix ID that appears at the -- end of the rule name. -- -- - Service-linked rule name: -- CustomRuleForAccount-conformance-pack-szsm1uv0w -- -- @keywordValue@: @Custom_CustomRuleForAccount-conformance-pack@ -- -- - Service-linked rule name: -- OrgConfigRule-s3-bucket-versioning-enabled-dbgzf8ba -- -- @keywordValue@: -- @Custom_OrgConfigRule-s3-bucket-versioning-enabled@ newSourceKeyword :: SourceKeyword newSourceKeyword = SourceKeyword' { keywordInputType = Prelude.Nothing, keywordValue = Prelude.Nothing } -- | The input method for the keyword. sourceKeyword_keywordInputType :: Lens.Lens' SourceKeyword (Prelude.Maybe KeywordInputType) sourceKeyword_keywordInputType = Lens.lens (\SourceKeyword' {keywordInputType} -> keywordInputType) (\s@SourceKeyword' {} a -> s {keywordInputType = a} :: SourceKeyword) -- | The value of the keyword that\'s used when mapping a control data -- source. For example, this can be a CloudTrail event name, a rule name -- for Config, a Security Hub control, or the name of an Amazon Web -- Services API call. -- -- If you’re mapping a data source to a rule in Config, the @keywordValue@ -- that you specify depends on the type of rule: -- -- - For -- , -- you can use the rule identifier as the @keywordValue@. You can find -- the rule identifier from the -- . -- -- - Managed rule name: -- -- -- @keywordValue@: @S3_BUCKET_ACL_PROHIBITED@ -- -- - For -- , -- you form the @keywordValue@ by adding the @Custom_@ prefix to the -- rule name. This prefix distinguishes the rule from a managed rule. -- -- - Custom rule name: my-custom-config-rule -- -- @keywordValue@: @Custom_my-custom-config-rule@ -- -- - For -- , -- you form the @keywordValue@ by adding the @Custom_@ prefix to the -- rule name. In addition, you remove the suffix ID that appears at the -- end of the rule name. -- -- - Service-linked rule name: -- CustomRuleForAccount-conformance-pack-szsm1uv0w -- -- @keywordValue@: @Custom_CustomRuleForAccount-conformance-pack@ -- -- - Service-linked rule name: -- OrgConfigRule-s3-bucket-versioning-enabled-dbgzf8ba -- -- @keywordValue@: -- @Custom_OrgConfigRule-s3-bucket-versioning-enabled@ sourceKeyword_keywordValue :: Lens.Lens' SourceKeyword (Prelude.Maybe Prelude.Text) sourceKeyword_keywordValue = Lens.lens (\SourceKeyword' {keywordValue} -> keywordValue) (\s@SourceKeyword' {} a -> s {keywordValue = a} :: SourceKeyword) instance Data.FromJSON SourceKeyword where parseJSON = Data.withObject "SourceKeyword" ( \x -> SourceKeyword' Prelude.<$> (x Data..:? "keywordInputType") Prelude.<*> (x Data..:? "keywordValue") ) instance Prelude.Hashable SourceKeyword where hashWithSalt _salt SourceKeyword' {..} = _salt `Prelude.hashWithSalt` keywordInputType `Prelude.hashWithSalt` keywordValue instance Prelude.NFData SourceKeyword where rnf SourceKeyword' {..} = Prelude.rnf keywordInputType `Prelude.seq` Prelude.rnf keywordValue instance Data.ToJSON SourceKeyword where toJSON SourceKeyword' {..} = Data.object ( Prelude.catMaybes [ ("keywordInputType" Data..=) Prelude.<$> keywordInputType, ("keywordValue" Data..=) Prelude.<$> keywordValue ] )