module Network.AWS.EC2.CreateVPCPeeringConnection
(
createVPCPeeringConnection
, CreateVPCPeeringConnection
, cvpcPeerVPCId
, cvpcVPCId
, cvpcPeerOwnerId
, cvpcDryRun
, createVPCPeeringConnectionResponse
, CreateVPCPeeringConnectionResponse
, cvpcrsVPCPeeringConnection
, cvpcrsStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateVPCPeeringConnection = CreateVPCPeeringConnection'
{ _cvpcPeerVPCId :: !(Maybe Text)
, _cvpcVPCId :: !(Maybe Text)
, _cvpcPeerOwnerId :: !(Maybe Text)
, _cvpcDryRun :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createVPCPeeringConnection
:: CreateVPCPeeringConnection
createVPCPeeringConnection =
CreateVPCPeeringConnection'
{ _cvpcPeerVPCId = Nothing
, _cvpcVPCId = Nothing
, _cvpcPeerOwnerId = Nothing
, _cvpcDryRun = Nothing
}
cvpcPeerVPCId :: Lens' CreateVPCPeeringConnection (Maybe Text)
cvpcPeerVPCId = lens _cvpcPeerVPCId (\ s a -> s{_cvpcPeerVPCId = a});
cvpcVPCId :: Lens' CreateVPCPeeringConnection (Maybe Text)
cvpcVPCId = lens _cvpcVPCId (\ s a -> s{_cvpcVPCId = a});
cvpcPeerOwnerId :: Lens' CreateVPCPeeringConnection (Maybe Text)
cvpcPeerOwnerId = lens _cvpcPeerOwnerId (\ s a -> s{_cvpcPeerOwnerId = a});
cvpcDryRun :: Lens' CreateVPCPeeringConnection (Maybe Bool)
cvpcDryRun = lens _cvpcDryRun (\ s a -> s{_cvpcDryRun = a});
instance AWSRequest CreateVPCPeeringConnection where
type Sv CreateVPCPeeringConnection = EC2
type Rs CreateVPCPeeringConnection =
CreateVPCPeeringConnectionResponse
request = post
response
= receiveXML
(\ s h x ->
CreateVPCPeeringConnectionResponse' <$>
(x .@? "vpcPeeringConnection") <*>
(pure (fromEnum s)))
instance ToHeaders CreateVPCPeeringConnection where
toHeaders = const mempty
instance ToPath CreateVPCPeeringConnection where
toPath = const "/"
instance ToQuery CreateVPCPeeringConnection where
toQuery CreateVPCPeeringConnection'{..}
= mconcat
["Action" =:
("CreateVpcPeeringConnection" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"PeerVpcId" =: _cvpcPeerVPCId, "VpcId" =: _cvpcVPCId,
"PeerOwnerId" =: _cvpcPeerOwnerId,
"DryRun" =: _cvpcDryRun]
data CreateVPCPeeringConnectionResponse = CreateVPCPeeringConnectionResponse'
{ _cvpcrsVPCPeeringConnection :: !(Maybe VPCPeeringConnection)
, _cvpcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createVPCPeeringConnectionResponse
:: Int
-> CreateVPCPeeringConnectionResponse
createVPCPeeringConnectionResponse pStatus_ =
CreateVPCPeeringConnectionResponse'
{ _cvpcrsVPCPeeringConnection = Nothing
, _cvpcrsStatus = pStatus_
}
cvpcrsVPCPeeringConnection :: Lens' CreateVPCPeeringConnectionResponse (Maybe VPCPeeringConnection)
cvpcrsVPCPeeringConnection = lens _cvpcrsVPCPeeringConnection (\ s a -> s{_cvpcrsVPCPeeringConnection = a});
cvpcrsStatus :: Lens' CreateVPCPeeringConnectionResponse Int
cvpcrsStatus = lens _cvpcrsStatus (\ s a -> s{_cvpcrsStatus = a});