{-# 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.FMS.Types.Policy
-- 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.FMS.Types.Policy where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types.CustomerPolicyScopeIdType
import Amazonka.FMS.Types.ResourceTag
import Amazonka.FMS.Types.SecurityServicePolicyData
import qualified Amazonka.Prelude as Prelude

-- | An Firewall Manager policy.
--
-- /See:/ 'newPolicy' smart constructor.
data Policy = Policy'
  { -- | Indicates whether Firewall Manager should automatically remove
    -- protections from resources that leave the policy scope and clean up
    -- resources that Firewall Manager is managing for accounts when those
    -- accounts leave policy scope. For example, Firewall Manager will
    -- disassociate a Firewall Manager managed web ACL from a protected
    -- customer resource when the customer resource leaves policy scope.
    --
    -- By default, Firewall Manager doesn\'t remove protections or delete
    -- Firewall Manager managed resources.
    --
    -- This option is not available for Shield Advanced or WAF Classic
    -- policies.
    Policy -> Maybe Bool
deleteUnusedFMManagedResources :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the Amazon Web Services account IDs and Organizations
    -- organizational units (OUs) to exclude from the policy. Specifying an OU
    -- is the equivalent of specifying all accounts in the OU and in any of its
    -- child OUs, including any child OUs and accounts that are added at a
    -- later time.
    --
    -- You can specify inclusions or exclusions, but not both. If you specify
    -- an @IncludeMap@, Firewall Manager applies the policy to all accounts
    -- specified by the @IncludeMap@, and does not evaluate any @ExcludeMap@
    -- specifications. If you do not specify an @IncludeMap@, then Firewall
    -- Manager applies the policy to all accounts except for those specified by
    -- the @ExcludeMap@.
    --
    -- You can specify account IDs, OUs, or a combination:
    --
    -- -   Specify account IDs by setting the key to @ACCOUNT@. For example,
    --     the following is a valid map:
    --     @{“ACCOUNT” : [“accountID1”, “accountID2”]}@.
    --
    -- -   Specify OUs by setting the key to @ORG_UNIT@. For example, the
    --     following is a valid map: @{“ORG_UNIT” : [“ouid111”, “ouid112”]}@.
    --
    -- -   Specify accounts and OUs together in a single map, separated with a
    --     comma. For example, the following is a valid map:
    --     @{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}@.
    Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]),
    -- | Specifies the Amazon Web Services account IDs and Organizations
    -- organizational units (OUs) to include in the policy. Specifying an OU is
    -- the equivalent of specifying all accounts in the OU and in any of its
    -- child OUs, including any child OUs and accounts that are added at a
    -- later time.
    --
    -- You can specify inclusions or exclusions, but not both. If you specify
    -- an @IncludeMap@, Firewall Manager applies the policy to all accounts
    -- specified by the @IncludeMap@, and does not evaluate any @ExcludeMap@
    -- specifications. If you do not specify an @IncludeMap@, then Firewall
    -- Manager applies the policy to all accounts except for those specified by
    -- the @ExcludeMap@.
    --
    -- You can specify account IDs, OUs, or a combination:
    --
    -- -   Specify account IDs by setting the key to @ACCOUNT@. For example,
    --     the following is a valid map:
    --     @{“ACCOUNT” : [“accountID1”, “accountID2”]}@.
    --
    -- -   Specify OUs by setting the key to @ORG_UNIT@. For example, the
    --     following is a valid map: @{“ORG_UNIT” : [“ouid111”, “ouid112”]}@.
    --
    -- -   Specify accounts and OUs together in a single map, separated with a
    --     comma. For example, the following is a valid map:
    --     @{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}@.
    Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap :: Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]),
    -- | The definition of the Network Firewall firewall policy.
    Policy -> Maybe Text
policyDescription :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Firewall Manager policy.
    Policy -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for each update to the policy. When issuing a
    -- @PutPolicy@ request, the @PolicyUpdateToken@ in the request must match
    -- the @PolicyUpdateToken@ of the current policy version. To get the
    -- @PolicyUpdateToken@ of the current policy version, use a @GetPolicy@
    -- request.
    Policy -> Maybe Text
policyUpdateToken :: Prelude.Maybe Prelude.Text,
    -- | The unique identifiers of the resource sets used by the policy.
    Policy -> Maybe [Text]
resourceSetIds :: Prelude.Maybe [Prelude.Text],
    -- | An array of @ResourceTag@ objects.
    Policy -> Maybe [ResourceTag]
