Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit b976b16

Browse files
authored
Fixes deployment fail if create private subnet is not requested (#47)
* Template code fix * Added automation coverage for this case
1 parent 176dab9 commit b976b16

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.travis.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,28 @@ script:
5151
- until curl http://$url:8080; do sleep 10; done
5252
- curl -O https://sftp.solace.com/download/SDKPERF_C_LINUX64
5353
- tar -xvf SDKPERF_C_LINUX64
54-
- pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
5554
- sleep 30
5655
- curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><redundancy></redundancy></show></rpc>"
5756
- curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><config-sync></config-sync></show></rpc>"
5857
- bash -c 'if [[ -z `curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><config-sync></config-sync></show></rpc>"
5958
| grep "<oper-status>Up</oper-status>"` ]] ; then echo "config-sync not up!"; exit
6059
1; fi'
60+
- pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
61+
- aws cloudformation delete-stack --stack-name $TESTSTACKNAME
62+
- echo "Waiting for stack delete complete"
63+
- stackid="$(aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep StackId | awk -F '"' '{print $4}')"
64+
- if [ -n "$stackid" ]; then until aws cloudformation describe-stacks --stack-name $stackid | grep -m 1 "DELETE_COMPLETE"; do sleep 10; done; fi
65+
- # Now test No Private Subnet
66+
- export TESTSTACKNAME="$TESTSTACKNAME-1"
67+
- sed -i "s@true@false@g" ci/solace-aws-ha-3az-prod-travistest.json
68+
- aws cloudformation create-stack --stack-name $TESTSTACKNAME --template-body file://templates/solace-master.template --parameters file://ci/solace-aws-ha-3az-prod-travistest.json --on-failure DO_NOTHING --capabilities CAPABILITY_IAM
69+
- echo "Waiting for stack create complete"
70+
- "travis_wait 30 sleep 1800 &"
71+
- until aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep -m 1 -E 'CREATE_COMPLETE|DELETE_IN_PROGRESS'; do sleep 10; done
72+
- aws cloudformation describe-stack-events --stack-name $TESTSTACKNAME
73+
- aws cloudformation describe-stacks --stack-name $TESTSTACKNAME
74+
- # This completes forming No Private Subnet
75+
6176

6277
after_success:
6378
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"

templates/solace.template

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ Resources:
611611
Type: AWS::ElasticLoadBalancingV2::TargetGroup
612612
DependsOn:
613613
- ELB
614+
Condition: UsePrivateSubnetsCondition
614615
Properties:
615616
Port: 55555
616617
Protocol: TCP
@@ -627,6 +628,7 @@ Resources:
627628
Type: AWS::ElasticLoadBalancingV2::TargetGroup
628629
DependsOn:
629630
- ELB
631+
Condition: UsePrivateSubnetsCondition
630632
Properties:
631633
Port: 55003
632634
Protocol: TCP
@@ -643,6 +645,7 @@ Resources:
643645
Type: AWS::ElasticLoadBalancingV2::TargetGroup
644646
DependsOn:
645647
- ELB
648+
Condition: UsePrivateSubnetsCondition
646649
Properties:
647650
Port: 55443
648651
Protocol: TCP
@@ -659,6 +662,7 @@ Resources:
659662
Type: AWS::ElasticLoadBalancingV2::TargetGroup
660663
DependsOn:
661664
- ELB
665+
Condition: UsePrivateSubnetsCondition
662666
Properties:
663667
Port: 1443
664668
Protocol: TCP
@@ -675,6 +679,7 @@ Resources:
675679
Type: AWS::ElasticLoadBalancingV2::TargetGroup
676680
DependsOn:
677681
- ELB
682+
Condition: UsePrivateSubnetsCondition
678683
Properties:
679684
Port: 8000
680685
Protocol: TCP
@@ -691,6 +696,7 @@ Resources:
691696
Type: AWS::ElasticLoadBalancingV2::TargetGroup
692697
DependsOn:
693698
- ELB
699+
Condition: UsePrivateSubnetsCondition
694700
Properties:
695701
Port: 5672
696702
Protocol: TCP
@@ -707,6 +713,7 @@ Resources:
707713
Type: AWS::ElasticLoadBalancingV2::TargetGroup
708714
DependsOn:
709715
- ELB
716+
Condition: UsePrivateSubnetsCondition
710717
Properties:
711718
Port: 9000
712719
Protocol: TCP
@@ -723,6 +730,7 @@ Resources:
723730
Type: AWS::ElasticLoadBalancingV2::TargetGroup
724731
DependsOn:
725732
- ELB
733+
Condition: UsePrivateSubnetsCondition
726734
Properties:
727735
Port: 1883
728736
Protocol: TCP
@@ -739,6 +747,7 @@ Resources:
739747
Type: AWS::ElasticLoadBalancingV2::TargetGroup
740748
DependsOn:
741749
- ELB
750+
Condition: UsePrivateSubnetsCondition
742751
Properties:
743752
Port: 8008
744753
Protocol: TCP
@@ -755,6 +764,7 @@ Resources:
755764
Type: AWS::ElasticLoadBalancingV2::TargetGroup
756765
DependsOn:
757766
- ELB
767+
Condition: UsePrivateSubnetsCondition
758768
Properties:
759769
Port: 8080
760770
Protocol: TCP
@@ -771,6 +781,7 @@ Resources:
771781
Type: AWS::ElasticLoadBalancingV2::TargetGroup
772782
DependsOn:
773783
- ELB
784+
Condition: UsePrivateSubnetsCondition
774785
Properties:
775786
Port: 1943
776787
Protocol: TCP
@@ -787,6 +798,7 @@ Resources:
787798
Type: AWS::ElasticLoadBalancingV2::Listener
788799
DependsOn:
789800
- ELB
801+
Condition: UsePrivateSubnetsCondition
790802
Properties:
791803
DefaultActions:
792804
- Type: forward
@@ -798,6 +810,7 @@ Resources:
798810
Type: AWS::ElasticLoadBalancingV2::Listener
799811
DependsOn:
800812
- ELB
813+
Condition: UsePrivateSubnetsCondition
801814
Properties:
802815
DefaultActions:
803816
- Type: forward
@@ -809,6 +822,7 @@ Resources:
809822
Type: AWS::ElasticLoadBalancingV2::Listener
810823
DependsOn:
811824
- ELB
825+
Condition: UsePrivateSubnetsCondition
812826
Properties:
813827
DefaultActions:
814828
- Type: forward
@@ -820,6 +834,7 @@ Resources:
820834
Type: AWS::ElasticLoadBalancingV2::Listener
821835
DependsOn:
822836
- ELB
837+
Condition: UsePrivateSubnetsCondition
823838
Properties:
824839
DefaultActions:
825840
- Type: forward
@@ -831,6 +846,7 @@ Resources:
831846
Type: AWS::ElasticLoadBalancingV2::Listener
832847
DependsOn:
833848
- ELB
849+
Condition: UsePrivateSubnetsCondition
834850
Properties:
835851
DefaultActions:
836852
- Type: forward
@@ -842,6 +858,7 @@ Resources:
842858
Type: AWS::ElasticLoadBalancingV2::Listener
843859
DependsOn:
844860
- ELB
861+
Condition: UsePrivateSubnetsCondition
845862
Properties:
846863
DefaultActions:
847864
- Type: forward
@@ -853,6 +870,7 @@ Resources:
853870
Type: AWS::ElasticLoadBalancingV2::Listener
854871
DependsOn:
855872
- ELB
873+
Condition: UsePrivateSubnetsCondition
856874
Properties:
857875
DefaultActions:
858876
- Type: forward
@@ -864,6 +882,7 @@ Resources:
864882
Type: AWS::ElasticLoadBalancingV2::Listener
865883
DependsOn:
866884
- ELB
885+
Condition: UsePrivateSubnetsCondition
867886
Properties:
868887
DefaultActions:
869888
- Type: forward
@@ -875,6 +894,7 @@ Resources:
875894
Type: AWS::ElasticLoadBalancingV2::Listener
876895
DependsOn:
877896
- ELB
897+
Condition: UsePrivateSubnetsCondition
878898
Properties:
879899
DefaultActions:
880900
- Type: forward
@@ -886,6 +906,7 @@ Resources:
886906
Type: AWS::ElasticLoadBalancingV2::Listener
887907
DependsOn:
888908
- ELB
909+
Condition: UsePrivateSubnetsCondition
889910
Properties:
890911
DefaultActions:
891912
- Type: forward
@@ -897,6 +918,7 @@ Resources:
897918
Type: AWS::ElasticLoadBalancingV2::Listener
898919
DependsOn:
899920
- ELB
921+
Condition: UsePrivateSubnetsCondition
900922
Properties:
901923
DefaultActions:
902924
- Type: forward

0 commit comments

Comments
 (0)