diff --git a/src/Stratosphere/Value.hs b/src/Stratosphere/Value.hs index 2f93a5097..f10b494da 100644 --- a/src/Stratosphere/Value.hs +++ b/src/Stratosphere/Value.hs @@ -100,11 +100,11 @@ mkFunc key args = JSON.object [(key, JSON.Array $ fromList args)] -- @List@ then, you can use @RefList "SubnetIds"@ to -- reference it. data ValueList a - = ValueList [Value a] - | RefList Text + = GetAZs (Value Text) | ImportValueList (Value Text) + | RefList Text | Split Text (Value a) - | GetAZs (Value Text) + | ValueList [Value a] deriving (Show, Eq) instance IsList (ValueList a) where @@ -112,21 +112,21 @@ instance IsList (ValueList a) where fromList = ValueList toList = \case - (ValueList xs) -> xs - -- This is obviously not meaningful, but the IsList instance is so useful - -- that I decided to allow it. - (RefList _) -> [] + (GetAZs _) -> [] (ImportValueList _) -> [] + (RefList _) -> [] (Split _ _) -> [] - (GetAZs _) -> [] + -- This is obviously not meaningful, but the IsList instance is so useful + -- that I decided to allow it. + (ValueList xs) -> xs instance JSON.ToJSON a => JSON.ToJSON (ValueList a) where toJSON = \case - (ValueList vals) -> JSON.toJSON vals - (RefList ref) -> refToJSON ref + (GetAZs r) -> JSON.object [("Fn::GetAZs", JSON.toJSON r)] (ImportValueList ref) -> importValueToJSON ref + (RefList ref) -> refToJSON ref (Split d s) -> mkFunc "Fn::Split" [JSON.toJSON d, JSON.toJSON s] - (GetAZs r) -> JSON.object [("Fn::GetAZs", JSON.toJSON r)] + (ValueList vals) -> JSON.toJSON vals -- | Class used to create a 'Ref' from another type. class ToRef a b where