Skip to content

Commit 86e26b2

Browse files
committed
Normalize EventBridge rule names and general clean up of templates based
on cfn-lint suggestions
1 parent c6b6ba3 commit 86e26b2

File tree

7 files changed

+15
-61
lines changed

7 files changed

+15
-61
lines changed

resources/saas-boost-core.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,14 @@ Resources:
420420
SaaSBoostPublicApi:
421421
Type: AWS::ApiGateway::RestApi
422422
Properties:
423-
Name: !Sub sb-public-api-${Environment}
423+
Name: !Sub sb-${Environment}-public-api
424424
EndpointConfiguration:
425425
Types:
426426
- REGIONAL
427427
SaaSBoostPrivateApi:
428428
Type: AWS::ApiGateway::RestApi
429429
Properties:
430-
Name: !Sub sb-private-api-${Environment}
430+
Name: !Sub sb-${Environment}-private-api
431431
EndpointConfiguration:
432432
Types:
433433
- REGIONAL
@@ -529,7 +529,7 @@ Resources:
529529
Type: AWS::Events::Rule
530530
Properties:
531531
EventBusName: !Ref SaaSBoostEventBus
532-
Name: !Sub sb-system-api-call-${Environment}
532+
Name: !Sub sb-${Environment}-system-api-call
533533
State: ENABLED
534534
EventPattern:
535535
source: ['saas-boost']

resources/saas-boost-svc-metrics.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ Resources:
339339
PublishRequestCountMetricsEvent:
340340
Type: AWS::Events::Rule
341341
Properties:
342+
Name: !Sub sb-${Environment}-metrics-count
342343
Description: A scheduled task to publish access log metrics to s3 web bucket
343344
# Run this every 30 minutes
344345
ScheduleExpression: "cron(0/30 * * * ? *)"
@@ -410,7 +411,7 @@ Resources:
410411
PublishResponseTimeMetricsEvent:
411412
Type: AWS::Events::Rule
412413
Properties:
413-
Name: !Sub sb-publish-access-log-metrics-${Environment}
414+
Name: !Sub sb-${Environment}-metrics-latency
414415
Description: A scheduled task to publish access log metrics to s3 web bucket
415416
# Run this every 30 minutes
416417
ScheduleExpression: "cron(0/30 * * * ? *)"
@@ -484,6 +485,7 @@ Resources:
484485
AddAthenaPartitionEvent:
485486
Type: AWS::Events::Rule
486487
Properties:
488+
Name: !Sub sb-${Environment}-metrics-athena-partition
487489
Description: A scheduled task to add partition for access logs daily
488490
# Run at 00:01 every day
489491
ScheduleExpression: "cron(15 0 * * ? *)"

resources/saas-boost-svc-onboarding.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ Resources:
10861086
OnboardingServiceDeleteTenantEventRule:
10871087
Type: AWS::Events::Rule
10881088
Properties:
1089-
Name: !Sub sb-${Environment}-onboarding-delete-rule
1089+
Name: !Sub sb-${Environment}-onboarding-delete
10901090
Description: Delete provisioned tenant
10911091
EventBusName: !Ref SaaSBoostEventBus
10921092
EventPattern:
@@ -1141,7 +1141,7 @@ Resources:
11411141
CodePipelineExecutionStateChangeEvent:
11421142
Type: AWS::Events::Rule
11431143
Properties:
1144-
Name: !Sub sb-${Environment}-tenant-pipeline
1144+
Name: !Sub sb-${Environment}-codepipeline-state
11451145
EventPattern:
11461146
source: ['aws.codepipeline']
11471147
detail-type: ['CodePipeline Pipeline Execution State Change']

resources/saas-boost-svc-tenant.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ Resources:
407407
TenantServiceUpdateResourcesEventRule:
408408
Type: AWS::Events::Rule
409409
Properties:
410-
Name: !Sub sb-${Environment}-tenants-update-resources
410+
Name: !Sub sb-${Environment}-tenant-update-resources
411411
Description: Update list of resources after a tenant is provisioned
412412
EventBusName: !Ref SaaSBoostEventBus
413413
EventPattern:

