module Stratosphere.Resources.Subnet where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
import Stratosphere.ResourceProperties.ResourceTag
data Subnet =
Subnet
{ _subnetAvailabilityZone :: Maybe (Val Text)
, _subnetCidrBlock :: Val Text
, _subnetMapPublicIpOnLaunch :: Maybe (Val Bool')
, _subnetTags :: Maybe [ResourceTag]
, _subnetVpcId :: Val Text
} deriving (Show, Generic)
instance ToJSON Subnet where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 7, omitNothingFields = True }
instance FromJSON Subnet where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 7, omitNothingFields = True }
subnet
:: Val Text
-> Val Text
-> Subnet
subnet cidrBlockarg vpcIdarg =
Subnet
{ _subnetAvailabilityZone = Nothing
, _subnetCidrBlock = cidrBlockarg
, _subnetMapPublicIpOnLaunch = Nothing
, _subnetTags = Nothing
, _subnetVpcId = vpcIdarg
}
sAvailabilityZone :: Lens' Subnet (Maybe (Val Text))
sAvailabilityZone = lens _subnetAvailabilityZone (\s a -> s { _subnetAvailabilityZone = a })
sCidrBlock :: Lens' Subnet (Val Text)
sCidrBlock = lens _subnetCidrBlock (\s a -> s { _subnetCidrBlock = a })
sMapPublicIpOnLaunch :: Lens' Subnet (Maybe (Val Bool'))
sMapPublicIpOnLaunch = lens _subnetMapPublicIpOnLaunch (\s a -> s { _subnetMapPublicIpOnLaunch = a })
sTags :: Lens' Subnet (Maybe [ResourceTag])
sTags = lens _subnetTags (\s a -> s { _subnetTags = a })
sVpcId :: Lens' Subnet (Val Text)
sVpcId = lens _subnetVpcId (\s a -> s { _subnetVpcId = a })