resourceTags :: Prelude.Maybe [ResourceTag],
    -- | An array of @ResourceType@ objects. Use this only to specify multiple
    -- resource types. To specify a single resource type, use @ResourceType@.
    Policy -> Maybe [Text]
resourceTypeList :: Prelude.Maybe [Prelude.Text],
    -- | The name of the Firewall Manager policy.
    Policy -> Text
policyName :: Prelude.Text,
    -- | Details about the security service that is being used to protect the
    -- resources.
    Policy -> SecurityServicePolicyData
securityServicePolicyData :: SecurityServicePolicyData,
    -- | The type of resource protected by or in scope of the policy. This is in
    -- the format shown in the
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html Amazon Web Services Resource Types Reference>.
    -- To apply this policy to multiple resource types, specify a resource type
    -- of @ResourceTypeList@ and then specify the resource types in a
    -- @ResourceTypeList@.
    --
    -- For WAF and Shield Advanced, resource types include
    -- @AWS::ElasticLoadBalancingV2::LoadBalancer@,
    -- @AWS::ElasticLoadBalancing::LoadBalancer@, @AWS::EC2::EIP@, and
    -- @AWS::CloudFront::Distribution@. For a security group common policy,
    -- valid values are @AWS::EC2::NetworkInterface@ and @AWS::EC2::Instance@.
    -- For a security group content audit policy, valid values are
    -- @AWS::EC2::SecurityGroup@, @AWS::EC2::NetworkInterface@, and
    -- @AWS::EC2::Instance@. For a security group usage audit policy, the value
    -- is @AWS::EC2::SecurityGroup@. For an Network Firewall policy or DNS
    -- Firewall policy, the value is @AWS::EC2::VPC@.
    Policy -> Text
resourceType :: Prelude.Text,
    -- | If set to @True@, resources with the tags that are specified in the
    -- @ResourceTag@ array are not in scope of the policy. If set to @False@,
    -- and the @ResourceTag@ array is not null, only resources with the
    -- specified tags are in scope of the policy.
    Policy -> Bool
excludeResourceTags :: Prelude.Bool,
    -- | Indicates if the policy should be automatically applied to new
    -- resources.
    Policy -> Bool
remediationEnabled :: Prelude.Bool
  }
  deriving (Policy -> Policy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Policy -> Policy -> Bool
$c/= :: Policy -> Policy -> Bool
== :: Policy -> Policy -> Bool
$c== :: Policy -> Policy -> Bool
Prelude.Eq, ReadPrec [Policy]
ReadPrec Policy
Int -> ReadS Policy
ReadS [Policy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Policy]
$creadListPrec :: ReadPrec [Policy]
readPrec :: ReadPrec Policy
$creadPrec :: ReadPrec Policy
readList :: ReadS [Policy]
$creadList :: ReadS [Policy]
readsPrec :: Int -> ReadS Policy
$creadsPrec :: Int -> ReadS Policy
Prelude.Read, Int -> Policy -> ShowS
[Policy] -> ShowS
Policy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Policy] -> ShowS
$cshowList :: [Policy] -> ShowS
show :: Policy -> String
$cshow :: Policy -> String
showsPrec :: Int -> Policy -> ShowS
$cshowsPrec :: Int -> Policy -> ShowS
Prelude.Show, forall x. Rep Policy x -> Policy
forall x. Policy -> Rep Policy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Policy x -> Policy
$cfrom :: forall x. Policy -> Rep Policy x
Prelude.Generic)

