{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.EC2.AuthorizeSecurityGroupEgress
(
authorizeSecurityGroupEgress
, AuthorizeSecurityGroupEgress
, asgeFromPort
, asgeIPPermissions
, asgeIPProtocol
, asgeToPort
, asgeCidrIP
, asgeSourceSecurityGroupOwnerId
, asgeSourceSecurityGroupName
, asgeDryRun
, asgeGroupId
, authorizeSecurityGroupEgressResponse
, AuthorizeSecurityGroupEgressResponse
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AuthorizeSecurityGroupEgress = AuthorizeSecurityGroupEgress'
{ _asgeFromPort :: !(Maybe Int)
, _asgeIPPermissions :: !(Maybe [IPPermission])
, _asgeIPProtocol :: !(Maybe Text)
, _asgeToPort :: !(Maybe Int)
, _asgeCidrIP :: !(Maybe Text)
, _asgeSourceSecurityGroupOwnerId :: !(Maybe Text)
, _asgeSourceSecurityGroupName :: !(Maybe Text)
, _asgeDryRun :: !(Maybe Bool)
, _asgeGroupId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
authorizeSecurityGroupEgress
:: Text
-> AuthorizeSecurityGroupEgress
authorizeSecurityGroupEgress pGroupId_ =
AuthorizeSecurityGroupEgress'
{ _asgeFromPort = Nothing
, _asgeIPPermissions = Nothing
, _asgeIPProtocol = Nothing
, _asgeToPort = Nothing
, _asgeCidrIP = Nothing
, _asgeSourceSecurityGroupOwnerId = Nothing
, _asgeSourceSecurityGroupName = Nothing
, _asgeDryRun = Nothing
, _asgeGroupId = pGroupId_
}
asgeFromPort :: Lens' AuthorizeSecurityGroupEgress (Maybe Int)
asgeFromPort = lens _asgeFromPort (\ s a -> s{_asgeFromPort = a})
asgeIPPermissions :: Lens' AuthorizeSecurityGroupEgress [IPPermission]
asgeIPPermissions = lens _asgeIPPermissions (\ s a -> s{_asgeIPPermissions = a}) . _Default . _Coerce
asgeIPProtocol :: Lens' AuthorizeSecurityGroupEgress (Maybe Text)
asgeIPProtocol = lens _asgeIPProtocol (\ s a -> s{_asgeIPProtocol = a})
asgeToPort :: Lens' AuthorizeSecurityGroupEgress (Maybe Int)
asgeToPort = lens _asgeToPort (\ s a -> s{_asgeToPort = a})
asgeCidrIP :: Lens' AuthorizeSecurityGroupEgress (Maybe Text)
asgeCidrIP = lens _asgeCidrIP (\ s a -> s{_asgeCidrIP = a})
asgeSourceSecurityGroupOwnerId :: Lens' AuthorizeSecurityGroupEgress (Maybe Text)
asgeSourceSecurityGroupOwnerId = lens _asgeSourceSecurityGroupOwnerId (\ s a -> s{_asgeSourceSecurityGroupOwnerId = a})
asgeSourceSecurityGroupName :: Lens' AuthorizeSecurityGroupEgress (Maybe Text)
asgeSourceSecurityGroupName = lens _asgeSourceSecurityGroupName (\ s a -> s{_asgeSourceSecurityGroupName = a})
asgeDryRun :: Lens' AuthorizeSecurityGroupEgress (Maybe Bool)
asgeDryRun = lens _asgeDryRun (\ s a -> s{_asgeDryRun = a})
asgeGroupId :: Lens' AuthorizeSecurityGroupEgress Text
asgeGroupId = lens _asgeGroupId (\ s a -> s{_asgeGroupId = a})
instance AWSRequest AuthorizeSecurityGroupEgress
where
type Rs AuthorizeSecurityGroupEgress =
AuthorizeSecurityGroupEgressResponse
request = postQuery ec2
response
= receiveNull AuthorizeSecurityGroupEgressResponse'
instance Hashable AuthorizeSecurityGroupEgress where
instance NFData AuthorizeSecurityGroupEgress where
instance ToHeaders AuthorizeSecurityGroupEgress where
toHeaders = const mempty
instance ToPath AuthorizeSecurityGroupEgress where
toPath = const "/"
instance ToQuery AuthorizeSecurityGroupEgress where
toQuery AuthorizeSecurityGroupEgress'{..}
= mconcat
["Action" =:
("AuthorizeSecurityGroupEgress" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"FromPort" =: _asgeFromPort,
toQuery
(toQueryList "IpPermissions" <$> _asgeIPPermissions),
"IpProtocol" =: _asgeIPProtocol,
"ToPort" =: _asgeToPort, "CidrIp" =: _asgeCidrIP,
"SourceSecurityGroupOwnerId" =:
_asgeSourceSecurityGroupOwnerId,
"SourceSecurityGroupName" =:
_asgeSourceSecurityGroupName,
"DryRun" =: _asgeDryRun, "GroupId" =: _asgeGroupId]
data AuthorizeSecurityGroupEgressResponse =
AuthorizeSecurityGroupEgressResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
authorizeSecurityGroupEgressResponse
:: AuthorizeSecurityGroupEgressResponse
authorizeSecurityGroupEgressResponse = AuthorizeSecurityGroupEgressResponse'
instance NFData AuthorizeSecurityGroupEgressResponse
where