Skip to content

Commit 944a58a

Browse files
authored
fix: Change vpc/subnet variable logic error (#63)
* fix: change vpc/subnet variable logic error * fix: remove unused parameter * fix: fix typo in paramters * fix: remove allowed value from externalID
1 parent 3a71411 commit 944a58a

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

templates/CloudVision.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Parameters:
9797
Type: String
9898
NoEcho: true
9999
AllowedPattern: ".+"
100-
ConstraintDescription: "SysdigSecureAPIToken is required"
100+
ConstraintDescription: "SysdigSecureAPIToken is required"
101101

102102
SysdigSecureEndpoint:
103103
Type: String
@@ -110,14 +110,14 @@ Parameters:
110110
SysdigExternalID:
111111
Type: String
112112
Default: ""
113-
113+
114114
SysdigTrustedIdentity:
115115
Type: String
116-
Default: ""
116+
Default: "arn:aws:iam::273107874544:role/us-east-1-production-secure-assume-role"
117117

118118
Conditions:
119119
RequiresCloudTrail: !Equals [!Ref ExistentCloudTrailSNSTopic, ""]
120-
RequiresNewECSCluster: !Or
120+
RequiresNewECSCluster: !And
121121
- !Equals [!Ref ExistentECSCluster, ""]
122122
- !Equals [!Ref ExistentECSClusterVPC, ""]
123123
- !Equals [!Join [",", !Ref ExistentECSClusterPrivateSubnets], ""]
@@ -126,12 +126,6 @@ Conditions:
126126
- !Equals [!Ref ECSImageScanningDeploy, "Yes"]
127127
ECRImageScanningDeploy: !Equals [ !Ref ECRImageScanningDeploy, "Yes"]
128128
ECSImageScanningDeploy: !Equals [ !Ref ECSImageScanningDeploy, "Yes"]
129-
DeployCloudTrail: !And
130-
- !Condition RequiresCloudTrail
131-
- !Condition DeployCloudScanning
132-
DeployNewECSCluster: !And
133-
- !Condition RequiresNewECSCluster
134-
- !Condition DeployCloudScanning
135129
EndpointIsSaas: !Or
136130
- !Equals [!Ref SysdigSecureEndpoint, "https://secure.sysdig.com"]
137131
- !Equals [!Ref SysdigSecureEndpoint, "https://eu1.app.sysdig.com"]
@@ -177,13 +171,13 @@ Resources:
177171

178172
ECSFargateClusterStack:
179173
Type: AWS::CloudFormation::Stack
180-
Condition: DeployNewECSCluster
174+
Condition: RequiresNewECSCluster
181175
Properties:
182176
TemplateURL: ./ECSFargateCluster.yaml
183177

184178
CloudTrailStack:
185179
Type: AWS::CloudFormation::Stack
186-
Condition: DeployCloudTrail
180+
Condition: RequiresCloudTrail
187181
Properties:
188182
TemplateURL: ./CloudTrail.yaml
189183

@@ -202,15 +196,15 @@ Resources:
202196
Properties:
203197
TemplateURL: ./CloudConnector.yaml
204198
Parameters:
205-
ECSCluster: !If [ DeployNewECSCluster, !GetAtt ["ECSFargateClusterStack", "Outputs.ClusterName"], !Ref ExistentECSCluster ]
206-
VPC: !If [ DeployNewECSCluster, !GetAtt ["ECSFargateClusterStack", "Outputs.VPC"], !Ref ExistentECSClusterVPC ]
207-
Subnets: !If [ DeployNewECSCluster, !GetAtt ["ECSFargateClusterStack", "Outputs.PrivateSubnets"], !Join [",", !Ref ExistentECSClusterPrivateSubnets] ]
199+
ECSCluster: !If [ RequiresNewECSCluster, !GetAtt ["ECSFargateClusterStack", "Outputs.ClusterName"], !Ref ExistentECSCluster ]
200+
VPC: !If [ RequiresNewECSCluster, !GetAtt ["ECSFargateClusterStack", "Outputs.VPC"], !Ref ExistentECSClusterVPC ]
201+
Subnets: !If [ RequiresNewECSCluster, !GetAtt ["ECSFargateClusterStack", "Outputs.PrivateSubnets"], !Join [",", !Ref ExistentECSClusterPrivateSubnets] ]
208202
SysdigSecureEndpointSsm: !Ref SysdigSecureEndpointParameter
209203
SysdigSecureAPITokenSsm: !Ref SysdigSecureAPITokenParameter
210204
S3ConfigBucket: !Ref S3ConfigBucket
211205
VerifySSL: !If [ EndpointIsSaas, "Yes", "No" ]
212206
BuildProject: !If [ DeployCloudScanning, !GetAtt [ "ScanningCodeBuildStack", "Outputs.BuildProject" ], ""]
213-
CloudTrailTopic: !If [ DeployCloudTrail, !GetAtt ["CloudTrailStack", "Outputs.Topic"], !Ref ExistentCloudTrailSNSTopic ]
207+
CloudTrailTopic: !If [ RequiresCloudTrail, !GetAtt ["CloudTrailStack", "Outputs.Topic"], !Ref ExistentCloudTrailSNSTopic ]
214208
DeployCloudScanning: !If [ DeployCloudScanning, "Yes", "No" ]
215209
ECRImageScanningDeploy: !If [ ECRImageScanningDeploy, "Yes", "No"]
216210
ECSImageScanningDeploy: !If [ ECSImageScanningDeploy, "Yes", "No"]

templates/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
S3_BUCKET ?= "s4c-cft"
44
S3_PREFIX ?= "test"
55
# We need the REGION or the TemplateURLs might be created for a different region, resulting in a deployment error
6-
S3_REGION ?= "eu-west-1" # ireland
6+
S3_REGION ?= "eu-west-3" # ireland
77
SECURE_API_TOKEN ?= ""
88

99
.PHONY: packaged-template.yaml

0 commit comments

Comments
 (0)