-- |
-- Create a value of 'Policy' 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:
--
-- 'deleteUnusedFMManagedResources', 'policy_deleteUnusedFMManagedResources' - Indicates whether Firewall Manager should automatically remove
-- protections from resources that leave the policy scope and clean up
-- resources that Firewall Manager is managing for accounts when those
-- accounts leave policy scope. For example, Firewall Manager will
-- disassociate a Firewall Manager managed web ACL from a protected
-- customer resource when the customer resource leaves policy scope.
--
-- By default, Firewall Manager doesn\'t remove protections or delete
-- Firewall Manager managed resources.
--
-- This option is not available for Shield Advanced or WAF Classic
-- policies.
--
-- 'excludeMap', 'policy_excludeMap' - Specifies the Amazon Web Services account IDs and Organizations
-- organizational units (OUs) to exclude from the policy. Specifying an OU
-- is the equivalent of specifying all accounts in the OU and in any of its
-- child OUs, including any child OUs and accounts that are added at a
-- later time.
--
-- You can specify inclusions or exclusions, but not both. If you specify
-- an @IncludeMap@, Firewall Manager applies the policy to all accounts
-- specified by the @IncludeMap@, and does not evaluate any @ExcludeMap@
-- specifications. If you do not specify an @IncludeMap@, then Firewall
-- Manager applies the policy to all accounts except for those specified by
-- the @ExcludeMap@.
--
-- You can specify account IDs, OUs, or a combination:
--
-- -   Specify account IDs by setting the key to @ACCOUNT@. For example,
--     the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”]}@.
--
-- -   Specify OUs by setting the key to @ORG_UNIT@. For example, the
--     following is a valid map: @{“ORG_UNIT” : [“ouid111”, “ouid112”]}@.
--
-- -   Specify accounts and OUs together in a single map, separated with a
--     comma. For example, the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}@.
--
-- 'includeMap', 'policy_includeMap' - Specifies the Amazon Web Services account IDs and Organizations
-- organizational units (OUs) to include in the policy. Specifying an OU is
-- the equivalent of specifying all accounts in the OU and in any of its
-- child OUs, including any child OUs and accounts that are added at a
-- later time.
--
-- You can specify inclusions or exclusions, but not both. If you specify
-- an @IncludeMap@, Firewall Manager applies the policy to all accounts
-- specified by the @IncludeMap@, and does not evaluate any @ExcludeMap@
-- specifications. If you do not specify an @IncludeMap@, then Firewall
-- Manager applies the policy to all accounts except for those specified by
-- the @ExcludeMap@.
--
-- You can specify account IDs, OUs, or a combination:
--
-- -   Specify account IDs by setting the key to @ACCOUNT@. For example,
--     the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”]}@.
--
-- -   Specify OUs by setting the key to @ORG_UNIT@. For example, the
--     following is a valid map: @{“ORG_UNIT” : [“ouid111”, “ouid112”]}@.
--
-- -   Specify accounts and OUs together in a single map, separated with a
--     comma. For example, the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}@.
--
-- 'policyDescription', 'policy_policyDescription' - The definition of the Network Firewall firewall policy.
--
-- 'policyId', 'policy_policyId' - The ID of the Firewall Manager policy.
--
-- 'policyUpdateToken', 'policy_policyUpdateToken' - A unique identifier for each update to the policy. When issuing a
-- @PutPolicy@ request, the @PolicyUpdateToken@ in the request must match
-- the @PolicyUpdateToken@ of the current policy version. To get the
-- @PolicyUpdateToken@ of the current policy version, use a @GetPolicy@
-- request.
--
-- 'resourceSetIds', 'policy_resourceSetIds' - The unique identifiers of the resource sets used by the policy.
--
-- 'resourceTags', 'policy_resourceTags' - An array of @ResourceTag@ objects.
--
-- 'resourceTypeList', 'policy_resourceTypeList' - An array of @ResourceType@ objects. Use this only to specify multiple
-- resource types. To specify a single resource type, use @ResourceType@.
--
-- 'policyName', 'policy_policyName' - The name of the Firewall Manager policy.
--
-- 'securityServicePolicyData', 'policy_securityServicePolicyData' - Details about the security service that is being used to protect the
-- resources.
--
-- 'resourceType', 'policy_resourceType' - The type of resource protected by or in scope of the policy. This is in
-- the format shown in the
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html Amazon Web Services Resource Types Reference>.
-- To apply this policy to multiple resource types, specify a resource type
-- of @ResourceTypeList@ and then specify the resource types in a
-- @ResourceTypeList@.
--
-- For WAF and Shield Advanced, resource types include
-- @AWS::ElasticLoadBalancingV2::LoadBalancer@,
-- @AWS::ElasticLoadBalancing::LoadBalancer@, @AWS::EC2::EIP@, and
-- @AWS::CloudFront::Distribution@. For a security group common policy,
-- valid values are @AWS::EC2::NetworkInterface@ and @AWS::EC2::Instance@.
-- For a security group content audit policy, valid values are
-- @AWS::EC2::SecurityGroup@, @AWS::EC2::NetworkInterface@, and
-- @AWS::EC2::Instance@. For a security group usage audit policy, the value
-- is @AWS::EC2::SecurityGroup@. For an Network Firewall policy or DNS
-- Firewall policy, the value is @AWS::EC2::VPC@.
--
-- 'excludeResourceTags', 'policy_excludeResourceTags' - If set to @True@, resources with the tags that are specified in the
-- @ResourceTag@ array are not in scope of the policy. If set to @False@,
-- and the @ResourceTag@ array is not null, only resources with the
-- specified tags are in scope of the policy.
--
-- 'remediationEnabled', 'policy_remediationEnabled' - Indicates if the policy should be automatically applied to new
-- resources.
newPolicy ::
  -- | 'policyName'
  Prelude.Text ->
  -- | 'securityServicePolicyData'
  SecurityServicePolicyData ->
  -- | 'resourceType'
  Prelude.Text ->
  -- | 'excludeResourceTags'
  Prelude.Bool ->
  -- | 'remediationEnabled'
  Prelude.Bool ->
  Policy