resources/saas-boost.yaml

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ Resources:
7979
Value: !Ref LambdaSourceFolder
8080
# Create all the S3 buckets SaaS Boost needs up front so we can create
8181
# a single Lambda IAM policy to clean up the buckets on stack delete
82-
#
83-
8482
LoggingBucket:
8583
Type: AWS::S3::Bucket
8684
Properties:
@@ -118,7 +116,6 @@ Resources:
118116
- !Sub arn:aws:s3:::${LoggingBucket}
119117
Condition:
120118
Bool: { 'aws:SecureTransport': false }
121-
122119
# Bucket needed for CodePipeline to drive tenant deployment workflow
123120
CodePipelineBucket:
124121
Type: AWS::S3::Bucket
@@ -155,7 +152,6 @@ Resources:
155152
- !Sub arn:aws:s3:::${CodePipelineBucket}
156153
Condition:
157154
Bool: { 'aws:SecureTransport': false }
158-
159155
# Bucket for Access Logs for ALBs for Tenants
160156
ALBAccessLogs:
161157
Type: AWS::S3::Bucket
@@ -175,13 +171,9 @@ Resources:
175171
ServerSideEncryptionConfiguration:
176172
- ServerSideEncryptionByDefault:
177173
SSEAlgorithm: AES256
178-
# LoggingConfiguration:
179-
# DestinationBucketName: !Ref LoggingBucket
180-
# LogFilePrefix: ALBaccess-logs
181174
Tags:
182175
- Key: SaaS Boost
183176
Value: !Ref Environment
184-
185177
# Bucket for Athena output for access log queries
186178
AthenaOutput:
187179
Type: AWS::S3::Bucket
@@ -201,9 +193,6 @@ Resources:
201193
ServerSideEncryptionConfiguration:
202194
- ServerSideEncryptionByDefault:
203195
SSEAlgorithm: AES256
204-
# LoggingConfiguration:
205-
# DestinationBucketName: !Ref LoggingBucket
206-
# LogFilePrefix: athena-logs
207196
CorsConfiguration:
208197
CorsRules:
209198
- AllowedMethods:
@@ -228,6 +217,7 @@ Resources:
228217
Condition:
229218
Bool: { 'aws:SecureTransport': false }
230219
# Bucket to host the admin console web application
220+
# NOTE: The deny non-secure policy is in the web template.
231221
WebS3Bucket:
232222
Type: AWS::S3::Bucket
233223
Properties:
@@ -247,8 +237,6 @@ Resources:
247237
Tags:
248238
- Key: SaaS Boost
249239
Value: !Ref Environment
250-
##NOTE: The deny non-secure policy is in the web template.
251-
252240
SaaSBoostUtilsLayer:
253241
Type: AWS::Lambda::LayerVersion
254242
Properties:
@@ -268,6 +256,7 @@ Resources:
268256
ClearBucketExecutionRole:
269257
Type: AWS::IAM::Role
270258
DependsOn:
259+
- LoggingBucket
271260
- WebS3Bucket
272261
- CodePipelineBucket
273262
- AthenaOutput
@@ -349,49 +338,40 @@ Resources:
349338
Value: !Ref Environment
350339
- Key: "BoostService"
351340
Value: "Logs"
352-
353341
InvokeClearCodePipelineBucket:
354342
Type: Custom::CustomResource
355343
DependsOn:
356-
- ClearBucket
357344
- InvokeClearLoggingBucket
358345
Properties:
359346
ServiceToken: !GetAtt ClearBucket.Arn
360347
Bucket: !Ref CodePipelineBucket
361348
InvokeClearAthenaBucket:
362349
Type: Custom::CustomResource
363350
DependsOn:
364-
- ClearBucket
365351
- InvokeClearLoggingBucket
366352
Properties:
367353
ServiceToken: !GetAtt ClearBucket.Arn
368354
Bucket: !Ref AthenaOutput
369355
InvokeClearAccessLogsBucket:
370356
Type: Custom::CustomResource
371357
DependsOn:
372-
- ClearBucket
373358
- InvokeClearLoggingBucket
374359
Properties:
375360
ServiceToken: !GetAtt ClearBucket.Arn
376361
Bucket: !Ref ALBAccessLogs
377362
InvokeClearWebsiteBucket:
378363
Type: Custom::CustomResource
379364
DependsOn:
380-
- ClearBucket
381365
- InvokeClearLoggingBucket
382366
Properties:
383367
ServiceToken: !GetAtt ClearBucket.Arn
384368
Bucket: !Ref WebS3Bucket
385-
##TODO: Do we want to clear the access logs bucket
369+
# TODO: Do we want to clear the access logs bucket?
386370
InvokeClearLoggingBucket:
387371
Type: Custom::CustomResource
388-
DependsOn:
389-
- ClearBucket
390372
Properties:
391373
ServiceToken: !GetAtt ClearBucket.Arn
392374
Bucket: !Ref LoggingBucket
393-
394-
##nested stacks
395375
network:
396376
Type: AWS::CloudFormation::Stack
397377
Properties:
@@ -454,7 +434,6 @@ Resources:
454434
# To Do - merge this stuff into the billing template
455435
metering:
456436
Type: AWS::CloudFormation::Stack
457-
DependsOn: core
458437
Properties:
459438
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-metering-billing.yaml
460439
Parameters:
@@ -468,7 +447,6 @@ Resources:
468447
PrivateApiStage: !Ref PrivateApiStage
469448
metrics:
470449
Type: AWS::CloudFormation::Stack
471-
DependsOn: core
472450
Properties:
473451
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-svc-metrics.yaml
474452
Parameters:
@@ -483,9 +461,6 @@ Resources:
483461
PrivateApiStage: !Ref PrivateApiStage
484462
onboarding:
485463
Type: AWS::CloudFormation::Stack
486-
DependsOn:
487-
- core
488-
- tenant
489464
Properties:
490465
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-svc-onboarding.yaml
491466
Parameters:
@@ -512,9 +487,6 @@ Resources:
512487
ApiGatewayHelperLayer: !Ref ApiGatewayHelperLayer
513488
settings:
514489
Type: AWS::CloudFormation::Stack
515-
DependsOn:
516-
- core
517-
- web
518490
Properties:
519491
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-svc-settings.yaml
520492
Parameters:
@@ -529,7 +501,6 @@ Resources:
529501
CloudFrontDistribution: !GetAtt web.Outputs.CloudFrontDistributionUrl
530502
tenant:
531503
Type: AWS::CloudFormation::Stack
532-
DependsOn: core
533504
Properties:
534505
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-svc-tenant.yaml
535506
Parameters:
@@ -543,7 +514,6 @@ Resources:
543514
Type: AWS::CloudFormation::Stack
544515
DependsOn:
545516
- core
546-
- web
547517
Properties:
548518
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-svc-user.yaml
549519
Parameters:
@@ -554,15 +524,6 @@ Resources:
554524
CognitoUserPoolId: !GetAtt web.Outputs.SBUserPool
555525
publicapi:
556526
Type: AWS::CloudFormation::Stack
557-
DependsOn:
558-
- core
559-
- web
560-
- billing
561-
- metrics
562-
- onboarding
563-
- settings
564-
- tenant
565-
- user
566527
Properties:
567528
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-public-api.yaml
568529
Parameters:
@@ -604,12 +565,6 @@ Resources:
604565
UserServiceToken: !GetAtt user.Outputs.UserServiceTokenArn
605566
privateapi:
606567
Type: AWS::CloudFormation::Stack
607-
DependsOn:
608-
- core
609-
- onboarding
610-
- quota
611-
- settings
612-
- tenant
613568
Properties:
614569
TemplateURL: !Sub https://${SaaSBoostBucket}.s3.amazonaws.com/saas-boost-private-api.yaml
615570
Parameters:

