Skip to content

Commit

Permalink
[stack-deploy] Add propagate at launch tag handling
Browse files Browse the repository at this point in the history
* It'll add `PropagateAtLaunch=True` for all instances of ASG tags we are adding.
* I do at this point not think we need to make this configurable.
  • Loading branch information
mbj committed Nov 20, 2023
1 parent 2d16113 commit 7712036
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aws-secrets/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ socks 0.6.1
source-constraints 0.0.5
split 0.2.3.5
splitmix 0.1.0.5
stack-deploy 0.0.8
stack-deploy 0.0.9
stm 2.5.1.0
stratosphere 1.0.0
stratosphere-ecs 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion aws-temporary-ingress-rule/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ socks 0.6.1
source-constraints 0.0.5
split 0.2.3.5
splitmix 0.1.0.5
stack-deploy 0.0.8
stack-deploy 0.0.9
stm 2.5.1.0
stratosphere 1.0.0
stratosphere-ecs 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion stack-deploy/package.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_common/package: !include "../common/package.yaml"

name: stack-deploy
version: 0.0.8
version: 0.0.9
synopsis: Utilities around cloudformation templates
license: BSD3

Expand Down
8 changes: 7 additions & 1 deletion stack-deploy/src/StackDeploy/InstanceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,17 @@ addResourcePropertiesTags tags Stratosphere.ResourceProperties{..}
, ..
}
where
addPropagateAtLaunch value =
if awsType == "AWS::AutoScaling::AutoScalingGroup.TagProperty"
then merge value (JSON.Object [("PropagateAtLaunch", JSON.toJSON True)])
else value

newProperties =
if supportsTags
then KeyMap.unionWith merge [("Tags", JSON.toJSON tags)] properties
then KeyMap.unionWith merge [("Tags", addPropagateAtLaunch $ JSON.toJSON tags)] properties
else properties

merge leftValue rightValue = case (leftValue, rightValue) of
(JSON.Array leftItems, JSON.Array rightItems) -> JSON.Array $ leftItems <> rightItems
(JSON.Object leftMap, JSON.Object rightMap) -> JSON.Object $ leftMap <> rightMap
other -> error $ "non tag array merge:" <> show other
2 changes: 1 addition & 1 deletion stack-deploy/stack-deploy.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: stack-deploy
version: 0.0.8
version: 0.0.9
synopsis: Utilities around cloudformation templates
homepage: https://github.com/mbj/mhs#readme
bug-reports: https://github.com/mbj/mhs/issues
Expand Down

0 comments on commit 7712036

Please sign in to comment.