newPolicy :: Text -> SecurityServicePolicyData -> Text -> Bool -> Bool -> Policy
newPolicy
  Text
pPolicyName_
  SecurityServicePolicyData
pSecurityServicePolicyData_
  Text
pResourceType_
  Bool
pExcludeResourceTags_
  Bool
pRemediationEnabled_ =
    Policy'
      { $sel:deleteUnusedFMManagedResources:Policy' :: Maybe Bool
deleteUnusedFMManagedResources =
          forall a. Maybe a
Prelude.Nothing,
        $sel:excludeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap = forall a. Maybe a
Prelude.Nothing,
        $sel:includeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap = forall a. Maybe a
Prelude.Nothing,
        $sel:policyDescription:Policy' :: Maybe Text
policyDescription = forall a. Maybe a
Prelude.Nothing,
        $sel:policyId:Policy' :: Maybe Text
policyId = forall a. Maybe a
Prelude.Nothing,
        $sel:policyUpdateToken:Policy' :: Maybe Text
policyUpdateToken = forall a. Maybe a
Prelude.Nothing,
        $sel:resourceSetIds:Policy' :: Maybe [Text]
resourceSetIds = forall a. Maybe a
Prelude.Nothing,
        $sel:resourceTags:Policy' :: Maybe [ResourceTag]
resourceTags = forall a. Maybe a
Prelude.Nothing,
        $sel:resourceTypeList:Policy' :: Maybe [Text]
resourceTypeList = forall a. Maybe a
Prelude.Nothing,
        $sel:policyName:Policy' :: Text
policyName = Text
pPolicyName_,
        $sel:securityServicePolicyData:Policy' :: SecurityServicePolicyData
securityServicePolicyData =
          SecurityServicePolicyData
pSecurityServicePolicyData_,
        $sel:resourceType:Policy' :: Text
resourceType = Text
pResourceType_,
        $sel:excludeResourceTags:Policy' :: Bool
excludeResourceTags = Bool
pExcludeResourceTags_,
        $sel:remediationEnabled:Policy' :: Bool
remediationEnabled = Bool
pRemediationEnabled_
      }

-- | Indicates whether Firewall Manager should automatically remove
-- protections from resources that leave the policy scope and clean up
-- resources that Firewall Manager is managing for accounts when those
-- accounts leave policy scope. For example, Firewall Manager will
-- disassociate a Firewall Manager managed web ACL from a protected
-- customer resource when the customer resource leaves policy scope.
--
-- By default, Firewall Manager doesn\'t remove protections or delete
-- Firewall Manager managed resources.
--
-- This option is not available for Shield Advanced or WAF Classic
-- policies.
policy_deleteUnusedFMManagedResources :: Lens.Lens' Policy (Prelude.Maybe Prelude.Bool)
policy_deleteUnusedFMManagedResources :: Lens' Policy (Maybe Bool)
policy_deleteUnusedFMManagedResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Bool
deleteUnusedFMManagedResources :: Maybe Bool
$sel:deleteUnusedFMManagedResources:Policy' :: Policy -> Maybe Bool
deleteUnusedFMManagedResources} -> Maybe Bool
deleteUnusedFMManagedResources) (\s :: Policy
s@Policy' {} Maybe Bool
a -> Policy
s {$sel:deleteUnusedFMManagedResources:Policy' :: Maybe Bool
deleteUnusedFMManagedResources = Maybe Bool
a} :: Policy)