resources/tenant-onboarding-fsx.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ Resources:
311311
DeploymentType: MULTI_AZ_1
312312
PreferredSubnetId: !Ref 'PrivateSubnet1ID'
313313
ThroughputCapacity: !Ref 'ThroughputCapacity'
314-
315314
# need to get the DNSName for FSX for output
316315
FsxDnsNameRole:
317316
Type: AWS::IAM::Role
@@ -400,16 +399,14 @@ Resources:
400399
Properties:
401400
ServiceToken: !GetAtt FsxDnsNameFunction.Arn
402401
FsxFileSystemId: !Ref WindowsFSx
403-
404402
SSMParamFilesystem:
405403
Type: AWS::SSM::Parameter
406404
Properties:
407405
Name: !Sub /saas-boost/${Environment}/tenant/${TenantId}/WINDOWS_FSX_DNS_NAME
408406
Type: String
409407
Value: !GetAtt InvokeGetFsxDnsName.DnsName
410-
411408
Outputs:
412-
FSxFileSystemID:
409+
FileSystemId:
413410
Description: File System ID for FSx for Windows File Server
414411
Value: !Ref WindowsFSx
415412
WindowsFSxSGID:

resources/tenant-onboarding.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ Resources:
606606
- !If
607607
- ProvisionFsx
608608
- - ContainerPath: !Ref MountPoint
609-
SourceVolume: !GetAtt fsx.Outputs.FSxFileSystemID
609+
SourceVolume: !GetAtt fsx.Outputs.FileSystemId
610610
- !Ref 'AWS::NoValue'
611611
LinuxParameters:
612612
Fn::If:
@@ -631,7 +631,7 @@ Resources:
631631
FileSystemId: !GetAtt efs.Outputs.FileSystemId
632632
- !If
633633
- ProvisionFsx
634-
- - Name: !GetAtt fsx.Outputs.FSxFileSystemID
634+
- - Name: !GetAtt fsx.Outputs.FileSystemId
635635
Host:
636636
SourcePath: !Sub ${FSxWindowsMountDrive}\
637637
- !Ref 'AWS::NoValue'

0 commit comments

Comments
 (0)