{-# 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.AuthorizeSecurityGroupIngress
(
authorizeSecurityGroupIngress
, AuthorizeSecurityGroupIngress
, asgiFromPort
, asgiIPPermissions
, asgiIPProtocol
, asgiGroupId
, asgiToPort
, asgiCIdRIP
, asgiSourceSecurityGroupOwnerId
, asgiGroupName
, asgiSourceSecurityGroupName
, asgiDryRun
, authorizeSecurityGroupIngressResponse
, AuthorizeSecurityGroupIngressResponse
) 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 AuthorizeSecurityGroupIngress = AuthorizeSecurityGroupIngress'
{ _asgiFromPort :: !(Maybe Int)
, _asgiIPPermissions :: !(Maybe [IPPermission])
, _asgiIPProtocol :: !(Maybe Text)
, _asgiGroupId :: !(Maybe Text)
, _asgiToPort :: !(Maybe Int)
, _asgiCIdRIP :: !(Maybe Text)
, _asgiSourceSecurityGroupOwnerId :: !(Maybe Text)
, _asgiGroupName :: !(Maybe Text)
, _asgiSourceSecurityGroupName :: !(Maybe Text)
, _asgiDryRun :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
authorizeSecurityGroupIngress
:: AuthorizeSecurityGroupIngress
authorizeSecurityGroupIngress =
AuthorizeSecurityGroupIngress'
{ _asgiFromPort = Nothing
, _asgiIPPermissions = Nothing
, _asgiIPProtocol = Nothing
, _asgiGroupId = Nothing
, _asgiToPort = Nothing
, _asgiCIdRIP = Nothing
, _asgiSourceSecurityGroupOwnerId = Nothing
, _asgiGroupName = Nothing
, _asgiSourceSecurityGroupName = Nothing
, _asgiDryRun = Nothing
}
asgiFromPort :: Lens' AuthorizeSecurityGroupIngress (Maybe Int)
asgiFromPort = lens _asgiFromPort (\ s a -> s{_asgiFromPort = a});
asgiIPPermissions :: Lens' AuthorizeSecurityGroupIngress [IPPermission]
asgiIPPermissions = lens _asgiIPPermissions (\ s a -> s{_asgiIPPermissions = a}) . _Default . _Coerce;
asgiIPProtocol :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
asgiIPProtocol = lens _asgiIPProtocol (\ s a -> s{_asgiIPProtocol = a});
asgiGroupId :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
asgiGroupId = lens _asgiGroupId (\ s a -> s{_asgiGroupId = a});
asgiToPort :: Lens' AuthorizeSecurityGroupIngress (Maybe Int)
asgiToPort = lens _asgiToPort (\ s a -> s{_asgiToPort = a});
asgiCIdRIP :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
asgiCIdRIP = lens _asgiCIdRIP (\ s a -> s{_asgiCIdRIP = a});
asgiSourceSecurityGroupOwnerId :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
asgiSourceSecurityGroupOwnerId = lens _asgiSourceSecurityGroupOwnerId (\ s a -> s{_asgiSourceSecurityGroupOwnerId = a});
asgiGroupName :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
asgiGroupName = lens _asgiGroupName (\ s a -> s{_asgiGroupName = a});
asgiSourceSecurityGroupName :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
asgiSourceSecurityGroupName = lens _asgiSourceSecurityGroupName (\ s a -> s{_asgiSourceSecurityGroupName = a});
asgiDryRun :: Lens' AuthorizeSecurityGroupIngress (Maybe Bool)
asgiDryRun = lens _asgiDryRun (\ s a -> s{_asgiDryRun = a});
instance AWSRequest AuthorizeSecurityGroupIngress
where
type Rs AuthorizeSecurityGroupIngress =
AuthorizeSecurityGroupIngressResponse
request = postQuery ec2
response
= receiveNull AuthorizeSecurityGroupIngressResponse'
instance Hashable AuthorizeSecurityGroupIngress
instance NFData AuthorizeSecurityGroupIngress
instance ToHeaders AuthorizeSecurityGroupIngress
where
toHeaders = const mempty
instance ToPath AuthorizeSecurityGroupIngress where
toPath = const "/"
instance ToQuery AuthorizeSecurityGroupIngress where
toQuery AuthorizeSecurityGroupIngress'{..}
= mconcat
["Action" =:
("AuthorizeSecurityGroupIngress" :: ByteString),
"Version" =: ("2016-04-01" :: ByteString),
"FromPort" =: _asgiFromPort,
toQuery
(toQueryList "IpPermissions" <$> _asgiIPPermissions),
"IpProtocol" =: _asgiIPProtocol,
"GroupId" =: _asgiGroupId, "ToPort" =: _asgiToPort,
"CidrIp" =: _asgiCIdRIP,
"SourceSecurityGroupOwnerId" =:
_asgiSourceSecurityGroupOwnerId,
"GroupName" =: _asgiGroupName,
"SourceSecurityGroupName" =:
_asgiSourceSecurityGroupName,
"DryRun" =: _asgiDryRun]
data AuthorizeSecurityGroupIngressResponse =
AuthorizeSecurityGroupIngressResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
authorizeSecurityGroupIngressResponse
:: AuthorizeSecurityGroupIngressResponse
authorizeSecurityGroupIngressResponse = AuthorizeSecurityGroupIngressResponse'
instance NFData AuthorizeSecurityGroupIngressResponse