-- | Specifies the Amazon Web Services account IDs and Organizations
-- organizational units (OUs) to exclude from the policy. Specifying an OU
-- is the equivalent of specifying all accounts in the OU and in any of its
-- child OUs, including any child OUs and accounts that are added at a
-- later time.
--
-- You can specify inclusions or exclusions, but not both. If you specify
-- an @IncludeMap@, Firewall Manager applies the policy to all accounts
-- specified by the @IncludeMap@, and does not evaluate any @ExcludeMap@
-- specifications. If you do not specify an @IncludeMap@, then Firewall
-- Manager applies the policy to all accounts except for those specified by
-- the @ExcludeMap@.
--
-- You can specify account IDs, OUs, or a combination:
--
-- -   Specify account IDs by setting the key to @ACCOUNT@. For example,
--     the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”]}@.
--
-- -   Specify OUs by setting the key to @ORG_UNIT@. For example, the
--     following is a valid map: @{“ORG_UNIT” : [“ouid111”, “ouid112”]}@.
--
-- -   Specify accounts and OUs together in a single map, separated with a
--     comma. For example, the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}@.
policy_excludeMap :: Lens.Lens' Policy (Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]))
policy_excludeMap :: Lens' Policy (Maybe (HashMap CustomerPolicyScopeIdType [Text]))
policy_excludeMap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:excludeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap} -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap) (\s :: Policy
s@Policy' {} Maybe (HashMap CustomerPolicyScopeIdType [Text])
a -> Policy
s {$sel:excludeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap = Maybe (HashMap CustomerPolicyScopeIdType [Text])
a} :: Policy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the Amazon Web Services account IDs and Organizations
-- organizational units (OUs) to include in the policy. Specifying an OU is
-- the equivalent of specifying all accounts in the OU and in any of its
-- child OUs, including any child OUs and accounts that are added at a
-- later time.
--
-- You can specify inclusions or exclusions, but not both. If you specify
-- an @IncludeMap@, Firewall Manager applies the policy to all accounts
-- specified by the @IncludeMap@, and does not evaluate any @ExcludeMap@
-- specifications. If you do not specify an @IncludeMap@, then Firewall
-- Manager applies the policy to all accounts except for those specified by
-- the @ExcludeMap@.
--
-- You can specify account IDs, OUs, or a combination:
--
-- -   Specify account IDs by setting the key to @ACCOUNT@. For example,
--     the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”]}@.
--
-- -   Specify OUs by setting the key to @ORG_UNIT@. For example, the
--     following is a valid map: @{“ORG_UNIT” : [“ouid111”, “ouid112”]}@.
--
-- -   Specify accounts and OUs together in a single map, separated with a
--     comma. For example, the following is a valid map:
--     @{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}@.
policy_includeMap :: Lens.Lens' Policy (Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]))
policy_includeMap :: Lens' Policy (Maybe (HashMap CustomerPolicyScopeIdType [Text]))
policy_includeMap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:includeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap} -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap) (\s :: Policy
s@Policy' {} Maybe (HashMap CustomerPolicyScopeIdType [Text])
a -> Policy
s {$sel:includeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap = Maybe (HashMap CustomerPolicyScopeIdType [Text])
a} :: Policy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The definition of the Network Firewall firewall policy.
policy_policyDescription :: Lens.Lens' Policy (Prelude.Maybe Prelude.Text)
policy_policyDescription :: Lens' Policy (Maybe Text)
policy_policyDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Text
policyDescription :: Maybe Text
$sel:policyDescription:Policy' :: Policy -> Maybe Text
policyDescription} -> Maybe Text
policyDescription) (\s :: Policy
s@Policy' {} Maybe Text
a -> Policy
s {$sel:policyDescription:Policy' :: Maybe Text
policyDescription = Maybe Text
a} :: Policy)

-- | The ID of the Firewall Manager policy.
policy_policyId :: Lens.Lens' Policy (Prelude.Maybe Prelude.Text)
policy_policyId :: Lens' Policy (Maybe Text)
policy_policyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Text
policyId :: Maybe Text
$sel:policyId:Policy' :: Policy -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: Policy
s@Policy' {} Maybe Text
a -> Policy
s {$sel:policyId:Policy' :: Maybe Text
policyId = Maybe Text
a} :: Policy)

-- | A unique identifier for each update to the policy. When issuing a
-- @PutPolicy@ request, the @PolicyUpdateToken@ in the request must match
-- the @PolicyUpdateToken@ of the current policy version. To get the
-- @PolicyUpdateToken@ of the current policy version, use a @GetPolicy@
-- request.
policy_policyUpdateToken :: Lens.Lens' Policy (Prelude.Maybe Prelude.Text)
policy_policyUpdateToken :: Lens' Policy (Maybe Text)
policy_policyUpdateToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Text
policyUpdateToken :: Maybe Text
$sel:policyUpdateToken:Policy' :: Policy -> Maybe Text
policyUpdateToken} -> Maybe Text
policyUpdateToken) (\s :: Policy
s@Policy' {} Maybe Text
a -> Policy
s {$sel:policyUpdateToken:Policy' :: Maybe Text
policyUpdateToken = Maybe Text
a} :: Policy)

