packages feed

stratosphere 0.1.1 → 0.1.2

raw patch · 23 files changed

+1641/−6 lines, 23 filesnew-component:exe:auto-scaling-group

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Change Log +## 0.1.2++* Added all of the resources and resource properties for Auto Scaling Groups.+* New AutoScalingGroup example+* Added UpdatePolicy, CreationPolicy, and DependsOn+ ## 0.1.1  * Small bug fix for "style" test when using the cabal distribution
+ examples/auto-scaling-group.hs view
@@ -0,0 +1,66 @@+{-# LANGUAGE OverloadedLists #-}+{-# LANGUAGE OverloadedStrings #-}++module Main where++-- | Example inspired from the CreationPolicy docs:+-- http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html++import Control.Lens+import qualified Data.ByteString.Lazy.Char8 as B++import Stratosphere++main :: IO ()+main = B.putStrLn $ encodeTemplate myTemplate++myTemplate :: Template+myTemplate =+  template+  [ asgResource+    & resCreationPolicy ?~ asgCreationPolicy+    & resUpdatePolicy ?~ asgUpdatePolicy+  , launchConfigResource+  ]+  & description ?~ "Auto scaling group example"+  & formatVersion ?~ "2010-09-09"++asgResource :: Resource+asgResource =+  resource "AutoScalingGroup" $+  AutoScalingGroupProperties $+  autoScalingGroup+  "1"+  "4"+  & asgDesiredCapacity ?~ "3"+  & asgLaunchConfigurationName ?~ Ref "LaunchConfig"++asgCreationPolicy :: CreationPolicy+asgCreationPolicy =+  creationPolicy $+  resourceSignal+  & rsCount ?~ Literal 3+  & rsTimeout ?~ "PT15M"++asgUpdatePolicy :: UpdatePolicy+asgUpdatePolicy =+  updatePolicy+  & upAutoScalingScheduledAction ?~ (+    autoScalingScheduledAction+    & assaIgnoreUnmodifiedGroupSizeProperties ?~ Literal True'+    )+  & upAutoScalingRollingUpdate ?~ (+    autoScalingRollingUpdate+    & asruMinInstancesInService ?~ Literal 1+    & asruMaxBatchSize ?~ Literal 2+    & asruPauseTime ?~ "PT15M"+    & asruWaitOnResourceSignals ?~ Literal True'+    )++launchConfigResource :: Resource+launchConfigResource =+  resource "LaunchConfig" $+  LaunchConfigurationProperties $+  launchConfiguration+  "ami-16d18a7e"+  "t2.micro"
+ library-gen/Stratosphere/ResourceAttributes/AutoScalingReplacingUpdate.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | To specify how AWS CloudFormation handles replacing updates for an Auto+-- Scaling group, use the AutoScalingReplacingUpdate policy.++module Stratosphere.ResourceAttributes.AutoScalingReplacingUpdate where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingReplacingUpdate. See+-- 'autoScalingReplacingUpdate' for a more convenient constructor.+data AutoScalingReplacingUpdate =+  AutoScalingReplacingUpdate+  { _autoScalingReplacingUpdateWillReplace :: Maybe (Val Bool')+  } deriving (Show, Generic)++instance ToJSON AutoScalingReplacingUpdate where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 27, omitNothingFields = True }++instance FromJSON AutoScalingReplacingUpdate where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 27, omitNothingFields = True }++-- | Constructor for 'AutoScalingReplacingUpdate' containing required fields+-- as arguments.+autoScalingReplacingUpdate+  :: AutoScalingReplacingUpdate+autoScalingReplacingUpdate  =+  AutoScalingReplacingUpdate+  { _autoScalingReplacingUpdateWillReplace = Nothing+  }++-- | Specifies whether an Auto Scaling group and the instances it contains are+-- replaced during an update. During replacement, AWS CloudFormation retains+-- the old group until it finishes creating the new one. This allows AWS+-- CloudFormation to roll back to the old Auto Scaling group if the update+-- doesn't succeed. While AWS CloudFormation creates the new group, it doesn't+-- detach or attach any instances. After creating the new Auto Scaling group,+-- AWS CloudFormation removes the old Auto Scaling group during the cleanup+-- process. If the update doesn't succeed, AWS CloudFormation removes the new+-- Auto Scaling group.+asruWillReplace :: Lens' AutoScalingReplacingUpdate (Maybe (Val Bool'))+asruWillReplace = lens _autoScalingReplacingUpdateWillReplace (\s a -> s { _autoScalingReplacingUpdateWillReplace = a })
+ library-gen/Stratosphere/ResourceAttributes/AutoScalingRollingUpdate.hs view
@@ -0,0 +1,108 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | To specify how AWS CloudFormation handles rolling updates for an Auto+-- Scaling group, use the AutoScalingRollingUpdate policy.++module Stratosphere.ResourceAttributes.AutoScalingRollingUpdate where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingRollingUpdate. See+-- 'autoScalingRollingUpdate' for a more convenient constructor.+data AutoScalingRollingUpdate =+  AutoScalingRollingUpdate+  { _autoScalingRollingUpdateMaxBatchSize :: Maybe (Val Integer')+  , _autoScalingRollingUpdateMinInstancesInService :: Maybe (Val Integer')+  , _autoScalingRollingUpdateMinSuccessfulInstancesPercent :: Maybe (Val Integer')+  , _autoScalingRollingUpdatePauseTime :: Maybe (Val Text)+  , _autoScalingRollingUpdateSuspendProcess :: Maybe [Val Text]+  , _autoScalingRollingUpdateWaitOnResourceSignals :: Maybe (Val Bool')+  } deriving (Show, Generic)++instance ToJSON AutoScalingRollingUpdate where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 25, omitNothingFields = True }++instance FromJSON AutoScalingRollingUpdate where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 25, omitNothingFields = True }++-- | Constructor for 'AutoScalingRollingUpdate' containing required fields as+-- arguments.+autoScalingRollingUpdate+  :: AutoScalingRollingUpdate+autoScalingRollingUpdate  =+  AutoScalingRollingUpdate+  { _autoScalingRollingUpdateMaxBatchSize = Nothing+  , _autoScalingRollingUpdateMinInstancesInService = Nothing+  , _autoScalingRollingUpdateMinSuccessfulInstancesPercent = Nothing+  , _autoScalingRollingUpdatePauseTime = Nothing+  , _autoScalingRollingUpdateSuspendProcess = Nothing+  , _autoScalingRollingUpdateWaitOnResourceSignals = Nothing+  }++-- | Specifies the maximum number of instances that AWS CloudFormation+-- terminates.+asruMaxBatchSize :: Lens' AutoScalingRollingUpdate (Maybe (Val Integer'))+asruMaxBatchSize = lens _autoScalingRollingUpdateMaxBatchSize (\s a -> s { _autoScalingRollingUpdateMaxBatchSize = a })++-- | Specifies the minimum number of instances that must be in service within+-- the Auto Scaling group while AWS CloudFormation terminates obsolete+-- instances.+asruMinInstancesInService :: Lens' AutoScalingRollingUpdate (Maybe (Val Integer'))+asruMinInstancesInService = lens _autoScalingRollingUpdateMinInstancesInService (\s a -> s { _autoScalingRollingUpdateMinInstancesInService = a })++-- | Specifies the percentage of instances in an Auto Scaling rolling update+-- that must signal success for an update to succeed. You can specify a value+-- from 0 to 100. AWS CloudFormation rounds to the nearest tenth of a percent.+-- For example, if you update five instances with a minimum successful+-- percentage of 50, three instances must signal success. If an instance+-- doesn't send a signal within the time specified using the PauseTime+-- property, AWS CloudFormation assumes that the instance wasn't successfully+-- updated. If you specify this property, you must also enable the+-- WaitOnResourceSignals and PauseTime properties.+asruMinSuccessfulInstancesPercent :: Lens' AutoScalingRollingUpdate (Maybe (Val Integer'))+asruMinSuccessfulInstancesPercent = lens _autoScalingRollingUpdateMinSuccessfulInstancesPercent (\s a -> s { _autoScalingRollingUpdateMinSuccessfulInstancesPercent = a })++-- | Specifies the amount of time that AWS CloudFormation should pause after+-- making a change to a batch of instances to give these instances time to+-- start software applications. For example, you might need PauseTime when+-- scaling up the number of instances in an Auto Scaling group. If you enable+-- the WaitOnResourceSignals property, PauseTime is the amount of time AWS+-- CloudFormation should wait for the Auto Scaling group to receive the+-- required number of valid signals from added or replaced instances. If the+-- PauseTime is exceeded before the Auto Scaling group receives the required+-- number of signals, the update fails. For best results, specify a time+-- period that gives your instances sufficient time to get started. If the+-- update needs to be rolled back, a short PauseTime can cause the rollback to+-- fail. Specify PauseTime in the ISO8601 duration format (in the format+-- PT#H#M#S, where each # is the number of hours, minutes, and seconds,+-- respectively). The maximum PauseTime is one hour (PT1H).+asruPauseTime :: Lens' AutoScalingRollingUpdate (Maybe (Val Text))+asruPauseTime = lens _autoScalingRollingUpdatePauseTime (\s a -> s { _autoScalingRollingUpdatePauseTime = a })++-- | Specifies the Auto Scaling processes to suspend during a stack update.+-- Suspending processes prevents Auto Scaling from interfering with a stack+-- update. For example, you can suspend alarming so that Auto Scaling doesn't+-- execute scaling policies associated with an alarm. For valid values, see+-- the ScalingProcesses.member.N parameter for the SuspendProcesses action in+-- the Auto Scaling API Reference.+asruSuspendProcess :: Lens' AutoScalingRollingUpdate (Maybe [Val Text])+asruSuspendProcess = lens _autoScalingRollingUpdateSuspendProcess (\s a -> s { _autoScalingRollingUpdateSuspendProcess = a })++-- | Specifies whether the Auto Scaling group waits on signals from new+-- instances during an update. AWS CloudFormation suspends the update of an+-- Auto Scaling group after new Amazon EC2 instances are launched into the+-- group. AWS CloudFormation must receive a signal from each new instance+-- within the specified PauseTime before continuing the update. To signal the+-- Auto Scaling group, use the cfn-signal helper script or SignalResource API.+-- Use this property to ensure that instances have completed installing and+-- configuring applications before the Auto Scaling group update proceeds.+asruWaitOnResourceSignals :: Lens' AutoScalingRollingUpdate (Maybe (Val Bool'))+asruWaitOnResourceSignals = lens _autoScalingRollingUpdateWaitOnResourceSignals (\s a -> s { _autoScalingRollingUpdateWaitOnResourceSignals = a })
+ library-gen/Stratosphere/ResourceAttributes/AutoScalingScheduledAction.hs view
@@ -0,0 +1,60 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | To specify how AWS CloudFormation handles updates for the MinSize,+-- MaxSize, and DesiredCapacity properties when the+-- AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled+-- action, use the AutoScalingScheduledAction policy. With scheduled actions,+-- the group size properties of an Auto Scaling group can change at any time.+-- When you update a stack with an Auto Scaling group and scheduled action,+-- AWS CloudFormation always sets the group size property values of your Auto+-- Scaling group to the values that are defined in the+-- AWS::AutoScaling::AutoScalingGroup resource of your template, even if a+-- scheduled action is in effect. If you do not want AWS CloudFormation to+-- change any of the group size property values when you have a scheduled+-- action in effect, use the AutoScalingScheduledAction update policy to+-- prevent AWS CloudFormation from changing the MinSize, MaxSize, or+-- DesiredCapacity properties unless you have modified these values in your+-- template.++module Stratosphere.ResourceAttributes.AutoScalingScheduledAction where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingScheduledAction. See+-- 'autoScalingScheduledAction' for a more convenient constructor.+data AutoScalingScheduledAction =+  AutoScalingScheduledAction+  { _autoScalingScheduledActionIgnoreUnmodifiedGroupSizeProperties :: Maybe (Val Bool')+  } deriving (Show, Generic)++instance ToJSON AutoScalingScheduledAction where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 27, omitNothingFields = True }++instance FromJSON AutoScalingScheduledAction where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 27, omitNothingFields = True }++-- | Constructor for 'AutoScalingScheduledAction' containing required fields+-- as arguments.+autoScalingScheduledAction+  :: AutoScalingScheduledAction+autoScalingScheduledAction  =+  AutoScalingScheduledAction+  { _autoScalingScheduledActionIgnoreUnmodifiedGroupSizeProperties = Nothing+  }++-- | Specifies whether AWS CloudFormation ignores differences in group size+-- properties between your current Auto Scaling group and the Auto Scaling+-- group described in the AWS::AutoScaling::AutoScalingGroup resource of your+-- template during a stack update. If you modify any of the group size+-- property values in your template, AWS CloudFormation uses the modified+-- values and updates your Auto Scaling group.+assaIgnoreUnmodifiedGroupSizeProperties :: Lens' AutoScalingScheduledAction (Maybe (Val Bool'))+assaIgnoreUnmodifiedGroupSizeProperties = lens _autoScalingScheduledActionIgnoreUnmodifiedGroupSizeProperties (\s a -> s { _autoScalingScheduledActionIgnoreUnmodifiedGroupSizeProperties = a })
+ library-gen/Stratosphere/ResourceAttributes/CreationPolicy.hs view
@@ -0,0 +1,58 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | You associate the CreationPolicy attribute with a resource to prevent its+-- status from reaching create complete until AWS CloudFormation receives a+-- specified number of success signals or the timeout period is exceeded. To+-- signal a resource, you can use the cfn-signal helper script or+-- SignalResource API. AWS CloudFormation publishes valid signals to the stack+-- events so that you track the number of signals sent. The creation policy is+-- invoked only when AWS CloudFormation creates the associated resource.+-- Currently, the only AWS CloudFormation resources that support creation+-- policies are AWS::AutoScaling::AutoScalingGroup, AWS::EC2::Instance, and+-- AWS::CloudFormation::WaitCondition. The CreationPolicy attribute is helpful+-- when you want to wait on resource configuration actions before stack+-- creation proceeds. For example, if you install and configure software+-- applications on an Amazon EC2 instance, you might want those applications+-- up and running before proceeding. In such cases, you can add a+-- CreationPolicy attribute to the instance and then send a success signal to+-- the instance after the applications are installed and configured. For a+-- detailed example, see Deploying Applications on Amazon EC2 with AWS+-- CloudFormation.++module Stratosphere.ResourceAttributes.CreationPolicy where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+import Stratosphere.ResourceAttributes.ResourceSignal++-- | Full data type definition for CreationPolicy. See 'creationPolicy' for a+-- more convenient constructor.+data CreationPolicy =+  CreationPolicy+  { _creationPolicyResourceSignal :: ResourceSignal+  } deriving (Show, Generic)++instance ToJSON CreationPolicy where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 15, omitNothingFields = True }++instance FromJSON CreationPolicy where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 15, omitNothingFields = True }++-- | Constructor for 'CreationPolicy' containing required fields as arguments.+creationPolicy+  :: ResourceSignal -- ^ 'cpResourceSignal'+  -> CreationPolicy+creationPolicy resourceSignalarg =+  CreationPolicy+  { _creationPolicyResourceSignal = resourceSignalarg+  }++-- |+cpResourceSignal :: Lens' CreationPolicy ResourceSignal+cpResourceSignal = lens _creationPolicyResourceSignal (\s a -> s { _creationPolicyResourceSignal = a })
+ library-gen/Stratosphere/ResourceAttributes/ResourceSignal.hs view
@@ -0,0 +1,58 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- |++module Stratosphere.ResourceAttributes.ResourceSignal where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for ResourceSignal. See 'resourceSignal' for a+-- more convenient constructor.+data ResourceSignal =+  ResourceSignal+  { _resourceSignalCount :: Maybe (Val Integer')+  , _resourceSignalTimeout :: Maybe (Val Text)+  } deriving (Show, Generic)++instance ToJSON ResourceSignal where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 15, omitNothingFields = True }++instance FromJSON ResourceSignal where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 15, omitNothingFields = True }++-- | Constructor for 'ResourceSignal' containing required fields as arguments.+resourceSignal+  :: ResourceSignal+resourceSignal  =+  ResourceSignal+  { _resourceSignalCount = Nothing+  , _resourceSignalTimeout = Nothing+  }++-- | The number of success signals AWS CloudFormation must receive before it+-- sets the resource status as CREATE_COMPLETE. If the resource receives a+-- failure signal or doesn't receive the specified number of signals before+-- the timeout period expires, the resource creation fails and AWS+-- CloudFormation rolls the stack back.+rsCount :: Lens' ResourceSignal (Maybe (Val Integer'))+rsCount = lens _resourceSignalCount (\s a -> s { _resourceSignalCount = a })++-- | The length of time that AWS CloudFormation waits for the number of+-- signals that was specified in the Count property. The timeout period starts+-- after AWS CloudFormation starts creating the resource, and the timeout+-- expires no sooner than the time you specify but can occur shortly+-- thereafter. The maximum time that you can specify is 12 hours. The value+-- must be in ISO8601 duration format, in the form: "PT#H#M#S", where each #+-- is the number of hours, minutes, and seconds, respectively. For best+-- results, specify a period of time that gives your instances plenty of time+-- to get up and running. A shorter timeout can cause a rollback.+rsTimeout :: Lens' ResourceSignal (Maybe (Val Text))+rsTimeout = lens _resourceSignalTimeout (\s a -> s { _resourceSignalTimeout = a })
+ library-gen/Stratosphere/ResourceAttributes/UpdatePolicy.hs view
@@ -0,0 +1,58 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | Use the UpdatePolicy attribute to specify how AWS CloudFormation handles+-- updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS+-- CloudFormation invokes one of three update policies depending on the type+-- of change you make or on whether a scheduled action is associated with the+-- Auto Scaling group.++module Stratosphere.ResourceAttributes.UpdatePolicy where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+import Stratosphere.ResourceAttributes.AutoScalingReplacingUpdate+import Stratosphere.ResourceAttributes.AutoScalingRollingUpdate+import Stratosphere.ResourceAttributes.AutoScalingScheduledAction++-- | Full data type definition for UpdatePolicy. See 'updatePolicy' for a more+-- convenient constructor.+data UpdatePolicy =+  UpdatePolicy+  { _updatePolicyAutoScalingReplacingUpdate :: Maybe AutoScalingReplacingUpdate+  , _updatePolicyAutoScalingRollingUpdate :: Maybe AutoScalingRollingUpdate+  , _updatePolicyAutoScalingScheduledAction :: Maybe AutoScalingScheduledAction+  } deriving (Show, Generic)++instance ToJSON UpdatePolicy where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 13, omitNothingFields = True }++instance FromJSON UpdatePolicy where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 13, omitNothingFields = True }++-- | Constructor for 'UpdatePolicy' containing required fields as arguments.+updatePolicy+  :: UpdatePolicy+updatePolicy  =+  UpdatePolicy+  { _updatePolicyAutoScalingReplacingUpdate = Nothing+  , _updatePolicyAutoScalingRollingUpdate = Nothing+  , _updatePolicyAutoScalingScheduledAction = Nothing+  }++-- |+upAutoScalingReplacingUpdate :: Lens' UpdatePolicy (Maybe AutoScalingReplacingUpdate)+upAutoScalingReplacingUpdate = lens _updatePolicyAutoScalingReplacingUpdate (\s a -> s { _updatePolicyAutoScalingReplacingUpdate = a })++-- |+upAutoScalingRollingUpdate :: Lens' UpdatePolicy (Maybe AutoScalingRollingUpdate)+upAutoScalingRollingUpdate = lens _updatePolicyAutoScalingRollingUpdate (\s a -> s { _updatePolicyAutoScalingRollingUpdate = a })++-- |+upAutoScalingScheduledAction :: Lens' UpdatePolicy (Maybe AutoScalingScheduledAction)+upAutoScalingScheduledAction = lens _updatePolicyAutoScalingScheduledAction (\s a -> s { _updatePolicyAutoScalingScheduledAction = a })
+ library-gen/Stratosphere/ResourceProperties/AutoScalingBlockDeviceMapping.hs view
@@ -0,0 +1,64 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The AutoScaling Block Device Mapping type is an embedded property of the+-- AWS::AutoScaling::LaunchConfiguration type.++module Stratosphere.ResourceProperties.AutoScalingBlockDeviceMapping where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+import Stratosphere.ResourceProperties.AutoScalingEBSBlockDevice++-- | Full data type definition for AutoScalingBlockDeviceMapping. See+-- 'autoScalingBlockDeviceMapping' for a more convenient constructor.+data AutoScalingBlockDeviceMapping =+  AutoScalingBlockDeviceMapping+  { _autoScalingBlockDeviceMappingDeviceName :: Val Text+  , _autoScalingBlockDeviceMappingEbs :: Maybe AutoScalingEBSBlockDevice+  , _autoScalingBlockDeviceMappingNoDevice :: Maybe (Val Bool')+  , _autoScalingBlockDeviceMappingVirtualName :: Maybe (Val Text)+  } deriving (Show, Generic)++instance ToJSON AutoScalingBlockDeviceMapping where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 30, omitNothingFields = True }++instance FromJSON AutoScalingBlockDeviceMapping where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 30, omitNothingFields = True }++-- | Constructor for 'AutoScalingBlockDeviceMapping' containing required+-- fields as arguments.+autoScalingBlockDeviceMapping+  :: Val Text -- ^ 'asbdmDeviceName'+  -> AutoScalingBlockDeviceMapping+autoScalingBlockDeviceMapping deviceNamearg =+  AutoScalingBlockDeviceMapping+  { _autoScalingBlockDeviceMappingDeviceName = deviceNamearg+  , _autoScalingBlockDeviceMappingEbs = Nothing+  , _autoScalingBlockDeviceMappingNoDevice = Nothing+  , _autoScalingBlockDeviceMappingVirtualName = Nothing+  }++-- | The name of the device within Amazon EC2.+asbdmDeviceName :: Lens' AutoScalingBlockDeviceMapping (Val Text)+asbdmDeviceName = lens _autoScalingBlockDeviceMappingDeviceName (\s a -> s { _autoScalingBlockDeviceMappingDeviceName = a })++-- | The Amazon Elastic Block Store volume information.+asbdmEbs :: Lens' AutoScalingBlockDeviceMapping (Maybe AutoScalingEBSBlockDevice)+asbdmEbs = lens _autoScalingBlockDeviceMappingEbs (\s a -> s { _autoScalingBlockDeviceMappingEbs = a })++-- | Suppresses the device mapping. If NoDevice is set to true for the root+-- device, the instance might fail the Amazon EC2 health check. Auto Scaling+-- launches a replacement instance if the instance fails the health check.+asbdmNoDevice :: Lens' AutoScalingBlockDeviceMapping (Maybe (Val Bool'))+asbdmNoDevice = lens _autoScalingBlockDeviceMappingNoDevice (\s a -> s { _autoScalingBlockDeviceMappingNoDevice = a })++-- | The name of the virtual device. The name must be in the form ephemeralX+-- where X is a number starting from zero (0), for example, ephemeral0.+asbdmVirtualName :: Lens' AutoScalingBlockDeviceMapping (Maybe (Val Text))+asbdmVirtualName = lens _autoScalingBlockDeviceMappingVirtualName (\s a -> s { _autoScalingBlockDeviceMappingVirtualName = a })
+ library-gen/Stratosphere/ResourceProperties/AutoScalingEBSBlockDevice.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The AutoScaling EBS Block Device type is an embedded property of the+-- AutoScaling Block Device Mapping type.++module Stratosphere.ResourceProperties.AutoScalingEBSBlockDevice where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingEBSBlockDevice. See+-- 'autoScalingEBSBlockDevice' for a more convenient constructor.+data AutoScalingEBSBlockDevice =+  AutoScalingEBSBlockDevice+  { _autoScalingEBSBlockDeviceDeleteOnTermination :: Maybe (Val Bool')+  , _autoScalingEBSBlockDeviceEncrypted :: Maybe (Val Bool')+  , _autoScalingEBSBlockDeviceIops :: Maybe (Val Integer')+  , _autoScalingEBSBlockDeviceSnapshotId :: Maybe (Val Text)+  , _autoScalingEBSBlockDeviceVolumeSize :: Maybe (Val Integer')+  , _autoScalingEBSBlockDeviceVolumeType :: Maybe (Val Text)+  } deriving (Show, Generic)++instance ToJSON AutoScalingEBSBlockDevice where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 26, omitNothingFields = True }++instance FromJSON AutoScalingEBSBlockDevice where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 26, omitNothingFields = True }++-- | Constructor for 'AutoScalingEBSBlockDevice' containing required fields as+-- arguments.+autoScalingEBSBlockDevice+  :: AutoScalingEBSBlockDevice+autoScalingEBSBlockDevice  =+  AutoScalingEBSBlockDevice+  { _autoScalingEBSBlockDeviceDeleteOnTermination = Nothing+  , _autoScalingEBSBlockDeviceEncrypted = Nothing+  , _autoScalingEBSBlockDeviceIops = Nothing+  , _autoScalingEBSBlockDeviceSnapshotId = Nothing+  , _autoScalingEBSBlockDeviceVolumeSize = Nothing+  , _autoScalingEBSBlockDeviceVolumeType = Nothing+  }++-- | Indicates whether to delete the volume when the instance is terminated.+-- By default, Auto Scaling uses true.+asebsbdDeleteOnTermination :: Lens' AutoScalingEBSBlockDevice (Maybe (Val Bool'))+asebsbdDeleteOnTermination = lens _autoScalingEBSBlockDeviceDeleteOnTermination (\s a -> s { _autoScalingEBSBlockDeviceDeleteOnTermination = a })++-- | Indicates whether the volume is encrypted. Encrypted EBS volumes must be+-- attached to instances that support Amazon EBS encryption. Volumes that you+-- create from encrypted snapshots are automatically encrypted. You cannot+-- create an encrypted volume from an unencrypted snapshot or an unencrypted+-- volume from an encrypted snapshot.+asebsbdEncrypted :: Lens' AutoScalingEBSBlockDevice (Maybe (Val Bool'))+asebsbdEncrypted = lens _autoScalingEBSBlockDeviceEncrypted (\s a -> s { _autoScalingEBSBlockDeviceEncrypted = a })++-- | The number of I/O operations per second (IOPS) that the volume supports.+-- The maximum ratio of IOPS to volume size is 30.+asebsbdIops :: Lens' AutoScalingEBSBlockDevice (Maybe (Val Integer'))+asebsbdIops = lens _autoScalingEBSBlockDeviceIops (\s a -> s { _autoScalingEBSBlockDeviceIops = a })++-- | The snapshot ID of the volume to use.+asebsbdSnapshotId :: Lens' AutoScalingEBSBlockDevice (Maybe (Val Text))+asebsbdSnapshotId = lens _autoScalingEBSBlockDeviceSnapshotId (\s a -> s { _autoScalingEBSBlockDeviceSnapshotId = a })++-- | The volume size, in Gibibytes (GiB). This can be a number from 1 – 1024.+-- If the volume type is EBS optimized, the minimum value is 10. For more+-- information about specifying the volume type, see EbsOptimized in+-- AWS::AutoScaling::LaunchConfiguration.+asebsbdVolumeSize :: Lens' AutoScalingEBSBlockDevice (Maybe (Val Integer'))+asebsbdVolumeSize = lens _autoScalingEBSBlockDeviceVolumeSize (\s a -> s { _autoScalingEBSBlockDeviceVolumeSize = a })++-- | The volume type. By default, Auto Scaling uses the standard volume type.+-- For more information, see Ebs in the Auto Scaling API Reference.+asebsbdVolumeType :: Lens' AutoScalingEBSBlockDevice (Maybe (Val Text))+asebsbdVolumeType = lens _autoScalingEBSBlockDeviceVolumeType (\s a -> s { _autoScalingEBSBlockDeviceVolumeType = a })
+ library-gen/Stratosphere/ResourceProperties/AutoScalingMetricsCollection.hs view
@@ -0,0 +1,55 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The MetricsCollection is a property of the+-- AWS::AutoScaling::AutoScalingGroup resource that describes the group+-- metrics that an Auto Scaling group sends to CloudWatch. These metrics+-- describe the group rather than any of its instances. For more information,+-- see EnableMetricsCollection in the Auto Scaling API Reference.++module Stratosphere.ResourceProperties.AutoScalingMetricsCollection where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingMetricsCollection. See+-- 'autoScalingMetricsCollection' for a more convenient constructor.+data AutoScalingMetricsCollection =+  AutoScalingMetricsCollection+  { _autoScalingMetricsCollectionGranularity :: Val Text+  , _autoScalingMetricsCollectionMetrics :: Maybe [Val Text]+  } deriving (Show, Generic)++instance ToJSON AutoScalingMetricsCollection where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 29, omitNothingFields = True }++instance FromJSON AutoScalingMetricsCollection where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 29, omitNothingFields = True }++-- | Constructor for 'AutoScalingMetricsCollection' containing required fields+-- as arguments.+autoScalingMetricsCollection+  :: Val Text -- ^ 'asmcGranularity'+  -> AutoScalingMetricsCollection+autoScalingMetricsCollection granularityarg =+  AutoScalingMetricsCollection+  { _autoScalingMetricsCollectionGranularity = granularityarg+  , _autoScalingMetricsCollectionMetrics = Nothing+  }++-- | The frequency at which Auto Scaling sends aggregated data to CloudWatch.+-- For example, you can specify 1Minute to send aggregated data to CloudWatch+-- every minute.+asmcGranularity :: Lens' AutoScalingMetricsCollection (Val Text)+asmcGranularity = lens _autoScalingMetricsCollectionGranularity (\s a -> s { _autoScalingMetricsCollectionGranularity = a })++-- | The list of metrics to collect. If you don't specify any metrics, all+-- metrics are enabled.+asmcMetrics :: Lens' AutoScalingMetricsCollection (Maybe [Val Text])+asmcMetrics = lens _autoScalingMetricsCollectionMetrics (\s a -> s { _autoScalingMetricsCollectionMetrics = a })
+ library-gen/Stratosphere/ResourceProperties/AutoScalingNotificationConfigurations.hs view
@@ -0,0 +1,57 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The NotificationConfigurations property is an embedded property of the+-- AWS::AutoScaling::AutoScalingGroup resource that specifies the events for+-- which the Auto Scaling group sends notifications.++module Stratosphere.ResourceProperties.AutoScalingNotificationConfigurations where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingNotificationConfigurations. See+-- 'autoScalingNotificationConfigurations' for a more convenient constructor.+data AutoScalingNotificationConfigurations =+  AutoScalingNotificationConfigurations+  { _autoScalingNotificationConfigurationsNotificationTypes :: [Val Text]+  , _autoScalingNotificationConfigurationsTopicARN :: Val Text+  } deriving (Show, Generic)++instance ToJSON AutoScalingNotificationConfigurations where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 38, omitNothingFields = True }++instance FromJSON AutoScalingNotificationConfigurations where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 38, omitNothingFields = True }++-- | Constructor for 'AutoScalingNotificationConfigurations' containing+-- required fields as arguments.+autoScalingNotificationConfigurations+  :: [Val Text] -- ^ 'asncNotificationTypes'+  -> Val Text -- ^ 'asncTopicARN'+  -> AutoScalingNotificationConfigurations+autoScalingNotificationConfigurations notificationTypesarg topicARNarg =+  AutoScalingNotificationConfigurations+  { _autoScalingNotificationConfigurationsNotificationTypes = notificationTypesarg+  , _autoScalingNotificationConfigurationsTopicARN = topicARNarg+  }++-- | A list of event types that trigger a notification. Event types can+-- include any of the following types: autoscaling:EC2_INSTANCE_LAUNCH,+-- autoscaling:EC2_INSTANCE_LAUNCH_ERROR, autoscaling:EC2_INSTANCE_TERMINATE,+-- autoscaling:EC2_INSTANCE_TERMINATE_ERROR, and+-- autoscaling:TEST_NOTIFICATION. For more information about event types, see+-- DescribeAutoScalingNotificationTypes in the Auto Scaling API Reference.+asncNotificationTypes :: Lens' AutoScalingNotificationConfigurations [Val Text]+asncNotificationTypes = lens _autoScalingNotificationConfigurationsNotificationTypes (\s a -> s { _autoScalingNotificationConfigurationsNotificationTypes = a })++-- | The Amazon Resource Name (ARN) of the Amazon Simple Notification Service+-- (SNS) topic.+asncTopicARN :: Lens' AutoScalingNotificationConfigurations (Val Text)+asncTopicARN = lens _autoScalingNotificationConfigurationsTopicARN (\s a -> s { _autoScalingNotificationConfigurationsTopicARN = a })
+ library-gen/Stratosphere/ResourceProperties/AutoScalingTags.hs view
@@ -0,0 +1,63 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The Auto Scaling Tags property is an embedded property of the+-- AWS::AutoScaling::AutoScalingGroup type. For more information about tags,+-- go to Tagging Auto Scaling Groups and Amazon EC2 Instances in the Auto+-- Scaling User Guide. AWS CloudFormation adds the following tags to all Auto+-- Scaling groups and associated instances:++module Stratosphere.ResourceProperties.AutoScalingTags where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for AutoScalingTags. See 'autoScalingTags' for+-- a more convenient constructor.+data AutoScalingTags =+  AutoScalingTags+  { _autoScalingTagsKey :: Val Text+  , _autoScalingTagsValue :: Val Text+  , _autoScalingTagsPropagateAtLaunch :: Val Bool'+  } deriving (Show, Generic)++instance ToJSON AutoScalingTags where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }++instance FromJSON AutoScalingTags where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }++-- | Constructor for 'AutoScalingTags' containing required fields as+-- arguments.+autoScalingTags+  :: Val Text -- ^ 'astKey'+  -> Val Text -- ^ 'astValue'+  -> Val Bool' -- ^ 'astPropagateAtLaunch'+  -> AutoScalingTags+autoScalingTags keyarg valuearg propagateAtLauncharg =+  AutoScalingTags+  { _autoScalingTagsKey = keyarg+  , _autoScalingTagsValue = valuearg+  , _autoScalingTagsPropagateAtLaunch = propagateAtLauncharg+  }++-- | The key name of the tag.+astKey :: Lens' AutoScalingTags (Val Text)+astKey = lens _autoScalingTagsKey (\s a -> s { _autoScalingTagsKey = a })++-- | The value for the tag.+astValue :: Lens' AutoScalingTags (Val Text)+astValue = lens _autoScalingTagsValue (\s a -> s { _autoScalingTagsValue = a })++-- | Set to true if you want AWS CloudFormation to copy the tag to EC2+-- instances that are launched as part of the auto scaling group. Set to false+-- if you want the tag attached only to the auto scaling group and not copied+-- to any instances launched as part of the auto scaling group.+astPropagateAtLaunch :: Lens' AutoScalingTags (Val Bool')+astPropagateAtLaunch = lens _autoScalingTagsPropagateAtLaunch (\s a -> s { _autoScalingTagsPropagateAtLaunch = a })
+ library-gen/Stratosphere/ResourceProperties/StepAdjustments.hs view
@@ -0,0 +1,70 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | StepAdjustments is a property of the AWS::AutoScaling::ScalingPolicy+-- resource that describes a scaling adjustment based on the difference+-- between the value of the aggregated CloudWatch metric and the breach+-- threshold that you've defined for the alarm. For more information, see+-- StepAdjustment in the Auto Scaling API Reference.++module Stratosphere.ResourceProperties.StepAdjustments where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for StepAdjustments. See 'stepAdjustments' for+-- a more convenient constructor.+data StepAdjustments =+  StepAdjustments+  { _stepAdjustmentsMetricIntervalLowerBound :: Maybe Double'+  , _stepAdjustmentsMetricIntervalUpperBound :: Maybe Double'+  , _stepAdjustmentsScalingAdjustment :: Val Integer'+  } deriving (Show, Generic)++instance ToJSON StepAdjustments where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }++instance FromJSON StepAdjustments where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }++-- | Constructor for 'StepAdjustments' containing required fields as+-- arguments.+stepAdjustments+  :: Val Integer' -- ^ 'saScalingAdjustment'+  -> StepAdjustments+stepAdjustments scalingAdjustmentarg =+  StepAdjustments+  { _stepAdjustmentsMetricIntervalLowerBound = Nothing+  , _stepAdjustmentsMetricIntervalUpperBound = Nothing+  , _stepAdjustmentsScalingAdjustment = scalingAdjustmentarg+  }++-- | The lower bound for the difference between the breach threshold and the+-- CloudWatch metric. If the metric value exceeds the breach threshold, the+-- lower bound is inclusive (the metric must be greater than or equal to the+-- threshold plus the lower bound). Otherwise, it is exclusive (the metric+-- must be greater than the threshold plus the lower bound). A null value+-- indicates negative infinity.+saMetricIntervalLowerBound :: Lens' StepAdjustments (Maybe Double')+saMetricIntervalLowerBound = lens _stepAdjustmentsMetricIntervalLowerBound (\s a -> s { _stepAdjustmentsMetricIntervalLowerBound = a })++-- | The upper bound for the difference between the breach threshold and the+-- CloudWatch metric. If the metric value exceeds the breach threshold, the+-- upper bound is exclusive (the metric must be less than the threshold plus+-- the upper bound). Otherwise, it is inclusive (the metric must be less than+-- or equal to the threshold plus the upper bound). A null value indicates+-- positive infinity.+saMetricIntervalUpperBound :: Lens' StepAdjustments (Maybe Double')+saMetricIntervalUpperBound = lens _stepAdjustmentsMetricIntervalUpperBound (\s a -> s { _stepAdjustmentsMetricIntervalUpperBound = a })++-- | The amount by which to scale, based on the value that you specified in+-- the AdjustmentType property. A positive value adds to the current capacity+-- and a negative number subtracts from the current capacity.+saScalingAdjustment :: Lens' StepAdjustments (Val Integer')+saScalingAdjustment = lens _stepAdjustmentsScalingAdjustment (\s a -> s { _stepAdjustmentsScalingAdjustment = a })
library-gen/Stratosphere/Resources.hs view
@@ -23,6 +23,9 @@      , resource      , properties      , deletionPolicy+     , resCreationPolicy+     , resUpdatePolicy+     , dependsOn      , ResourceProperties (..)      , DeletionPolicy (..)      , Resources (..)@@ -40,6 +43,7 @@ import Stratosphere.Resources.Subnet as X import Stratosphere.Resources.DBInstance as X import Stratosphere.Resources.IAMRole as X+import Stratosphere.Resources.LifecycleHook as X import Stratosphere.Resources.Group as X import Stratosphere.Resources.DBSubnetGroup as X import Stratosphere.Resources.SecurityGroup as X@@ -54,6 +58,7 @@ import Stratosphere.Resources.EIP as X import Stratosphere.Resources.User as X import Stratosphere.Resources.DBSecurityGroup as X+import Stratosphere.Resources.LaunchConfiguration as X import Stratosphere.Resources.SubnetRouteTableAssociation as X import Stratosphere.Resources.RecordSetGroup as X import Stratosphere.Resources.Stack as X@@ -61,6 +66,9 @@ import Stratosphere.Resources.VPC as X import Stratosphere.Resources.AccessKey as X import Stratosphere.Resources.LoadBalancer as X+import Stratosphere.Resources.ScalingPolicy as X+import Stratosphere.Resources.AutoScalingGroup as X+import Stratosphere.Resources.ScheduledAction as X import Stratosphere.Resources.Volume as X import Stratosphere.Resources.UserToGroupAddition as X import Stratosphere.Resources.VPCEndpoint as X@@ -73,12 +81,14 @@ import Stratosphere.ResourceProperties.HealthCheck as X import Stratosphere.ResourceProperties.EC2SsmAssociationParameters as X import Stratosphere.ResourceProperties.ELBPolicy as X+import Stratosphere.ResourceProperties.AutoScalingMetricsCollection as X import Stratosphere.ResourceProperties.LBCookieStickinessPolicy as X import Stratosphere.ResourceProperties.AliasTarget as X import Stratosphere.ResourceProperties.NetworkInterface as X import Stratosphere.ResourceProperties.SecurityGroupEgressRule as X import Stratosphere.ResourceProperties.EC2BlockDeviceMapping as X import Stratosphere.ResourceProperties.RecordSetGeoLocation as X+import Stratosphere.ResourceProperties.AutoScalingBlockDeviceMapping as X import Stratosphere.ResourceProperties.PrivateIpAddressSpecification as X import Stratosphere.ResourceProperties.IAMPolicies as X import Stratosphere.ResourceProperties.ListenerProperty as X@@ -88,11 +98,22 @@ import Stratosphere.ResourceProperties.SecurityGroupIngressRule as X import Stratosphere.ResourceProperties.RDSSecurityGroupRule as X import Stratosphere.ResourceProperties.EBSBlockDevice as X+import Stratosphere.ResourceProperties.StepAdjustments as X import Stratosphere.ResourceProperties.AccessLoggingPolicy as X+import Stratosphere.ResourceProperties.AutoScalingTags as X+import Stratosphere.ResourceProperties.AutoScalingEBSBlockDevice as X+import Stratosphere.ResourceProperties.AutoScalingNotificationConfigurations as X import Stratosphere.ResourceProperties.AppCookieStickinessPolicy as X import Stratosphere.ResourceProperties.ConnectionSettings as X import Stratosphere.ResourceProperties.UserLoginProfile as X +import Stratosphere.ResourceAttributes.ResourceSignal as X+import Stratosphere.ResourceAttributes.AutoScalingRollingUpdate as X+import Stratosphere.ResourceAttributes.CreationPolicy as X+import Stratosphere.ResourceAttributes.AutoScalingReplacingUpdate as X+import Stratosphere.ResourceAttributes.UpdatePolicy as X+import Stratosphere.ResourceAttributes.AutoScalingScheduledAction as X+ import Stratosphere.Helpers import Stratosphere.Values @@ -101,6 +122,7 @@   | SubnetProperties Subnet   | DBInstanceProperties DBInstance   | IAMRoleProperties IAMRole+  | LifecycleHookProperties LifecycleHook   | GroupProperties Group   | DBSubnetGroupProperties DBSubnetGroup   | SecurityGroupProperties SecurityGroup@@ -115,6 +137,7 @@   | EIPProperties EIP   | UserProperties User   | DBSecurityGroupProperties DBSecurityGroup+  | LaunchConfigurationProperties LaunchConfiguration   | SubnetRouteTableAssociationProperties SubnetRouteTableAssociation   | RecordSetGroupProperties RecordSetGroup   | StackProperties Stack@@ -122,6 +145,9 @@   | VPCProperties VPC   | AccessKeyProperties AccessKey   | LoadBalancerProperties LoadBalancer+  | ScalingPolicyProperties ScalingPolicy+  | AutoScalingGroupProperties AutoScalingGroup+  | ScheduledActionProperties ScheduledAction   | VolumeProperties Volume   | UserToGroupAdditionProperties UserToGroupAddition   | VPCEndpointProperties VPCEndpoint@@ -146,6 +172,9 @@   { resourceName :: T.Text   , resourceProperties :: ResourceProperties   , resourceDeletionPolicy :: Maybe DeletionPolicy+  , resourceResCreationPolicy :: Maybe CreationPolicy+  , resourceResUpdatePolicy :: Maybe UpdatePolicy+  , resourceDependsOn :: Maybe [Val T.Text]   } deriving (Show)  instance ToRef Resource b where@@ -161,14 +190,21 @@   { resourceName = rn   , resourceProperties = rp   , resourceDeletionPolicy = Nothing+  , resourceResCreationPolicy = Nothing+  , resourceResUpdatePolicy = Nothing+  , resourceDependsOn = Nothing   }  $(makeFields ''Resource)  resourceToJSON :: Resource -> Value-resourceToJSON (Resource _ props dp) =+resourceToJSON (Resource _ props dp cp up deps) =     object $ resourcePropertiesJSON props ++ catMaybes-    [ maybeField "DeletionPolicy" dp ]+    [ maybeField "DeletionPolicy" dp+    , maybeField "CreationPolicy" cp+    , maybeField "UpdatePolicy" up+    , maybeField "DependsOn" deps+    ]  resourcePropertiesJSON :: ResourceProperties -> [Pair] resourcePropertiesJSON (DBSecurityGroupIngressProperties x) =@@ -179,6 +215,8 @@   [ "Type" .= ("AWS::RDS::DBInstance" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (IAMRoleProperties x) =   [ "Type" .= ("AWS::IAM::Role" :: String), "Properties" .= toJSON x]+resourcePropertiesJSON (LifecycleHookProperties x) =+  [ "Type" .= ("AWS::AutoScaling::LifecycleHook" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (GroupProperties x) =   [ "Type" .= ("AWS::IAM::Group" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (DBSubnetGroupProperties x) =@@ -207,6 +245,8 @@   [ "Type" .= ("AWS::IAM::User" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (DBSecurityGroupProperties x) =   [ "Type" .= ("AWS::RDS::DBSecurityGroup" :: String), "Properties" .= toJSON x]+resourcePropertiesJSON (LaunchConfigurationProperties x) =+  [ "Type" .= ("AWS::AutoScaling::LaunchConfiguration" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (SubnetRouteTableAssociationProperties x) =   [ "Type" .= ("AWS::EC2::SubnetRouteTableAssociation" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (RecordSetGroupProperties x) =@@ -221,6 +261,12 @@   [ "Type" .= ("AWS::IAM::AccessKey" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (LoadBalancerProperties x) =   [ "Type" .= ("AWS::ElasticLoadBalancing::LoadBalancer" :: String), "Properties" .= toJSON x]+resourcePropertiesJSON (ScalingPolicyProperties x) =+  [ "Type" .= ("AWS::AutoScaling::ScalingPolicy" :: String), "Properties" .= toJSON x]+resourcePropertiesJSON (AutoScalingGroupProperties x) =+  [ "Type" .= ("AWS::AutoScaling::AutoScalingGroup" :: String), "Properties" .= toJSON x]+resourcePropertiesJSON (ScheduledActionProperties x) =+  [ "Type" .= ("AWS::AutoScaling::ScheduledAction" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (VolumeProperties x) =   [ "Type" .= ("AWS::EC2::Volume" :: String), "Properties" .= toJSON x] resourcePropertiesJSON (UserToGroupAdditionProperties x) =@@ -245,6 +291,7 @@          "AWS::EC2::Subnet" -> SubnetProperties <$> (o .: "Properties")          "AWS::RDS::DBInstance" -> DBInstanceProperties <$> (o .: "Properties")          "AWS::IAM::Role" -> IAMRoleProperties <$> (o .: "Properties")+         "AWS::AutoScaling::LifecycleHook" -> LifecycleHookProperties <$> (o .: "Properties")          "AWS::IAM::Group" -> GroupProperties <$> (o .: "Properties")          "AWS::RDS::DBSubnetGroup" -> DBSubnetGroupProperties <$> (o .: "Properties")          "AWS::EC2::SecurityGroup" -> SecurityGroupProperties <$> (o .: "Properties")@@ -259,6 +306,7 @@          "AWS::EC2::EIP" -> EIPProperties <$> (o .: "Properties")          "AWS::IAM::User" -> UserProperties <$> (o .: "Properties")          "AWS::RDS::DBSecurityGroup" -> DBSecurityGroupProperties <$> (o .: "Properties")+         "AWS::AutoScaling::LaunchConfiguration" -> LaunchConfigurationProperties <$> (o .: "Properties")          "AWS::EC2::SubnetRouteTableAssociation" -> SubnetRouteTableAssociationProperties <$> (o .: "Properties")          "AWS::Route53::RecordSetGroup" -> RecordSetGroupProperties <$> (o .: "Properties")          "AWS::CloudFormation::Stack" -> StackProperties <$> (o .: "Properties")@@ -266,6 +314,9 @@          "AWS::EC2::VPC" -> VPCProperties <$> (o .: "Properties")          "AWS::IAM::AccessKey" -> AccessKeyProperties <$> (o .: "Properties")          "AWS::ElasticLoadBalancing::LoadBalancer" -> LoadBalancerProperties <$> (o .: "Properties")+         "AWS::AutoScaling::ScalingPolicy" -> ScalingPolicyProperties <$> (o .: "Properties")+         "AWS::AutoScaling::AutoScalingGroup" -> AutoScalingGroupProperties <$> (o .: "Properties")+         "AWS::AutoScaling::ScheduledAction" -> ScheduledActionProperties <$> (o .: "Properties")          "AWS::EC2::Volume" -> VolumeProperties <$> (o .: "Properties")          "AWS::IAM::UserToGroupAddition" -> UserToGroupAdditionProperties <$> (o .: "Properties")          "AWS::EC2::VPCEndpoint" -> VPCEndpointProperties <$> (o .: "Properties")@@ -276,7 +327,10 @@           _ -> fail $ "Unknown resource type: " ++ type'        dp <- o .:? "DeletionPolicy"-       return $ Resource n props dp+       cp <- o .:? "CreationPolicy"+       up <- o .:? "UpdatePolicy"+       deps <- o .:? "DependsOn"+       return $ Resource n props dp cp up deps  -- | Wrapper around a list of 'Resources's to we can modify the aeson -- instances.
+ library-gen/Stratosphere/Resources/AutoScalingGroup.hs view
@@ -0,0 +1,175 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The AWS::AutoScaling::AutoScalingGroup type creates an Auto Scaling+-- group. You can add an UpdatePolicy attribute to your Auto Scaling group to+-- control how rolling updates are performed when a change has been made to+-- the Auto Scaling group's launch configuration or subnet group membership.++module Stratosphere.Resources.AutoScalingGroup where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+import Stratosphere.ResourceProperties.AutoScalingMetricsCollection+import Stratosphere.ResourceProperties.AutoScalingNotificationConfigurations+import Stratosphere.ResourceProperties.AutoScalingTags++-- | Full data type definition for AutoScalingGroup. See 'autoScalingGroup'+-- for a more convenient constructor.+data AutoScalingGroup =+  AutoScalingGroup+  { _autoScalingGroupAvailabilityZones :: Maybe [Val Text]+  , _autoScalingGroupCooldown :: Maybe (Val Text)+  , _autoScalingGroupDesiredCapacity :: Maybe (Val Text)+  , _autoScalingGroupHealthCheckGracePeriod :: Maybe (Val Integer')+  , _autoScalingGroupHealthCheckType :: Maybe (Val Text)+  , _autoScalingGroupInstanceId :: Maybe (Val Text)+  , _autoScalingGroupLaunchConfigurationName :: Maybe (Val Text)+  , _autoScalingGroupLoadBalancerNames :: Maybe [Val Text]+  , _autoScalingGroupMaxSize :: Val Text+  , _autoScalingGroupMetricsCollection :: Maybe [AutoScalingMetricsCollection]+  , _autoScalingGroupMinSize :: Val Text+  , _autoScalingGroupNotificationConfigurations :: Maybe [AutoScalingNotificationConfigurations]+  , _autoScalingGroupPlacementGroup :: Maybe (Val Text)+  , _autoScalingGroupTags :: Maybe [AutoScalingTags]+  , _autoScalingGroupTerminationPolicies :: Maybe [Val Text]+  , _autoScalingGroupVPCZoneIdentifier :: Maybe [Val Text]+  } deriving (Show, Generic)++instance ToJSON AutoScalingGroup where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 17, omitNothingFields = True }++instance FromJSON AutoScalingGroup where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 17, omitNothingFields = True }++-- | Constructor for 'AutoScalingGroup' containing required fields as+-- arguments.+autoScalingGroup+  :: Val Text -- ^ 'asgMaxSize'+  -> Val Text -- ^ 'asgMinSize'+  -> AutoScalingGroup+autoScalingGroup maxSizearg minSizearg =+  AutoScalingGroup+  { _autoScalingGroupAvailabilityZones = Nothing+  , _autoScalingGroupCooldown = Nothing+  , _autoScalingGroupDesiredCapacity = Nothing+  , _autoScalingGroupHealthCheckGracePeriod = Nothing+  , _autoScalingGroupHealthCheckType = Nothing+  , _autoScalingGroupInstanceId = Nothing+  , _autoScalingGroupLaunchConfigurationName = Nothing+  , _autoScalingGroupLoadBalancerNames = Nothing+  , _autoScalingGroupMaxSize = maxSizearg+  , _autoScalingGroupMetricsCollection = Nothing+  , _autoScalingGroupMinSize = minSizearg+  , _autoScalingGroupNotificationConfigurations = Nothing+  , _autoScalingGroupPlacementGroup = Nothing+  , _autoScalingGroupTags = Nothing+  , _autoScalingGroupTerminationPolicies = Nothing+  , _autoScalingGroupVPCZoneIdentifier = Nothing+  }++-- | Contains a list of availability zones for the group.+asgAvailabilityZones :: Lens' AutoScalingGroup (Maybe [Val Text])+asgAvailabilityZones = lens _autoScalingGroupAvailabilityZones (\s a -> s { _autoScalingGroupAvailabilityZones = a })++-- | The number of seconds after a scaling activity is completed before any+-- further scaling activities can start.+asgCooldown :: Lens' AutoScalingGroup (Maybe (Val Text))+asgCooldown = lens _autoScalingGroupCooldown (\s a -> s { _autoScalingGroupCooldown = a })++-- | Specifies the desired capacity for the Auto Scaling group. If SpotPrice+-- is not set in the AWS::AutoScaling::LaunchConfiguration for this Auto+-- Scaling group, then Auto Scaling will begin to bring instances online based+-- on DesiredCapacity. CloudFormation will not mark the Auto Scaling group as+-- successful (by setting its status to CREATE_COMPLETE) until the desired+-- capacity is reached. If SpotPrice is set, then DesiredCapacity will not be+-- used as a criteria for success, since instances will only be started when+-- the spot price has been matched. After the spot price has been matched,+-- however, Auto Scaling uses DesiredCapacity as the target capacity for the+-- group.+asgDesiredCapacity :: Lens' AutoScalingGroup (Maybe (Val Text))+asgDesiredCapacity = lens _autoScalingGroupDesiredCapacity (\s a -> s { _autoScalingGroupDesiredCapacity = a })++-- | The length of time in seconds after a new EC2 instance comes into service+-- that Auto Scaling starts checking its health.+asgHealthCheckGracePeriod :: Lens' AutoScalingGroup (Maybe (Val Integer'))+asgHealthCheckGracePeriod = lens _autoScalingGroupHealthCheckGracePeriod (\s a -> s { _autoScalingGroupHealthCheckGracePeriod = a })++-- | The service you want the health status from, Amazon EC2 or Elastic Load+-- Balancer. Valid values are EC2 or ELB.+asgHealthCheckType :: Lens' AutoScalingGroup (Maybe (Val Text))+asgHealthCheckType = lens _autoScalingGroupHealthCheckType (\s a -> s { _autoScalingGroupHealthCheckType = a })++-- | The ID of the Amazon EC2 instance you want to use to create the Auto+-- Scaling group. Use this property if you want to create an Auto Scaling+-- group that uses an existing Amazon EC2 instance instead of a launch+-- configuration. When you use an Amazon EC2 instance to create an Auto+-- Scaling group, a new launch configuration is first created and then+-- associated with the Auto Scaling group. The new launch configuration+-- derives all its properties from the instance, with the exception of+-- BlockDeviceMapping and AssociatePublicIpAddress.+asgInstanceId :: Lens' AutoScalingGroup (Maybe (Val Text))+asgInstanceId = lens _autoScalingGroupInstanceId (\s a -> s { _autoScalingGroupInstanceId = a })++-- | Specifies the name of the associated+-- AWS::AutoScaling::LaunchConfiguration. Note If this resource has a public+-- IP address and is also in a VPC that is defined in the same template, you+-- must use the DependsOn attribute to declare a dependency on the VPC-gateway+-- attachment. For more information, see DependsOn Attribute.+asgLaunchConfigurationName :: Lens' AutoScalingGroup (Maybe (Val Text))+asgLaunchConfigurationName = lens _autoScalingGroupLaunchConfigurationName (\s a -> s { _autoScalingGroupLaunchConfigurationName = a })++-- | A list of load balancers associated with this Auto Scaling group.+asgLoadBalancerNames :: Lens' AutoScalingGroup (Maybe [Val Text])+asgLoadBalancerNames = lens _autoScalingGroupLoadBalancerNames (\s a -> s { _autoScalingGroupLoadBalancerNames = a })++-- | The maximum size of the Auto Scaling group.+asgMaxSize :: Lens' AutoScalingGroup (Val Text)+asgMaxSize = lens _autoScalingGroupMaxSize (\s a -> s { _autoScalingGroupMaxSize = a })++-- | Enables the monitoring of group metrics of an Auto Scaling group.+asgMetricsCollection :: Lens' AutoScalingGroup (Maybe [AutoScalingMetricsCollection])+asgMetricsCollection = lens _autoScalingGroupMetricsCollection (\s a -> s { _autoScalingGroupMetricsCollection = a })++-- | The minimum size of the Auto Scaling group.+asgMinSize :: Lens' AutoScalingGroup (Val Text)+asgMinSize = lens _autoScalingGroupMinSize (\s a -> s { _autoScalingGroupMinSize = a })++-- | An embedded property that configures an Auto Scaling group to send+-- notifications when specified events take place.+asgNotificationConfigurations :: Lens' AutoScalingGroup (Maybe [AutoScalingNotificationConfigurations])+asgNotificationConfigurations = lens _autoScalingGroupNotificationConfigurations (\s a -> s { _autoScalingGroupNotificationConfigurations = a })++-- | The name of an existing cluster placement group into which you want to+-- launch your instances. A placement group is a logical grouping of instances+-- within a single Availability Zone. You cannot specify multiple Availability+-- Zones and a placement group.+asgPlacementGroup :: Lens' AutoScalingGroup (Maybe (Val Text))+asgPlacementGroup = lens _autoScalingGroupPlacementGroup (\s a -> s { _autoScalingGroupPlacementGroup = a })++-- | The tags you want to attach to this resource. For more information about+-- tags, go to Tagging Auto Scaling Groups and Amazon EC2 Instances in the+-- Auto Scaling User Guide.+asgTags :: Lens' AutoScalingGroup (Maybe [AutoScalingTags])+asgTags = lens _autoScalingGroupTags (\s a -> s { _autoScalingGroupTags = a })++-- | A policy or a list of policies that are used to select the instances to+-- terminate. The policies are executed in the order that you list them. For+-- more information on configuring a termination policy for your Auto Scaling+-- group, see Instance Termination Policy for Your Auto Scaling Group in the+-- Auto Scaling User Guide.+asgTerminationPolicies :: Lens' AutoScalingGroup (Maybe [Val Text])+asgTerminationPolicies = lens _autoScalingGroupTerminationPolicies (\s a -> s { _autoScalingGroupTerminationPolicies = a })++-- | A list of subnet identifiers of Amazon Virtual Private Cloud (Amazon+-- VPCs). If you specify the AvailabilityZones property, the subnets that you+-- specify for this property must reside in those Availability Zones. For more+-- information, go to Using EC2 Dedicated Instances Within Your VPC in the+-- Auto Scaling User Guide.+asgVPCZoneIdentifier :: Lens' AutoScalingGroup (Maybe [Val Text])+asgVPCZoneIdentifier = lens _autoScalingGroupVPCZoneIdentifier (\s a -> s { _autoScalingGroupVPCZoneIdentifier = a })
+ library-gen/Stratosphere/Resources/LaunchConfiguration.hs view
@@ -0,0 +1,194 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The AWS::AutoScaling::LaunchConfiguration type creates an Auto Scaling+-- launch configuration that can be used by an Auto Scaling group to configure+-- Amazon EC2 instances in the Auto Scaling group.++module Stratosphere.Resources.LaunchConfiguration where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+import Stratosphere.ResourceProperties.AutoScalingBlockDeviceMapping++-- | Full data type definition for LaunchConfiguration. See+-- 'launchConfiguration' for a more convenient constructor.+data LaunchConfiguration =+  LaunchConfiguration+  { _launchConfigurationAssociatePublicIpAddress :: Maybe (Val Bool')+  , _launchConfigurationBlockDeviceMappings :: Maybe [AutoScalingBlockDeviceMapping]+  , _launchConfigurationClassicLinkVPCId :: Maybe (Val Text)+  , _launchConfigurationClassicLinkVPCSecurityGroups :: Maybe [Val Text]+  , _launchConfigurationEbsOptimized :: Maybe (Val Bool')+  , _launchConfigurationIamInstanceProfile :: Maybe (Val Text)+  , _launchConfigurationImageId :: Val Text+  , _launchConfigurationInstanceId :: Maybe (Val Text)+  , _launchConfigurationInstanceMonitoring :: Maybe (Val Bool')+  , _launchConfigurationInstanceType :: Val Text+  , _launchConfigurationKernelId :: Maybe (Val Text)+  , _launchConfigurationKeyName :: Maybe (Val Text)+  , _launchConfigurationPlacementTenancy :: Maybe (Val Text)+  , _launchConfigurationRamDiskId :: Maybe (Val Text)+  , _launchConfigurationSecurityGroups :: Maybe [Val Text]+  , _launchConfigurationSpotPrice :: Maybe (Val Text)+  , _launchConfigurationUserData :: Maybe (Val Text)+  } deriving (Show, Generic)++instance ToJSON LaunchConfiguration where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 20, omitNothingFields = True }++instance FromJSON LaunchConfiguration where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 20, omitNothingFields = True }++-- | Constructor for 'LaunchConfiguration' containing required fields as+-- arguments.+launchConfiguration+  :: Val Text -- ^ 'lcImageId'+  -> Val Text -- ^ 'lcInstanceType'+  -> LaunchConfiguration+launchConfiguration imageIdarg instanceTypearg =+  LaunchConfiguration+  { _launchConfigurationAssociatePublicIpAddress = Nothing+  , _launchConfigurationBlockDeviceMappings = Nothing+  , _launchConfigurationClassicLinkVPCId = Nothing+  , _launchConfigurationClassicLinkVPCSecurityGroups = Nothing+  , _launchConfigurationEbsOptimized = Nothing+  , _launchConfigurationIamInstanceProfile = Nothing+  , _launchConfigurationImageId = imageIdarg+  , _launchConfigurationInstanceId = Nothing+  , _launchConfigurationInstanceMonitoring = Nothing+  , _launchConfigurationInstanceType = instanceTypearg+  , _launchConfigurationKernelId = Nothing+  , _launchConfigurationKeyName = Nothing+  , _launchConfigurationPlacementTenancy = Nothing+  , _launchConfigurationRamDiskId = Nothing+  , _launchConfigurationSecurityGroups = Nothing+  , _launchConfigurationSpotPrice = Nothing+  , _launchConfigurationUserData = Nothing+  }++-- | For Amazon EC2 instances in a VPC, indicates whether instances in the+-- Auto Scaling group receive public IP addresses. If you specify true, each+-- instance in the Auto Scaling receives a unique public IP address. Note If+-- this resource has a public IP address and is also in a VPC that is defined+-- in the same template, you must use the DependsOn attribute to declare a+-- dependency on the VPC-gateway attachment. For more information, see+-- DependsOn Attribute.+lcAssociatePublicIpAddress :: Lens' LaunchConfiguration (Maybe (Val Bool'))+lcAssociatePublicIpAddress = lens _launchConfigurationAssociatePublicIpAddress (\s a -> s { _launchConfigurationAssociatePublicIpAddress = a })++-- | Specifies how block devices are exposed to the instance. You can specify+-- virtual devices and EBS volumes.+lcBlockDeviceMappings :: Lens' LaunchConfiguration (Maybe [AutoScalingBlockDeviceMapping])+lcBlockDeviceMappings = lens _launchConfigurationBlockDeviceMappings (\s a -> s { _launchConfigurationBlockDeviceMappings = a })++-- | The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances+-- to. You can specify this property only for EC2-Classic instances. For more+-- information, see ClassicLink in the Amazon Elastic Compute Cloud User+-- Guide.+lcClassicLinkVPCId :: Lens' LaunchConfiguration (Maybe (Val Text))+lcClassicLinkVPCId = lens _launchConfigurationClassicLinkVPCId (\s a -> s { _launchConfigurationClassicLinkVPCId = a })++-- | The IDs of one or more security groups for the VPC that you specified in+-- the ClassicLinkVPCId property.+lcClassicLinkVPCSecurityGroups :: Lens' LaunchConfiguration (Maybe [Val Text])+lcClassicLinkVPCSecurityGroups = lens _launchConfigurationClassicLinkVPCSecurityGroups (\s a -> s { _launchConfigurationClassicLinkVPCSecurityGroups = a })++-- | Specifies whether the launch configuration is optimized for EBS I/O. This+-- optimization provides dedicated throughput to Amazon EBS and an optimized+-- configuration stack to provide optimal EBS I/O performance. Additional fees+-- are incurred when using EBS-optimized instances. For more information about+-- fees and supported instance types, see EBS-Optimized Instances in the+-- Amazon EC2 User Guide for Linux Instances.+lcEbsOptimized :: Lens' LaunchConfiguration (Maybe (Val Bool'))+lcEbsOptimized = lens _launchConfigurationEbsOptimized (\s a -> s { _launchConfigurationEbsOptimized = a })++-- | Provides the name or the Amazon Resource Name (ARN) of the instance+-- profile associated with the IAM role for the instance. The instance profile+-- contains the IAM role.+lcIamInstanceProfile :: Lens' LaunchConfiguration (Maybe (Val Text))+lcIamInstanceProfile = lens _launchConfigurationIamInstanceProfile (\s a -> s { _launchConfigurationIamInstanceProfile = a })++-- | Provides the unique ID of the Amazon Machine Image (AMI) that was+-- assigned during registration.+lcImageId :: Lens' LaunchConfiguration (Val Text)+lcImageId = lens _launchConfigurationImageId (\s a -> s { _launchConfigurationImageId = a })++-- | The ID of the Amazon EC2 instance you want to use to create the launch+-- configuration. Use this property if you want the launch configuration to+-- use settings from an existing Amazon EC2 instance. When you use an instance+-- to create a launch configuration, all properties are derived from the+-- instance with the exception of BlockDeviceMapping and+-- AssociatePublicIpAddress. You can override any properties from the instance+-- by specifying them in the launch configuration.+lcInstanceId :: Lens' LaunchConfiguration (Maybe (Val Text))+lcInstanceId = lens _launchConfigurationInstanceId (\s a -> s { _launchConfigurationInstanceId = a })++-- | Indicates whether detailed instance monitoring is enabled for the Auto+-- Scaling group. By default, this property is set to true (enabled). When+-- detailed monitoring is enabled, Amazon CloudWatch (CloudWatch) generates+-- metrics every minute and your account is charged a fee. When you disable+-- detailed monitoring, CloudWatch generates metrics every 5 minutes. For more+-- information, see Monitor Your Auto Scaling Instances in the Auto Scaling+-- Developer Guide.+lcInstanceMonitoring :: Lens' LaunchConfiguration (Maybe (Val Bool'))+lcInstanceMonitoring = lens _launchConfigurationInstanceMonitoring (\s a -> s { _launchConfigurationInstanceMonitoring = a })++-- | Specifies the instance type of the EC2 instance.+lcInstanceType :: Lens' LaunchConfiguration (Val Text)+lcInstanceType = lens _launchConfigurationInstanceType (\s a -> s { _launchConfigurationInstanceType = a })++-- | Provides the ID of the kernel associated with the EC2 AMI.+lcKernelId :: Lens' LaunchConfiguration (Maybe (Val Text))+lcKernelId = lens _launchConfigurationKernelId (\s a -> s { _launchConfigurationKernelId = a })++-- | Provides the name of the EC2 key pair.+lcKeyName :: Lens' LaunchConfiguration (Maybe (Val Text))+lcKeyName = lens _launchConfigurationKeyName (\s a -> s { _launchConfigurationKeyName = a })++-- | The tenancy of the instance. An instance with a tenancy of dedicated runs+-- on single-tenant hardware and can only be launched in a VPC. You must set+-- the value of this parameter to dedicated if want to launch dedicated+-- instances in a shared tenancy VPC (a VPC with the instance placement+-- tenancy attribute set to default). For more information, see+-- CreateLaunchConfiguration in the Auto Scaling API Reference. If you specify+-- this property, you must specify at least one subnet in the+-- VPCZoneIdentifier property of the AWS::AutoScaling::AutoScalingGroup+-- resource.+lcPlacementTenancy :: Lens' LaunchConfiguration (Maybe (Val Text))+lcPlacementTenancy = lens _launchConfigurationPlacementTenancy (\s a -> s { _launchConfigurationPlacementTenancy = a })++-- | The ID of the RAM disk to select. Some kernels require additional drivers+-- at launch. Check the kernel requirements for information about whether you+-- need to specify a RAM disk. To find kernel requirements, refer to the AWS+-- Resource Center and search for the kernel ID.+lcRamDiskId :: Lens' LaunchConfiguration (Maybe (Val Text))+lcRamDiskId = lens _launchConfigurationRamDiskId (\s a -> s { _launchConfigurationRamDiskId = a })++-- | A list that contains the EC2 security groups to assign to the Amazon EC2+-- instances in the Auto Scaling group. The list can contain the name of+-- existing EC2 security groups or references to AWS::EC2::SecurityGroup+-- resources created in the template. If your instances are launched within+-- VPC, specify Amazon VPC security group IDs.+lcSecurityGroups :: Lens' LaunchConfiguration (Maybe [Val Text])+lcSecurityGroups = lens _launchConfigurationSecurityGroups (\s a -> s { _launchConfigurationSecurityGroups = a })++-- | The spot price for this autoscaling group. If a spot price is set, then+-- the autoscaling group will launch when the current spot price is less than+-- the amount specified in the template. When you have specified a spot price+-- for an auto scaling group, the group will only launch when the spot price+-- has been met, regardless of the setting in the autoscaling group's+-- DesiredCapacity. For more information about configuring a spot price for an+-- autoscaling group, see Using Auto Scaling to Launch Spot Instances in the+-- AutoScaling Developer Guide.+lcSpotPrice :: Lens' LaunchConfiguration (Maybe (Val Text))+lcSpotPrice = lens _launchConfigurationSpotPrice (\s a -> s { _launchConfigurationSpotPrice = a })++-- | The user data available to the launched EC2 instances.+lcUserData :: Lens' LaunchConfiguration (Maybe (Val Text))+lcUserData = lens _launchConfigurationUserData (\s a -> s { _launchConfigurationUserData = a })
+ library-gen/Stratosphere/Resources/LifecycleHook.hs view
@@ -0,0 +1,97 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | Use AWS::AutoScaling::LifecycleHook to control the state of an instance+-- in an Auto Scaling group after it is launched or terminated. When you use a+-- lifecycle hook, the Auto Scaling group either pauses the instance after it+-- is launched (before it is put into service) or pauses the instance as it is+-- terminated (before it is fully terminated). For more information, see+-- Examples of How to Use Lifecycle Hooks in the Auto Scaling User Guide.++module Stratosphere.Resources.LifecycleHook where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for LifecycleHook. See 'lifecycleHook' for a+-- more convenient constructor.+data LifecycleHook =+  LifecycleHook+  { _lifecycleHookAutoScalingGroupName :: Val Text+  , _lifecycleHookDefaultResult :: Maybe (Val Text)+  , _lifecycleHookHeartbeatTimeout :: Maybe (Val Integer')+  , _lifecycleHookLifecycleTransition :: Val Text+  , _lifecycleHookNotificationMetadata :: Maybe (Val Text)+  , _lifecycleHookNotificationTargetARN :: Val Text+  , _lifecycleHookRoleARN :: Val Text+  } deriving (Show, Generic)++instance ToJSON LifecycleHook where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }++instance FromJSON LifecycleHook where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }++-- | Constructor for 'LifecycleHook' containing required fields as arguments.+lifecycleHook+  :: Val Text -- ^ 'lhAutoScalingGroupName'+  -> Val Text -- ^ 'lhLifecycleTransition'+  -> Val Text -- ^ 'lhNotificationTargetARN'+  -> Val Text -- ^ 'lhRoleARN'+  -> LifecycleHook+lifecycleHook autoScalingGroupNamearg lifecycleTransitionarg notificationTargetARNarg roleARNarg =+  LifecycleHook+  { _lifecycleHookAutoScalingGroupName = autoScalingGroupNamearg+  , _lifecycleHookDefaultResult = Nothing+  , _lifecycleHookHeartbeatTimeout = Nothing+  , _lifecycleHookLifecycleTransition = lifecycleTransitionarg+  , _lifecycleHookNotificationMetadata = Nothing+  , _lifecycleHookNotificationTargetARN = notificationTargetARNarg+  , _lifecycleHookRoleARN = roleARNarg+  }++-- | The name of the Auto Scaling group for the lifecycle hook.+lhAutoScalingGroupName :: Lens' LifecycleHook (Val Text)+lhAutoScalingGroupName = lens _lifecycleHookAutoScalingGroupName (\s a -> s { _lifecycleHookAutoScalingGroupName = a })++-- | The action the Auto Scaling group takes when the lifecycle hook timeout+-- elapses or if an unexpected failure occurs.+lhDefaultResult :: Lens' LifecycleHook (Maybe (Val Text))+lhDefaultResult = lens _lifecycleHookDefaultResult (\s a -> s { _lifecycleHookDefaultResult = a })++-- | The amount of time that can elapse before the lifecycle hook times out.+-- When the lifecycle hook times out, Auto Scaling performs the action that+-- you specified in the DefaultResult property.+lhHeartbeatTimeout :: Lens' LifecycleHook (Maybe (Val Integer'))+lhHeartbeatTimeout = lens _lifecycleHookHeartbeatTimeout (\s a -> s { _lifecycleHookHeartbeatTimeout = a })++-- | The state of the Amazon EC2 instance to which you want to attach the+-- lifecycle hook.+lhLifecycleTransition :: Lens' LifecycleHook (Val Text)+lhLifecycleTransition = lens _lifecycleHookLifecycleTransition (\s a -> s { _lifecycleHookLifecycleTransition = a })++-- | Additional information that you want to include when Auto Scaling sends a+-- message to the notification target.+lhNotificationMetadata :: Lens' LifecycleHook (Maybe (Val Text))+lhNotificationMetadata = lens _lifecycleHookNotificationMetadata (\s a -> s { _lifecycleHookNotificationMetadata = a })++-- | The Amazon resource name (ARN) of the notification target that Auto+-- Scaling uses to notify you when an instance is in the transition state for+-- the lifecycle hook. You can specify an Amazon SQS queue or an Amazon SNS+-- topic. The notification message includes the following information:+-- lifecycle action token, user account ID, Auto Scaling group name, lifecycle+-- hook name, instance ID, lifecycle transition, and notification metadata.+lhNotificationTargetARN :: Lens' LifecycleHook (Val Text)+lhNotificationTargetARN = lens _lifecycleHookNotificationTargetARN (\s a -> s { _lifecycleHookNotificationTargetARN = a })++-- | The ARN of the IAM role that allows the Auto Scaling group to publish to+-- the specified notification target. The role requires permissions to Amazon+-- SNS and Amazon SQS.+lhRoleARN :: Lens' LifecycleHook (Val Text)+lhRoleARN = lens _lifecycleHookRoleARN (\s a -> s { _lifecycleHookRoleARN = a })
+ library-gen/Stratosphere/Resources/ScalingPolicy.hs view
@@ -0,0 +1,121 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | The AWS::AutoScaling::ScalingPolicy resource adds a scaling policy to an+-- auto scaling group. A scaling policy specifies whether to scale the auto+-- scaling group up or down, and by how much. For more information on scaling+-- policies, see Scaling by Policy in the Auto Scaling Developer Guide. You+-- can use a scaling policy together with an CloudWatch alarm. An CloudWatch+-- alarm can automatically initiate actions on your behalf, based on+-- parameters you specify. A scaling policy is one type of action that an+-- alarm can initiate. For a snippet showing how to create an Auto Scaling+-- policy that is triggered by an CloudWatch alarm, see Auto Scaling Policy+-- Triggered by CloudWatch Alarm. This type supports updates. For more+-- information about updating this resource, see PutScalingPolicy.++module Stratosphere.Resources.ScalingPolicy where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+import Stratosphere.ResourceProperties.StepAdjustments++-- | Full data type definition for ScalingPolicy. See 'scalingPolicy' for a+-- more convenient constructor.+data ScalingPolicy =+  ScalingPolicy+  { _scalingPolicyAdjustmentType :: Val Text+  , _scalingPolicyAutoScalingGroupName :: Val Text+  , _scalingPolicyCooldown :: Maybe (Val Text)+  , _scalingPolicyEstimatedInstanceWarmup :: Maybe (Val Integer')+  , _scalingPolicyMetricAggregationType :: Maybe (Val Text)+  , _scalingPolicyMinAdjustmentMagnitude :: Maybe (Val Integer')+  , _scalingPolicyPolicyType :: Maybe (Val Text)+  , _scalingPolicyScalingAdjustment :: Maybe (Val Integer')+  , _scalingPolicyStepAdjustments :: Maybe [StepAdjustments]+  } deriving (Show, Generic)++instance ToJSON ScalingPolicy where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }++instance FromJSON ScalingPolicy where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }++-- | Constructor for 'ScalingPolicy' containing required fields as arguments.+scalingPolicy+  :: Val Text -- ^ 'spAdjustmentType'+  -> Val Text -- ^ 'spAutoScalingGroupName'+  -> ScalingPolicy+scalingPolicy adjustmentTypearg autoScalingGroupNamearg =+  ScalingPolicy+  { _scalingPolicyAdjustmentType = adjustmentTypearg+  , _scalingPolicyAutoScalingGroupName = autoScalingGroupNamearg+  , _scalingPolicyCooldown = Nothing+  , _scalingPolicyEstimatedInstanceWarmup = Nothing+  , _scalingPolicyMetricAggregationType = Nothing+  , _scalingPolicyMinAdjustmentMagnitude = Nothing+  , _scalingPolicyPolicyType = Nothing+  , _scalingPolicyScalingAdjustment = Nothing+  , _scalingPolicyStepAdjustments = Nothing+  }++-- | Specifies whether the ScalingAdjustment is an absolute number or a+-- percentage of the current capacity. Valid values are ChangeInCapacity,+-- ExactCapacity, and PercentChangeInCapacity.+spAdjustmentType :: Lens' ScalingPolicy (Val Text)+spAdjustmentType = lens _scalingPolicyAdjustmentType (\s a -> s { _scalingPolicyAdjustmentType = a })++-- | The name or Amazon Resource Name (ARN) of the Auto Scaling Group that you+-- want to attach the policy to.+spAutoScalingGroupName :: Lens' ScalingPolicy (Val Text)+spAutoScalingGroupName = lens _scalingPolicyAutoScalingGroupName (\s a -> s { _scalingPolicyAutoScalingGroupName = a })++-- | The amount of time, in seconds, after a scaling activity completes before+-- any further trigger-related scaling activities can start. Do not specify+-- this property if you are using the StepScaling policy type.+spCooldown :: Lens' ScalingPolicy (Maybe (Val Text))+spCooldown = lens _scalingPolicyCooldown (\s a -> s { _scalingPolicyCooldown = a })++-- | The estimated time, in seconds, until a newly launched instance can send+-- metrics to CloudWatch. By default, Auto Scaling uses the cooldown period,+-- as specified in the Cooldown property. Do not specify this property if you+-- are using the SimpleScaling policy type.+spEstimatedInstanceWarmup :: Lens' ScalingPolicy (Maybe (Val Integer'))+spEstimatedInstanceWarmup = lens _scalingPolicyEstimatedInstanceWarmup (\s a -> s { _scalingPolicyEstimatedInstanceWarmup = a })++-- | The aggregation type for the CloudWatch metrics. You can specify Minimum,+-- Maximum, or Average. By default, AWS CloudFormation specifies Average. Do+-- not specify this property if you are using the SimpleScaling policy type.+spMetricAggregationType :: Lens' ScalingPolicy (Maybe (Val Text))+spMetricAggregationType = lens _scalingPolicyMetricAggregationType (\s a -> s { _scalingPolicyMetricAggregationType = a })++-- | For the PercentChangeInCapacity adjustment type, the minimum number of+-- instances to scale. The scaling policy changes the desired capacity of the+-- Auto Scaling group by a minimum of this many instances. This property+-- replaces the MinAdjustmentStep property.+spMinAdjustmentMagnitude :: Lens' ScalingPolicy (Maybe (Val Integer'))+spMinAdjustmentMagnitude = lens _scalingPolicyMinAdjustmentMagnitude (\s a -> s { _scalingPolicyMinAdjustmentMagnitude = a })++-- | An Auto Scaling policy type. You can specify SimpleScaling or+-- StepScaling. By default, AWS CloudFormation specifies SimpleScaling. For+-- more information, see Scaling Policy Types in the Auto Scaling User Guide.+spPolicyType :: Lens' ScalingPolicy (Maybe (Val Text))+spPolicyType = lens _scalingPolicyPolicyType (\s a -> s { _scalingPolicyPolicyType = a })++-- | The number of instances by which to scale. The AdjustmentType property+-- determines whether AWS CloudFormation interprets this number as an absolute+-- number (when the ExactCapacityvalue is specified) or as a percentage of the+-- existing Auto Scaling group size (when the PercentChangeInCapacity value is+-- specified). A positive value adds to the current capacity and a negative+-- value subtracts from the current capacity.+spScalingAdjustment :: Lens' ScalingPolicy (Maybe (Val Integer'))+spScalingAdjustment = lens _scalingPolicyScalingAdjustment (\s a -> s { _scalingPolicyScalingAdjustment = a })++-- | A set of adjustments that enable you to scale based on the size of the+-- alarm breach.+spStepAdjustments :: Lens' ScalingPolicy (Maybe [StepAdjustments])+spStepAdjustments = lens _scalingPolicyStepAdjustments (\s a -> s { _scalingPolicyStepAdjustments = a })
+ library-gen/Stratosphere/Resources/ScheduledAction.hs view
@@ -0,0 +1,87 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}++-- | Creates a scheduled scaling action for an Auto Scaling group, changing+-- the number of servers available for your application in response to+-- predictable load changes.++module Stratosphere.Resources.ScheduledAction where++import Control.Lens+import Data.Aeson+import Data.Aeson.Types+import Data.Text+import GHC.Generics++import Stratosphere.Values+++-- | Full data type definition for ScheduledAction. See 'scheduledAction' for+-- a more convenient constructor.+data ScheduledAction =+  ScheduledAction+  { _scheduledActionAutoScalingGroupName :: Val Text+  , _scheduledActionDesiredCapacity :: Maybe (Val Integer')+  , _scheduledActionEndTime :: Maybe (Val Text)+  , _scheduledActionMaxSize :: Maybe (Val Integer')+  , _scheduledActionMinSize :: Maybe (Val Integer')+  , _scheduledActionRecurrence :: Maybe (Val Text)+  , _scheduledActionStartTime :: Maybe (Val Text)+  } deriving (Show, Generic)++instance ToJSON ScheduledAction where+  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }++instance FromJSON ScheduledAction where+  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }++-- | Constructor for 'ScheduledAction' containing required fields as+-- arguments.+scheduledAction+  :: Val Text -- ^ 'saAutoScalingGroupName'+  -> ScheduledAction+scheduledAction autoScalingGroupNamearg =+  ScheduledAction+  { _scheduledActionAutoScalingGroupName = autoScalingGroupNamearg+  , _scheduledActionDesiredCapacity = Nothing+  , _scheduledActionEndTime = Nothing+  , _scheduledActionMaxSize = Nothing+  , _scheduledActionMinSize = Nothing+  , _scheduledActionRecurrence = Nothing+  , _scheduledActionStartTime = Nothing+  }++-- | The name or ARN of the Auto Scaling group.+saAutoScalingGroupName :: Lens' ScheduledAction (Val Text)+saAutoScalingGroupName = lens _scheduledActionAutoScalingGroupName (\s a -> s { _scheduledActionAutoScalingGroupName = a })++-- | The number of Amazon EC2 instances that should be running in the Auto+-- Scaling group.+saDesiredCapacity :: Lens' ScheduledAction (Maybe (Val Integer'))+saDesiredCapacity = lens _scheduledActionDesiredCapacity (\s a -> s { _scheduledActionDesiredCapacity = a })++-- | The time in UTC for this schedule to end. For example,+-- 2010-06-01T00:00:00Z.+saEndTime :: Lens' ScheduledAction (Maybe (Val Text))+saEndTime = lens _scheduledActionEndTime (\s a -> s { _scheduledActionEndTime = a })++-- | The maximum number of Amazon EC2 instances in the Auto Scaling group.+saMaxSize :: Lens' ScheduledAction (Maybe (Val Integer'))+saMaxSize = lens _scheduledActionMaxSize (\s a -> s { _scheduledActionMaxSize = a })++-- | The minimum number of Amazon EC2 instances in the Auto Scaling group.+saMinSize :: Lens' ScheduledAction (Maybe (Val Integer'))+saMinSize = lens _scheduledActionMinSize (\s a -> s { _scheduledActionMinSize = a })++-- | The time in UTC when recurring future actions will start. You specify the+-- start time by following the Unix cron syntax format. For more information+-- about cron syntax, go to http://en.wikipedia.org/wiki/Cron. Specifying the+-- StartTime and EndTime properties with Recurrence property forms the start+-- and stop boundaries of the recurring action.+saRecurrence :: Lens' ScheduledAction (Maybe (Val Text))+saRecurrence = lens _scheduledActionRecurrence (\s a -> s { _scheduledActionRecurrence = a })++-- | The time in UTC for this schedule to start. For example,+-- 2010-06-01T00:00:00Z.+saStartTime :: Lens' ScheduledAction (Maybe (Val Text))+saStartTime = lens _scheduledActionStartTime (\s a -> s { _scheduledActionStartTime = a })
library/Stratosphere/Values.hs view
@@ -8,6 +8,7 @@        ( Val (..)        , Integer' (..)        , Bool' (..)+       , Double' (..)        , ToRef (..)        ) where @@ -120,3 +121,17 @@ -- | Class used to create a 'Ref' from another type. class ToRef a b where   toRef :: a -> Val b++-- | We need to wrap Doubles for the same reason we need to wrap Ints.+newtype Double' = Double' { unDouble' :: Double }+                deriving (Show, Eq, Num)++instance ToJSON Double' where+  toJSON (Double' i) = toJSON $ show i++instance FromJSON Double' where+  parseJSON v = Double' <$> do+    numString <- parseJSON v+    case readMaybe (numString :: String) of+      Nothing -> fail "Can't read number from string"+      (Just n) -> return n
stack.yaml view
@@ -1,4 +1,4 @@-resolver: nightly-2016-04-05+resolver: lts-6.0 packages:   - '.' extra-deps: []
stratosphere.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.14.0.+-- This file has been generated from package.yaml by hpack version 0.14.1. -- -- see: https://github.com/sol/hpack  name:           stratosphere-version:        0.1.1+version:        0.1.2 synopsis:       EDSL for AWS CloudFormation description:    EDSL for AWS CloudFormation category:       AWS, Cloud@@ -49,9 +49,20 @@       Stratosphere.Parameters       Stratosphere.Template       Stratosphere.Values+      Stratosphere.ResourceAttributes.AutoScalingReplacingUpdate+      Stratosphere.ResourceAttributes.AutoScalingRollingUpdate+      Stratosphere.ResourceAttributes.AutoScalingScheduledAction+      Stratosphere.ResourceAttributes.CreationPolicy+      Stratosphere.ResourceAttributes.ResourceSignal+      Stratosphere.ResourceAttributes.UpdatePolicy       Stratosphere.ResourceProperties.AccessLoggingPolicy       Stratosphere.ResourceProperties.AliasTarget       Stratosphere.ResourceProperties.AppCookieStickinessPolicy+      Stratosphere.ResourceProperties.AutoScalingBlockDeviceMapping+      Stratosphere.ResourceProperties.AutoScalingEBSBlockDevice+      Stratosphere.ResourceProperties.AutoScalingMetricsCollection+      Stratosphere.ResourceProperties.AutoScalingNotificationConfigurations+      Stratosphere.ResourceProperties.AutoScalingTags       Stratosphere.ResourceProperties.ConnectionDrainingPolicy       Stratosphere.ResourceProperties.ConnectionSettings       Stratosphere.ResourceProperties.EBSBlockDevice@@ -71,9 +82,11 @@       Stratosphere.ResourceProperties.ResourceTag       Stratosphere.ResourceProperties.SecurityGroupEgressRule       Stratosphere.ResourceProperties.SecurityGroupIngressRule+      Stratosphere.ResourceProperties.StepAdjustments       Stratosphere.ResourceProperties.UserLoginProfile       Stratosphere.Resources       Stratosphere.Resources.AccessKey+      Stratosphere.Resources.AutoScalingGroup       Stratosphere.Resources.DBInstance       Stratosphere.Resources.DBParameterGroup       Stratosphere.Resources.DBSecurityGroup@@ -86,6 +99,8 @@       Stratosphere.Resources.IAMRole       Stratosphere.Resources.InstanceProfile       Stratosphere.Resources.InternetGateway+      Stratosphere.Resources.LaunchConfiguration+      Stratosphere.Resources.LifecycleHook       Stratosphere.Resources.LoadBalancer       Stratosphere.Resources.ManagedPolicy       Stratosphere.Resources.NatGateway@@ -94,6 +109,8 @@       Stratosphere.Resources.RecordSetGroup       Stratosphere.Resources.Route       Stratosphere.Resources.RouteTable+      Stratosphere.Resources.ScalingPolicy+      Stratosphere.Resources.ScheduledAction       Stratosphere.Resources.SecurityGroup       Stratosphere.Resources.Stack       Stratosphere.Resources.Subnet@@ -105,6 +122,26 @@       Stratosphere.Resources.VPC       Stratosphere.Resources.VPCEndpoint       Stratosphere.Resources.VPCGatewayAttachment+  default-language: Haskell2010++executable auto-scaling-group+  main-is: auto-scaling-group.hs+  hs-source-dirs:+      examples+  ghc-options: -Wall+  build-depends:+      base >= 4.8 && < 5+    , aeson >= 0.11+    , aeson-pretty >= 0.7+    , bytestring+    , ede+    , lens >= 4.5+    , system-fileio+    , system-filepath+    , template-haskell >= 2.0+    , text >= 1.1+    , unordered-containers >= 0.2+    , stratosphere   default-language: Haskell2010  executable ec2-with-eip