Skip to content

Commit

Permalink
[stack-deploy] Change to compact template encoding
Browse files Browse the repository at this point in the history
* Only use the "non pretty" encoding when interacting with the CF API.
* Reduces the chance we have to go through S3 inthe first place.
* Also reduces the chance the template is "at all" to big for CF.
  • Loading branch information
mbj committed May 16, 2024
1 parent 5f2fffe commit 606d42e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stack-deploy/src/StackDeploy/Operation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import qualified Amazonka.CloudFormation.DeleteStack as CF
import qualified Amazonka.CloudFormation.Types as CF
import qualified Amazonka.CloudFormation.UpdateStack as CF
import qualified Amazonka.S3.Types as S3
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Map.Strict as Map
Expand Down Expand Up @@ -257,7 +258,7 @@ prepareOperation
maxBytes = 51200

templateBody = Text.decodeUtf8 templateBodyBS
templateBodyBS = LBS.toStrict $ StackDeploy.stratosphereTemplateEncodePretty namedTemplate.template
templateBodyBS = LBS.toStrict $ JSON.encode namedTemplate.template

setText :: (Applicative f, ToText b) => Lens' a (f Text) -> b -> a -> a
setText field value = set field (pure $ convert value)
Expand Down

0 comments on commit 606d42e

Please sign in to comment.