-- | The unique identifiers of the resource sets used by the policy.
policy_resourceSetIds :: Lens.Lens' Policy (Prelude.Maybe [Prelude.Text])
policy_resourceSetIds :: Lens' Policy (Maybe [Text])
policy_resourceSetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe [Text]
resourceSetIds :: Maybe [Text]
$sel:resourceSetIds:Policy' :: Policy -> Maybe [Text]
resourceSetIds} -> Maybe [Text]
resourceSetIds) (\s :: Policy
s@Policy' {} Maybe [Text]
a -> Policy
s {$sel:resourceSetIds:Policy' :: Maybe [Text]
resourceSetIds = Maybe [Text]
a} :: Policy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of @ResourceTag@ objects.
policy_resourceTags :: Lens.Lens' Policy (Prelude.Maybe [ResourceTag])
policy_resourceTags :: Lens' Policy (Maybe [ResourceTag])
policy_resourceTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe [ResourceTag]
resourceTags :: Maybe [ResourceTag]
$sel:resourceTags:Policy' :: Policy -> Maybe [ResourceTag]
resourceTags} -> Maybe [ResourceTag]
resourceTags) (\s :: Policy
s@Policy' {} Maybe [ResourceTag]
a -> Policy
s {$sel:resourceTags:Policy' :: Maybe [ResourceTag]
resourceTags = Maybe [ResourceTag]
a} :: Policy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of @ResourceType@ objects. Use this only to specify multiple
-- resource types. To specify a single resource type, use @ResourceType@.
policy_resourceTypeList :: Lens.Lens' Policy (Prelude.Maybe [Prelude.Text])
policy_resourceTypeList :: Lens' Policy (Maybe [Text])
policy_resourceTypeList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe [Text]
resourceTypeList :: Maybe [Text]
$sel:resourceTypeList:Policy' :: Policy -> Maybe [Text]
resourceTypeList} -> Maybe [Text]
resourceTypeList) (\s :: Policy
s@Policy' {} Maybe [Text]
a -> Policy
s {$sel:resourceTypeList:Policy' :: Maybe [Text]
resourceTypeList = Maybe [Text]
a} :: Policy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the Firewall Manager policy.
policy_policyName :: Lens.Lens' Policy Prelude.Text
policy_policyName :: Lens' Policy Text
policy_policyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Text
policyName :: Text
$sel:policyName:Policy' :: Policy -> Text
policyName} -> Text
policyName) (\s :: Policy
s@Policy' {} Text
a -> Policy
s {$sel:policyName:Policy' :: Text
policyName = Text
a} :: Policy)

-- | Details about the security service that is being used to protect the
-- resources.
policy_securityServicePolicyData :: Lens.Lens' Policy SecurityServicePolicyData
policy_securityServicePolicyData :: Lens' Policy SecurityServicePolicyData
policy_securityServicePolicyData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {SecurityServicePolicyData
securityServicePolicyData :: SecurityServicePolicyData
$sel:securityServicePolicyData:Policy' :: Policy -> SecurityServicePolicyData
securityServicePolicyData} -> SecurityServicePolicyData
securityServicePolicyData) (\s :: Policy
s@Policy' {} SecurityServicePolicyData
a -> Policy
s {$sel:securityServicePolicyData:Policy' :: SecurityServicePolicyData
securityServicePolicyData = SecurityServicePolicyData
a} :: Policy)

-- | The type of resource protected by or in scope of the policy. This is in
-- the format shown in the
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html Amazon Web Services Resource Types Reference>.
-- To apply this policy to multiple resource types, specify a resource type
-- of @ResourceTypeList@ and then specify the resource types in a
-- @ResourceTypeList@.
--
-- For WAF and Shield Advanced, resource types include
-- @AWS::ElasticLoadBalancingV2::LoadBalancer@,
-- @AWS::ElasticLoadBalancing::LoadBalancer@, @AWS::EC2::EIP@, and
-- @AWS::CloudFront::Distribution@. For a security group common policy,
-- valid values are @AWS::EC2::NetworkInterface@ and @AWS::EC2::Instance@.
-- For a security group content audit policy, valid values are
-- @AWS::EC2::SecurityGroup@, @AWS::EC2::NetworkInterface@, and
-- @AWS::EC2::Instance@. For a security group usage audit policy, the value
-- is @AWS::EC2::SecurityGroup@. For an Network Firewall policy or DNS
-- Firewall policy, the value is @AWS::EC2::VPC@.
policy_resourceType :: Lens.Lens' Policy Prelude.Text
policy_resourceType :: Lens' Policy Text
policy_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Text
resourceType :: Text
$sel:resourceType:Policy' :: Policy -> Text
resourceType} -> Text
resourceType) (\s :: Policy
s@Policy' {} Text
a -> Policy
s {$sel:resourceType:Policy' :: Text
resourceType = Text
a} :: Policy)

