module Stratosphere.EC2.SecurityGroup (
module Exports, SecurityGroup(..), mkSecurityGroup
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.EC2.SecurityGroup.EgressProperty as Exports
import {-# SOURCE #-} Stratosphere.EC2.SecurityGroup.IngressProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data SecurityGroup
=
SecurityGroup {SecurityGroup -> ()
haddock_workaround_ :: (),
SecurityGroup -> Value Text
groupDescription :: (Value Prelude.Text),
SecurityGroup -> Maybe (Value Text)
groupName :: (Prelude.Maybe (Value Prelude.Text)),
SecurityGroup -> Maybe [EgressProperty]
securityGroupEgress :: (Prelude.Maybe [EgressProperty]),
SecurityGroup -> Maybe [IngressProperty]
securityGroupIngress :: (Prelude.Maybe [IngressProperty]),
SecurityGroup -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag]),
SecurityGroup -> Maybe (Value Text)
vpcId :: (Prelude.Maybe (Value Prelude.Text))}
deriving stock (SecurityGroup -> SecurityGroup -> Bool
(SecurityGroup -> SecurityGroup -> Bool)
-> (SecurityGroup -> SecurityGroup -> Bool) -> Eq SecurityGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SecurityGroup -> SecurityGroup -> Bool
== :: SecurityGroup -> SecurityGroup -> Bool
$c/= :: SecurityGroup -> SecurityGroup -> Bool
/= :: SecurityGroup -> SecurityGroup -> Bool
Prelude.Eq, Int -> SecurityGroup -> ShowS
[SecurityGroup] -> ShowS
SecurityGroup -> String
(Int -> SecurityGroup -> ShowS)
-> (SecurityGroup -> String)
-> ([SecurityGroup] -> ShowS)
-> Show SecurityGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SecurityGroup -> ShowS
showsPrec :: Int -> SecurityGroup -> ShowS
$cshow :: SecurityGroup -> String
show :: SecurityGroup -> String
$cshowList :: [SecurityGroup] -> ShowS
showList :: [SecurityGroup] -> ShowS
Prelude.Show)
mkSecurityGroup :: Value Prelude.Text -> SecurityGroup
mkSecurityGroup :: Value Text -> SecurityGroup
mkSecurityGroup Value Text
groupDescription
= SecurityGroup
{haddock_workaround_ :: ()
haddock_workaround_ = (), groupDescription :: Value Text
groupDescription = Value Text
groupDescription,
groupName :: Maybe (Value Text)
groupName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, securityGroupEgress :: Maybe [EgressProperty]
securityGroupEgress = Maybe [EgressProperty]
forall a. Maybe a
Prelude.Nothing,
securityGroupIngress :: Maybe [IngressProperty]
securityGroupIngress = Maybe [IngressProperty]
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
vpcId :: Maybe (Value Text)
vpcId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SecurityGroup where
toResourceProperties :: SecurityGroup -> ResourceProperties
toResourceProperties SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::EC2::SecurityGroup", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"GroupDescription" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
groupDescription]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"GroupName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
groupName,
Key -> [EgressProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SecurityGroupEgress" ([EgressProperty] -> (Key, Value))
-> Maybe [EgressProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EgressProperty]
securityGroupEgress,
Key -> [IngressProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SecurityGroupIngress" ([IngressProperty] -> (Key, Value))
-> Maybe [IngressProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IngressProperty]
securityGroupIngress,
Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"VpcId" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
vpcId]))}
instance JSON.ToJSON SecurityGroup where
toJSON :: SecurityGroup -> Value
toJSON SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"GroupDescription" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
groupDescription]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"GroupName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
groupName,
Key -> [EgressProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SecurityGroupEgress" ([EgressProperty] -> (Key, Value))
-> Maybe [EgressProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EgressProperty]
securityGroupEgress,
Key -> [IngressProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SecurityGroupIngress" ([IngressProperty] -> (Key, Value))
-> Maybe [IngressProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IngressProperty]
securityGroupIngress,
Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"VpcId" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
vpcId])))
instance Property "GroupDescription" SecurityGroup where
type PropertyType "GroupDescription" SecurityGroup = Value Prelude.Text
set :: PropertyType "GroupDescription" SecurityGroup
-> SecurityGroup -> SecurityGroup
set PropertyType "GroupDescription" SecurityGroup
newValue SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= SecurityGroup {groupDescription :: Value Text
groupDescription = PropertyType "GroupDescription" SecurityGroup
Value Text
newValue, Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
haddock_workaround_ :: ()
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
instance Property "GroupName" SecurityGroup where
type PropertyType "GroupName" SecurityGroup = Value Prelude.Text
set :: PropertyType "GroupName" SecurityGroup
-> SecurityGroup -> SecurityGroup
set PropertyType "GroupName" SecurityGroup
newValue SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= SecurityGroup {groupName :: Maybe (Value Text)
groupName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "GroupName" SecurityGroup
Value Text
newValue, Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
groupDescription :: Value Text
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
instance Property "SecurityGroupEgress" SecurityGroup where
type PropertyType "SecurityGroupEgress" SecurityGroup = [EgressProperty]
set :: PropertyType "SecurityGroupEgress" SecurityGroup
-> SecurityGroup -> SecurityGroup
set PropertyType "SecurityGroupEgress" SecurityGroup
newValue SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= SecurityGroup {securityGroupEgress :: Maybe [EgressProperty]
securityGroupEgress = [EgressProperty] -> Maybe [EgressProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [EgressProperty]
PropertyType "SecurityGroupEgress" SecurityGroup
newValue, Maybe [Tag]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
instance Property "SecurityGroupIngress" SecurityGroup where
type PropertyType "SecurityGroupIngress" SecurityGroup = [IngressProperty]
set :: PropertyType "SecurityGroupIngress" SecurityGroup
-> SecurityGroup -> SecurityGroup
set PropertyType "SecurityGroupIngress" SecurityGroup
newValue SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= SecurityGroup {securityGroupIngress :: Maybe [IngressProperty]
securityGroupIngress = [IngressProperty] -> Maybe [IngressProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [IngressProperty]
PropertyType "SecurityGroupIngress" SecurityGroup
newValue, Maybe [Tag]
Maybe [EgressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
instance Property "Tags" SecurityGroup where
type PropertyType "Tags" SecurityGroup = [Tag]
set :: PropertyType "Tags" SecurityGroup -> SecurityGroup -> SecurityGroup
set PropertyType "Tags" SecurityGroup
newValue SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= SecurityGroup {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" SecurityGroup
newValue, Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
vpcId :: Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
vpcId :: Maybe (Value Text)
..}
instance Property "VpcId" SecurityGroup where
type PropertyType "VpcId" SecurityGroup = Value Prelude.Text
set :: PropertyType "VpcId" SecurityGroup
-> SecurityGroup -> SecurityGroup
set PropertyType "VpcId" SecurityGroup
newValue SecurityGroup {Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityGroup -> ()
groupDescription :: SecurityGroup -> Value Text
groupName :: SecurityGroup -> Maybe (Value Text)
securityGroupEgress :: SecurityGroup -> Maybe [EgressProperty]
securityGroupIngress :: SecurityGroup -> Maybe [IngressProperty]
tags :: SecurityGroup -> Maybe [Tag]
vpcId :: SecurityGroup -> Maybe (Value Text)
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
vpcId :: Maybe (Value Text)
..}
= SecurityGroup {vpcId :: Maybe (Value Text)
vpcId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "VpcId" SecurityGroup
Value Text
newValue, Maybe [Tag]
Maybe [EgressProperty]
Maybe [IngressProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
haddock_workaround_ :: ()
groupDescription :: Value Text
groupName :: Maybe (Value Text)
securityGroupEgress :: Maybe [EgressProperty]
securityGroupIngress :: Maybe [IngressProperty]
tags :: Maybe [Tag]
..}