-- | If set to @True@, resources with the tags that are specified in the
-- @ResourceTag@ array are not in scope of the policy. If set to @False@,
-- and the @ResourceTag@ array is not null, only resources with the
-- specified tags are in scope of the policy.
policy_excludeResourceTags :: Lens.Lens' Policy Prelude.Bool
policy_excludeResourceTags :: Lens' Policy Bool
policy_excludeResourceTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Bool
excludeResourceTags :: Bool
$sel:excludeResourceTags:Policy' :: Policy -> Bool
excludeResourceTags} -> Bool
excludeResourceTags) (\s :: Policy
s@Policy' {} Bool
a -> Policy
s {$sel:excludeResourceTags:Policy' :: Bool
excludeResourceTags = Bool
a} :: Policy)

-- | Indicates if the policy should be automatically applied to new
-- resources.
policy_remediationEnabled :: Lens.Lens' Policy Prelude.Bool
policy_remediationEnabled :: Lens' Policy Bool
policy_remediationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Bool
remediationEnabled :: Bool
$sel:remediationEnabled:Policy' :: Policy -> Bool
remediationEnabled} -> Bool
remediationEnabled) (\s :: Policy
s@Policy' {} Bool
a -> Policy
s {$sel:remediationEnabled:Policy' :: Bool
remediationEnabled = Bool
a} :: Policy)

instance Data.FromJSON Policy where
  parseJSON :: Value -> Parser Policy
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Policy"
      ( \Object
x ->
          Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [ResourceTag]
-> Maybe [Text]
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy
Policy'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeleteUnusedFMManagedResources")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExcludeMap" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeMap" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PolicyDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PolicyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PolicyUpdateToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceSetIds" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceTags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceTypeList"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PolicyName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SecurityServicePolicyData")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ExcludeResourceTags")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RemediationEnabled")
      )

instance Prelude.Hashable Policy where
  hashWithSalt :: Int -> Policy -> Int
hashWithSalt Int
_salt Policy' {Bool
Maybe Bool
Maybe [Text]
Maybe [ResourceTag]
Maybe Text
Maybe (HashMap CustomerPolicyScopeIdType [Text])
Text
SecurityServicePolicyData
remediationEnabled :: Bool
excludeResourceTags :: Bool
resourceType :: Text
securityServicePolicyData :: SecurityServicePolicyData
policyName :: Text
resourceTypeList :: Maybe [Text]
resourceTags :: Maybe [ResourceTag]
resourceSetIds :: Maybe [Text]
policyUpdateToken :: Maybe Text
policyId :: Maybe Text
policyDescription :: Maybe Text
includeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
deleteUnusedFMManagedResources :: Maybe Bool
$sel:remediationEnabled:Policy' :: Policy -> Bool
$sel:excludeResourceTags:Policy' :: Policy -> Bool
$sel:resourceType:Policy' :: Policy -> Text
$sel:securityServicePolicyData:Policy' :: Policy -> SecurityServicePolicyData
$sel:policyName:Policy' :: Policy -> Text
$sel:resourceTypeList:Policy' :: Policy -> Maybe [Text]
$sel:resourceTags:Policy' :: Policy -> Maybe [ResourceTag]
$sel:resourceSetIds:Policy' :: Policy -> Maybe [Text]
$sel:policyUpdateToken:Policy' :: Policy -> Maybe Text
$sel:policyId:Policy' :: Policy -> Maybe Text
$sel:policyDescription:Policy' :: Policy -> Maybe Text
$sel:includeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:excludeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:deleteUnusedFMManagedResources:Policy' :: Policy -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteUnusedFMManagedResources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyUpdateToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
resourceSetIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ResourceTag]
resourceTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
resourceTypeList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SecurityServicePolicyData
securityServicePolicyData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
excludeResourceTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
remediationEnabled

instance Prelude.NFData Policy where
  rnf :: Policy -> ()
rnf Policy' {Bool
Maybe Bool
Maybe [Text]
Maybe [ResourceTag]
Maybe Text
Maybe (HashMap CustomerPolicyScopeIdType [Text])
Text
SecurityServicePolicyData
remediationEnabled :: Bool
excludeResourceTags :: Bool
resourceType :: Text
securityServicePolicyData :: SecurityServicePolicyData
policyName :: Text
resourceTypeList :: Maybe [Text]
resourceTags :: Maybe [ResourceTag]
resourceSetIds :: Maybe [Text]
policyUpdateToken :: Maybe Text
policyId :: Maybe Text
policyDescription :: Maybe Text
includeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
deleteUnusedFMManagedResources :: Maybe Bool
$sel:remediationEnabled:Policy' :: Policy -> Bool
$sel:excludeResourceTags:Policy' :: Policy -> Bool
$sel:resourceType:Policy' :: Policy -> Text
$sel:securityServicePolicyData:Policy' :: Policy -> SecurityServicePolicyData
$sel:policyName:Policy' :: Policy -> Text
$sel:resourceTypeList:Policy' :: Policy -> Maybe [Text]
$sel:resourceTags:Policy' :: Policy -> Maybe [ResourceTag]
$sel:resourceSetIds:Policy' :: Policy -> Maybe [Text]
$sel:policyUpdateToken:Policy' :: Policy -> Maybe Text
$sel:policyId:Policy' :: Policy -> Maybe Text
$sel:policyDescription:Policy' :: Policy -> Maybe Text
$sel:includeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:excludeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:deleteUnusedFMManagedResources:Policy' :: Policy -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteUnusedFMManagedResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyUpdateToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
resourceSetIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ResourceTag]
resourceTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
resourceTypeList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SecurityServicePolicyData
securityServicePolicyData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
excludeResourceTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
remediationEnabled

instance Data.ToJSON Policy where
  toJSON :: Policy -> Value
toJSON Policy' {Bool
Maybe Bool
Maybe [Text]
Maybe [ResourceTag]
Maybe Text
Maybe (HashMap CustomerPolicyScopeIdType [Text])
Text
SecurityServicePolicyData
remediationEnabled :: Bool
excludeResourceTags :: Bool
resourceType :: Text
securityServicePolicyData :: SecurityServicePolicyData
policyName :: Text
resourceTypeList :: Maybe [Text]
resourceTags :: Maybe [ResourceTag]
resourceSetIds :: Maybe [Text]
policyUpdateToken :: Maybe Text
policyId :: Maybe Text
policyDescription :: Maybe Text
includeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
deleteUnusedFMManagedResources :: Maybe Bool
$sel:remediationEnabled:Policy' :: Policy -> Bool
$sel:excludeResourceTags:Policy' :: Policy -> Bool
$sel:resourceType:Policy' :: Policy -> Text
$sel:securityServicePolicyData:Policy' :: Policy -> SecurityServicePolicyData
$sel:policyName:Policy' :: Policy -> Text
$sel:resourceTypeList:Policy' :: Policy -> Maybe [Text]
$sel:resourceTags:Policy' :: Policy -> Maybe [ResourceTag]
$sel:resourceSetIds:Policy' :: Policy -> Maybe [Text]
$sel:policyUpdateToken:Policy' :: Policy -> Maybe Text
$sel:policyId:Policy' :: Policy -> Maybe Text
$sel:policyDescription:Policy' :: Policy -> Maybe Text
$sel:includeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:excludeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:deleteUnusedFMManagedResources:Policy' :: Policy -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DeleteUnusedFMManagedResources" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteUnusedFMManagedResources,
            (Key
"ExcludeMap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap,
            (Key
"IncludeMap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap,
            (Key
"PolicyDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyDescription,
            (Key
"PolicyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyId,
            (Key
"PolicyUpdateToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyUpdateToken,
            (Key
"ResourceSetIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resourceSetIds,
            (Key
"ResourceTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourceTag]
resourceTags,
            (Key
"ResourceTypeList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resourceTypeList,
            forall a. a -> Maybe a
Prelude.Just (Key
"PolicyName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
policyName),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"SecurityServicePolicyData"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SecurityServicePolicyData
securityServicePolicyData
              ),
            forall a. a -> Maybe a
Prelude.Just (Key
"ResourceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceType),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ExcludeResourceTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
excludeResourceTags),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"RemediationEnabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
remediationEnabled)
          ]
      )