forked from search-rug/iac-cost-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatterns.yml
972 lines (957 loc) · 70.8 KB
/
patterns.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
- name: Budget
patternType: pattern
description: Use budgets to receive alerts about charged and forecasted costs and control spending.
context: |
The lack of explicit cost monitoring can often lead to unforeseen and undesirable costs.
solution: |
Major cloud providers support the creation of budgets, which allow users to define alerts
about charged and forecasted costs and control spending. Having one or more budgets can
help monitor and manage the cost of cloud deployments.
example: |
Define a budget for a cost limit of 1200 USD for EC2, and generate an
email notification if the forecasted monthly cost exceeds this amount:
```terraform
resource "aws_budgets_budget" "example" {
name = "example"
budget_type = "COST"
limit_amount = "1200"
limit_unit = "USD"
time_unit = "MONTHLY"
cost_filter {
name = "Service"
values = [
"Amazon Elastic Compute Cloud - Compute",
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 100
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["test@example.com"]
}
}
```
references:
- title: Cloud Cost And Usage Budgets - AWS Budgets - AWS
url: https://aws.amazon.com/aws-cost-management/aws-budgets/
- title: Create, edit, or delete budgets and budget alerts | Cloud Billing | Google Cloud
url: https://cloud.google.com/billing/docs/how-to/budgets
- title: Tutorial - Create and manage budgets - Microsoft Cost Management | Microsoft Learn
url: https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-acm-create-budgets?tabs=psbudget
- title: 'Resource: aws_budgets_budget (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/budgets_budget
- title: 'Resource: google_billing_budget (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/billing_budget
- title: 'Resource: azurerm_consumption_budget_resource_group (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_resource_group
occurrences:
terraform:
- https://github.com/AJarombek/global-aws-infrastructure/commit/4a89f4b8235961275fa0e6aaf20848f2b8b7e733
- https://github.com/MartinFeineis/terraform/commit/359ba426393c78b78695797f9bdd6a08c0455720
- https://github.com/stuartellis/stuartellis-org-tf-modules/commit/39a9cabac6765c75591ba258fef0d10ba7ae0f9e
- https://github.com/forgotpw/forgotpw-infrastructure/commit/f4363ad27d366385f2388d073ce8af796e035406
- https://github.com/Katesagay/terraform-repo/commit/9aacfbe12e3e7c1e726b9a3d834211aae01f419c
- https://github.com/darogina/terragrunt-aws-modules/commit/9c84d03bde131e7f349dcd493ba5b7e55bf8ae2c
- https://github.com/chetanbothra/Terraform_AWS_Billing_Alert/commit/43b0d3b4cef0d3f57d4f5d4f1c7aeb9bfc3e362a
- https://github.com/ntk1000/aws-terraform-template/commit/d016b96d89370b8039817fabdfa055576cf6b4cc
- https://github.com/StratusGrid/terraform-aws-single-account-starter/commit/c291c0954c89e1bfbdb76d4c8990baf9db986343
- https://github.com/nsbno/terraform-aws-cost-alarm/commit/7e135499d33f0a5c51602a506fefe258cac072c6
- https://github.com/64kramsystem/ultimate_aws_certified_cloud_practitioner_course_terraform_configuration/commit/2f36b8a5f2f818138da72d218c1f3c9666ed54aa
- https://github.com/kelledge/idkfa/commit/25cda0b77ff329a89551cc6f14fe8c62820fd424
- https://github.com/oke-py/aws-tf/commit/ec2982c8742cc7bc294f8a3cc07ae9ba5ffcaced
- https://github.com/cob16/aws_static_website/commit/0d4fbd0a7b296a5c9377a835dff89d1499716082
- https://github.com/mintak21/terraform-old/commit/c10b476d869282ed6cf55def47445b9c703788fe
- https://github.com/alphagov/govwifi-terraform/commit/348b52a2ae5d6d242c8802644f9e3a5e6460de1d
- https://github.com/eladidan/speedyhead.xyz-terraform/commit/71f034f3e13e9118a2a954e1fc3c0d35153184f0
- https://github.com/coremaker/terraform-google-nucleus/commit/11234f631f7370dd80ee5fbc5dd7bdbc12dcbf49
- https://github.com/robgmills/jumpbox/commit/028bbe114d099b0388be9a46adcab80d9383a518
- https://github.com/AdrianNeatu/blog-terraform/commit/3ba302c69eb2a491a5b23e94084b4ddd24a4a703
- https://github.com/richardhughes/infra-modules/commit/48015a86eda461d99b580b69db5922acbe5bd28e
- https://github.com/patheard/terraform-cantrill-aws-associate/commit/bc7484cd34698f2724e5d9f241fd9f53d953e3a3
- https://github.com/alghanmi/terraform-modules/commit/f4e8069ff11b7ca7a15ce25843b26d00fb399ade
- https://github.com/cds-snc/cloud-based-sensor/commit/10bb572d477197bd3874532bfd364de1cb496d05
- https://github.com/rmaheshvarma/terraform/commit/c866a7dd2575dd2a3f4af83f5f081a5004d0e478
- https://github.com/akerl/aws-account/commit/91967d4089ad9580ceae62f7845581935c892455
- https://github.com/singaporewaketools/iaac/commit/197502b1ac4bab77b9ab017b755c4d75ddaa218b
cloudformation:
- https://github.com/aws-samples/aws-serverless-ecommerce-platform/commit/e2255a1e428a5a0159a0c66ea825b7fd54ba8bfb
- https://github.com/guardian/members-data-api/commit/60d881e84b70080ed7a294219f2b7e64bec21673
- https://github.com/enekofb/beyond-gdp/commit/9fd76fd7270a0ed75f252001cb48a05740f0cebf
- https://github.com/Nonagon-Media/acg/commit/dfc8a883d178a78c5233e1d790cc5f8209f93b6b
- https://github.com/daiyyr/the-alchemist/commit/1254c61457727e91574a8eb96dfd24e50721c6ca
- https://github.com/xhiroga/til/commit/9d549cbcad7886c8861c5f69fb8f3d549e2f7664
- https://github.com/christoferson/aws-cloudformation/commit/fbde48d9640dbff07552bb4f7357b44b16ad9675
- https://github.com/btkrausen/aws/commit/84932c34ae2a4967809a76e58a67b41f89e43dde
- https://github.com/Nxtra/aws-billing-alarms/commit/0a15638e30d0e0a55ee76c3402a67ff91c50339e
- https://github.com/adrian83/aws-samples/commit/2aedc136fc1ed5e6b794268e5aeba6b625fcf903
- https://github.com/sjakthol/aws-account-infra/commit/ab4424e4f8a34f47d8511c982b84bfce7086d59a
- https://github.com/HicResearch/TREEHOOSE/commit/d5a9110cae074b09ac641be3b76ab777068b70ff
- https://github.com/kennyk65/aws-teaching-demos/commit/5dfc77f0065462480ee1eec85927cee7c7d57a77
- https://github.com/torproject/metrics-cloud/commit/ba1148b6b98acdebf3c861f22a19b59cde829922
- name: Spot instances
patternType: pattern
description: Use spot instances to run interruptible workloads for significant cost savings compared to regular instances.
context: |
Continuously running compute instances are also continuously billed.
Certain types of workloads which can handle interruption, e.g. batch jobs,
data analysis and optional tasks, do not require on-demand, provisioned instances.
solution: |
Major cloud providers offer excess compute capacity in the form of spot instances.
These provide discounts over on-demand compute instances, with the caveat that instances
can be preempted or deleted at any time when compute capacity needs to be reclaimed.
Users define a price limit and if the spot price falls below this limit, an instance is allocated.
If a user's workloads can handle interruptions, spot instances can offer an economical
alternative to regular instances.
example: |
Use spot instances to run batch jobs: if some of the instances are preempted,
the job is slowed down, but it does not completely stop. For example, request a
worker at a price of 0.03 USD:
```terraform
resource "aws_spot_instance_request" "cheap_worker" {
# ...
spot_price = "0.03"
instance_type = "c4.xlarge"
tags = {
Name = "Worker"
}
}
```
references:
- title: Spot Instances - Amazon Elastic Compute Cloud
url: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html
- title: Spot VMs | Compute Engine Documentation | Google Cloud
url: https://cloud.google.com/compute/docs/instances/spot
- title: Spot Virtual Machines - Spot Pricing and Features | Microsoft Azure
url: https://azure.microsoft.com/en-us/products/virtual-machines/spot/
- title: 'Resource: aws_spot_instance_request (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/spot_instance_request
- title: 'Resource: aws_spot_fleet_request (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/spot_fleet_request
- title: 'Resource: google_compute_instance (Terraform) - Provisioning model'
url: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#provisioning_model
- title: 'Resource: azurerm_linux_virtual_machine (Terraform) - Priority'
url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine#priority
occurrences:
terraform:
- https://github.com/openinfrastructure/terraform-google-gitlab-runner/commit/8429375df72b04cc6fedc1ebb5f2c2e4ba18b9f2
- https://github.com/kathputli/terraform-aws/commit/321b1aee88f7d15dafe46aede2b86ced70061025
- https://github.com/naciriii/terraform-ec2-gitlab-runner/commit/f8af6bc22bd3d827566e7e65deb63c13cdaf6031
- https://github.com/Hapag-Lloyd/terraform-aws-bastion-host-ssm/commit/516075e2987bdd1063f22768d451c1c1eb647175
- https://github.com/ToruMakabe/aks-anti-dry-iac/commit/4ba7a9dc3085ab701c85737a4f36dd57fcd7596f
- https://github.com/paperphyte/terraform-drone/commit/79f4b7c2cf3ad2d1a6d2646eaf27a08fd2611d07
- https://github.com/filhodanuvem/from-dev-to-ops/commit/998be8119321e8812884075b078a1d5fb36cfa69
- https://github.com/stephaneclavel/terraform/commit/74b4ba406b9ea761d27298165d0e0de45c9d8491
- https://github.com/tale-toul/SingleNodeOpenshiftOnLibvirt/commit/638430604158044fcf123adaf8dfdcc91b1a873e
- https://github.com/JaredStufftGD/grok-airflow/commit/7ac9544b0c651fd8193eb063079514d0aa41e290
- https://github.com/kaz/kiritan.com/commit/1cd96c7f71e56629ffa07c38e12c4da19fcfc5f7
- https://github.com/openinfrastructure/terraform-google-multinic/commit/7a9c468b88d2edee19007cff6529a20a38eeb363
cloudformation:
- https://github.com/andymac4182/fargate-bastion/commit/de01bb150685491c3f592e83cd0912fe5a32dab9
- name: Object storage lifecycle rules
patternType: pattern
description: Define lifecycle rules for object storage to move objects to cheaper storage or drop them entirely.
context: |
By default, objects stored in cloud object storage are retained,
and therefore billed, indefinitely. Objects also have a storage class or access tier,
which can be used to balance access performance and cost depending on the use case.
solution: |
By configuring lifecycle rules or policies, objects can be transitioned to
cheaper storage classes or deleted after a certain amount of time.
example: |
Transition objects under the "log/" prefix to the Glacier storage class after 60 days, and expire after 90 days:
```terraform
resource "aws_s3_bucket_lifecycle_configuration" "example" {
bucket = aws_s3_bucket.bucket.id
rule {
id = "log"
expiration {
days = 90
}
filter {
prefix = "log/"
}
status = "Enabled"
transition {
days = 60
storage_class = "GLACIER"
}
}
}
```
references:
- title: 'Resource: aws_s3_bucket_lifecycle_configuration'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_lifecycle_configuration
- title: 'Resource: google_storage_bucket (Terraform) - Life cycle settings'
url: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket#example-usage---life-cycle-settings-for-storage-bucket-objects
- title: 'Resource: azurerm_storage_management_policy (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_management_policy
occurrences:
terraform:
- https://github.com/alphagov/govuk-aws/commit/f844cd8e254b161bebef04101f8ce177bcd0840c
- https://github.com/alphagov/govuk-terraform-provisioning/commit/ac105ab0a5ae38fbf69167e072f8970a4a61c3e8
- https://github.com/ExpediaGroup/apiary-data-lake/commit/47e62f2fc73a96611606cd619c084d1ded9d844d
- https://github.com/SamTowne/BasketballDrillBot/commit/4ec6d54e4d36ab02b0a7daf042e727717371eaec
- https://github.com/utilitywarehouse/tf_telecom/commit/17007456991c1a8faa26b1f4ac993883f577d124
- https://github.com/trajano/terraform-s3-backend/commit/cb9f00a2f6f23b44f7db08863ef5fb0b9ea0bc0c
cloudformation:
- https://github.com/Sage-Bionetworks/service-catalog-library/commit/7d5224b90cf2c47eee807f851dbf0ff14d051191
- https://github.com/jamesoff/cloud/commit/9ac70dc914bef24c62e2b603cc03a0eaefaed391
- https://github.com/gbourniq/django-on-aws/commit/32a058dd02229c8bf8e272f549f60c02bf2009ce
- https://github.com/Jessinra/TriveryID-Skadi/commit/d91bc4e786a86f7c088413ac1f7ba701cb7e499f
- https://github.com/wolfeidau/wolfeidau_site/commit/52de425e9eedfae9b51a29366a4b6aefcca51658
- https://github.com/kriation/cloudformation/commit/daaea80eaa33ca0041a76ef06baee031bd4ffaf4
- https://github.com/gbourniq/django-on-aws/commit/4400bcccee4356214d332b9549efcae4e74458be
- https://github.com/chef-boneyard/aws_native_chef_server/commit/f63839453506420064afb7350971c65be47d39a6
- https://github.com/m-chandler/factorio-spot-pricing/commit/7290615791393f15f636eb616e76ae7e7d2384c5
- https://github.com/adamjreed/dogchecker/commit/6fe5fba49531813b2c473d3805a9a17075e41fff
- https://github.com/h1f1x/aws-cfn-examples/commit/b157e0f038a8acb4d917f9e18d0adddd7cd4192c
- https://github.com/sjakthol/cfn-execute-change-set/commit/7aa1557a573a4d44acec840698e34f41efc29df0
- https://github.com/widdix/aws-cf-templates/commit/03a8713f53a4a514898bd481eb6628b6b56cfff1
- name: Expensive instance
patternType: antipattern
description: Compute instances are often overprovisioned even when a cheaper instance would suffice.
context: |
A recurring pattern in cloud deployments is that developers initially
choose compute instances which are overprovisioned, because it is
difficult to know the requirements upfront. This leads to situations
where developers deploy, for example on AWS, '2xlarge' instances, when
in fact 'large' or even 'medium' would suffice.
solution: |
Critically evaluate required performance levels and special functionality
(e.g. memory-optimized versus general-purpose instances), and scale down
the provisioned instance types where appropriate.
example: |
Downgrade to a cheaper general-purpose instance in the same family to save costs:
```diff
@@ -1,5 +1,5 @@
resource "google_compute_instance" "example" {
name = "example"
- machine_type = "n1-standard-1"
+ machine_type = "g1-small"
# ...
}
```
references:
- title: 'Resource: aws_instance (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance
- title: 'Resource: google_compute_instance (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance
- title: 'Resource: azurerm_linux_virtual_machine (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine
- title: 'Resource: azurerm_windows_virtual_machine (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_virtual_machine
- title: Compute - EC2 Instance Types - AWS
url: https://aws.amazon.com/ec2/instance-types/
- title: Machine families resource and comparison guide | Compute Engine Documentation | Google Cloud
url: https://cloud.google.com/compute/docs/machine-resource
- title: Virtual Machine series | Microsoft Azure
url: https://azure.microsoft.com/en-us/pricing/details/virtual-machines/series/
occurrences:
terraform:
- https://github.com/beaulabs/terraform_aws_ec2_instance/commit/d6df68da5ae58fb5c650c6be15d9d8e676a129db
- https://github.com/gudlyf/TerraformOpenVPN/commit/4bc861c153b65a2d7c0d5f3fac30ab72b0fc6942
- https://github.com/IncredibleHolg/infra-aws-code/commit/70904707a36ff8e5167e695de3529d8318911ba4
- https://github.com/ministryofjustice/cloud-platform-infrastructure/commit/e5dd13d33c1e927f932971d067d8f70e9041b5f3
- https://github.com/cisagov/cyhy_amis/commit/4e67a501bb3f5187a3e9af523921ac62b8a88469
- https://github.com/Kalmalyzer/UE-Jenkins-BuildSystem/commit/636097557e403eb1d6b6211b09e30c47e7f39466
- https://github.com/dshmelev/aws_kube_tc/commit/853298ac74250964aa2d2ea921daa5905528b3a9
- https://github.com/aaaaasam/azure/commit/c7bc0ce6f3fcaffcbbe7753f1a9d8437809bc167
- https://github.com/rbabyuk/terra/commit/beae899804779adf914c08f290c5d71b542c9ed1
- https://github.com/Leonard-Ta/Sample-Security-service-Terraform/commit/c16481a84d5823b65ce96bd811a265222385b43b
- https://github.com/jjffggpp/jjffggpp/commit/93ee12adde6ac773c76b590fe89c24df372f326b
- https://github.com/EngineerBetter/kf-infra/commit/fa5f7fb35b0b44020fb81dd5c4e3b9ceaca1f967
- https://github.com/KoutaroNohira/hashicat/commit/81dc1d3f98034672d5f62f440f2cc3abc58ce2a2
- https://github.com/wallnerryan/terraform-scaleio/commit/605e74facfa2ff519ba5cda6e57474666901bd8c
- https://github.com/UrbanOS-Examples/common/commit/206394bcc75866953f64cbf3bd6214e4e6f96e91
- https://github.com/cookpad/terraform-aws-eks/commit/59c40286757e1fa5cb5391421c5380e5ad506387
- https://github.com/ayltai/hknews-infrastructure/commit/68171be117d3997b84253258f41fad6daedbc76a
- https://github.com/joelchrist/terraform/commit/bbf18d695bd7597977ea7a97d5434ca7f1a37d57
- https://github.com/jg210/aws-experiments/commit/5ff37f12a421fdd902d8eb1e6d7491ee181fd179
- https://github.com/scott45/vof-deployment-scripts/commit/c6b2c1bee4c1e53e87fd3d94fc8c07cf64342d7b
- https://github.com/fdns/terraform-k8s/commit/f106917bb7b2d8d4428022bb119585bf9f35769c
- https://github.com/ministryofjustice/hmpps-env-configs/commit/670c006bad288d0360c3811aa63b3c323753c385
- https://github.com/ministryofjustice/hmpps-env-configs/commit/954dda617d47007a8a1ff5780d3174e900e95be1
- https://github.com/Linaro/qa-reports.linaro.org/commit/76c8d1ee35046912b6da4f1cc23e8b1dcc12abe9
- https://github.com/KieniL/terraform_setups/commit/37f66bc43f57b1b7a5a897c58cefe09900afd7ef
- https://github.com/digio/terraform-google-gitlab-runner/commit/07f8279fe65a35c0e595f3171f3d75791e49a9ae
- https://github.com/jharley/azure-basic-demo/commit/7cd3d202d8723c565704f23c143cae3b1e1d6d2b
- https://github.com/pangeo-data/terraform-deploy/commit/f8163bd52bea3774e2f160cff0523c602e65d933
- https://github.com/pangeo-data/terraform-deploy/commit/7244eed07a1008675f45cc4349bf68141bb29edc
- https://github.com/aeternity/terraform-aws-devnet/commit/f4113a8f7e52991dfb75f63688aeba77bac76b01
- https://github.com/schubergphilis/terraform-aws-mcaf-matillion/commit/3b0e2fe42d660664c49d54ae8706de004a9b4176
- https://github.com/binbashar/le-tf-infra-aws/commit/0208ae3bc238f029b1faf6bdc3552dbe6147657b
- https://github.com/fpco/terraform-aws-foundation/commit/cfe92035f1b281cddfcf62664ec6b96e85e0ac32
- https://github.com/Civil-Service-Human-Resources/lpg-terraform-paas/commit/59477d3dc237e72252bde005b783213b7e8ed961
- https://github.com/ibm-cloud-architecture/iks_vpc_lab/commit/629819ce0c440760be155874cb42ab497f0304bd
- https://github.com/goodpen/gke-v.1.0/commit/45053a0862bf97f0525862c411fa4da5d59ac397
- https://github.com/rshurts/gke-cd-with-spinnaker/commit/3bc712aba0c797053b5cdc113e3e46afb6cff8a5
- https://github.com/kaz/kiritan.com/commit/1cd96c7f71e56629ffa07c38e12c4da19fcfc5f7
- https://github.com/midl-dev/tezos-auxiliary-cluster/commit/9cbfebaab11cb3466b160d18ef2eb46c0b875d55
- https://github.com/NLnetLabs/rpki-deploy/commit/8bd6e745475f635d6f6b6929a545afa2e1d9dd57
- https://github.com/TimonB/tf-azure-example/commit/ce89df3cebc6487146391afe9517661053229f77
- https://github.com/00inboxtest/terraform-google-vault/commit/1d0b5db7f310dc6a47af3130a97e5373d9cdaddf
- https://github.com/Amberoat/didactic-octo-eureka/commit/494706fc421a0ddda47f7d543b7e7a296c378c26
- https://github.com/robertdebock/terraform-aws-vault/commit/757edca9d6fb2231ebdcf03ec611183c59eaf39b
- https://github.com/covid-videoplattform/covid-videoplattform/commit/83d8b928ecb3f271a058bb30eaa1e05ce10e0434
- https://github.com/alphagov/govuk-infrastructure/commit/a51a3bfcd73fd55ecd43aa36ce3f266f0cefc2dc
- https://github.com/pelias/terraform-elasticsearch/commit/8454c8ee25e821abde10b73a2fec691269e41822
- https://github.com/ironpeakservices/infrastructure/commit/2ca24fa9114b5b4389768d5ab93c1e6d99bb287c
- https://github.com/robertdebock/git-terraform-demo/commit/5638b1a044215292a5e3fa405b6a0567c6b35436
- https://github.com/robertdebock/git-terraform-demo/commit/686374095321975d851932a77b139d627f50c7d5
- https://github.com/jenkins-infra/aws/commit/586fde061356513609fe4f2014a11ddcec849c35
- https://github.com/poseidon/terraform-azure-kubernetes/commit/4989bf2d4a5eed7f1fcb01f63db5624afa113232
- https://github.com/poseidon/typhoon/commit/8d2c8b8db692b27b89d18e47a40cf7b49562694e
- https://github.com/poseidon/typhoon/commit/b68f8bb2a9f0825af76a563051c32100386024db
- https://github.com/tlc-pack/ci-terraform/commit/af285dd17beb9c35ea6339b3b9f43d6b166b5411
- https://github.com/binbashar/le-tf-infra-aws/commit/10cf13515c722708cfacb8f22ca9b05abca67505
cloudformation:
- https://github.com/widdix/aws-cf-templates/commit/0156a84027bc371504a520c5ad85b332cdf0197d
- https://github.com/rik2803/aws-account-config/commit/2f9a9e356f04fb859a443f032592926d62e2df20
- https://github.com/ceno/Quake3Quest-servers/commit/cd977f78fdad8ac20f8e6f7d6f2bae413bfba9d7
- https://github.com/GerritCodeReview/aws-gerrit/commit/6d870855767ffbf684822adeb5136d0788f8a7df
- https://github.com/nasa-petal/PeTaL-db/commit/15142ebe0c06722f916db9b447693190437c7136
- https://github.com/FINRAOS/herd-mdl/commit/937aafaf67e678be2978d660b1359c3887a5f933
- https://github.com/voyagertherapeutics/aws-genomics-workflows/commit/339e57b766ada13defb690a2593392a786776650
- https://github.com/Percona-Lab/jenkins-pipelines/commit/323030cf76eee050c85f2ab0c46bba3888e4d392
- https://github.com/CloudEric/dnsvpn-cloudformation/commit/dc4f583344f235b146dfe5ea47b8c4c5fdd30089
- https://github.com/mludvig/aws-crypto-miner/commit/d7d285a3e2a1327739ac1848f15248517e81e173
- https://github.com/rik2803/aws-account-config/commit/c3a4dc55c0f13ca4dc3cc8fab8f46fd72ebb421c
- https://github.com/MrMarvin/open-wow-drealmd/commit/0b23fe7bf08d4682835ca171d228380ec81a2fb5
- https://github.com/ASFHyP3/asf-stac/commit/3a19e68cda5b174a655a699b8ac74eaa7c826159
- name: Old generation
patternType: antipattern
description: Using newer resource generations gives similar performance for lower cost.
context: |
Cloud providers occasionally update their offerings to support, for example,
newer CPU generations. These newer generations are often more efficient, making
them a more economical option compared to older generations.
solution: |
Upgrade resources to newer generations to attain comparable or better performance
for a lower price. The most commonly replaced resources include, but are not limited
to, AWS's t2 general-purpose compute instances and gp2 storage volumes.
example: |
Switch from gp2 to gp3 storage, providing comparable performance but lower cost:
```diff
@@ -1,7 +1,7 @@
resource "aws_instance" "example" {
# ...
root_block_device {
- volume_type = "gp2"
+ volume_type = "gp3"
# ...
}
}
```
references:
- title: Amazon EBS volume types
url: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html
- title: Migrate your Amazon EBS volumes from gp2 to gp3 and save up to 20% on costs
url: https://aws.amazon.com/blogs/storage/migrate-your-amazon-ebs-volumes-from-gp2-to-gp3-and-save-up-to-20-on-costs/
- title: Compute - EC2 Instance Types - AWS
url: https://aws.amazon.com/ec2/instance-types/
- title: Amazon EC2 T2 Instances - Amazon Web Services (AWS)
url: https://aws.amazon.com/ec2/instance-types/t2/
- title: Amazon EC2 T3 Instances - Amazon Web Services (AWS)
url: https://aws.amazon.com/ec2/instance-types/t3/
occurrences:
terraform:
- https://github.com/gudlyf/TerraformOpenVPN/commit/be1245d8634025277ba79a4155ee88d7eaffcdfb
- https://github.com/alphagov/govuk-aws/commit/6cfda6ada5137b232ff442ae9f2aedc8520ee1b4
- https://github.com/alphagov/govuk-aws/commit/aeb3bfbe393cdfc02e62b812843ed75cf5f245e4
- https://github.com/alphagov/govuk-aws/commit/5fa5da9756f12559b490217dd5b173db48e7f2a9
- https://github.com/alphagov/govuk-aws/commit/19d187e4a29147cbcf1cfae456cfcbfa8ad52b45
- https://github.com/alphagov/govuk-aws/commit/806b1a2a47f2f4e580e524b2cf8cc5928749d972
- https://github.com/alphagov/govuk-aws/commit/8d7d2ebe0dbe9ebf8009572d1d710c4700cf245e
- https://github.com/greenbrian/musical-spork/commit/24c07bfd5c31438fff6374e9ba3d577e6402d777
- https://github.com/dotancohen81/Rancher/commit/90944271b4e8bd46e3d42ac64bc4964a33a8fdc3
- https://github.com/cisagov/cyhy_amis/commit/7b8d9247a679295e0e1791b13d6c437c473e44b8
- https://github.com/yardbirdsax/elasticsearch-the-hard-way/commit/521bae59a4002a616eac44c1681ca5066bbd00c8
- https://github.com/GBergeret/tf-vpc-module/commit/34d80ece7d0ef598414baffceb074c6580dd819b
- https://github.com/cisagov/vulnerable-instances/commit/f70410061b8c6b9249895571e05dfb7a142efb18
- https://github.com/dwp/dataworks-aws-data-egress/commit/14f065e5161fee14c286c34df7db9f5516ef9bb6
- https://github.com/circleci/enterprise-setup/commit/26cc5295c2bb9d8756e450712e0f5f75af440c4a
- https://github.com/bh1m2rn/gitlab-environment-toolkit/commit/b9750f0bb88bc22256085b6bc8f060055e90a8c4
- https://github.com/travis-ci/terraform-config/commit/4f641b162fa877aef842481631906d5bfe874781
- https://github.com/byu-oit/terraform-aws-rds/commit/86a0795540edb426c3226775d73fcd4ce807d36a
- https://github.com/poseidon/terraform-azure-kubernetes/commit/633eb938742a43be09612b944c29aaaf70dac119
- https://github.com/poseidon/terraform-aws-kubernetes/commit/e09126b45746f1c967d1990fa04ce781a0478c6d
- https://github.com/deadlysyn/terraform-keycloak-aws/commit/1c982ac4120ae3ed5a88c38f2a4d568ad9a83d22
- https://github.com/ONSdigital/eq-terraform/commit/79845fe095cd87287346f40d2adce9b28a32ef35
- https://github.com/kinvolk-archives/lokomotive-kubernetes/commit/f2f4deb8bb44988eeb0b64b919e51fb556aef4fb
- https://github.com/smarman85/a_new_hope/commit/de97a6b8033c866c3b711468207aa4890049daaa
- https://github.com/kmishra9/PL2-AWS-Setup/commit/0d7b5b0f6f92ff6cfde1f17ad96d1b1459a0957a
- https://github.com/cisagov/cool-sharedservices-nessus/commit/5403a8978053a1299b0afe8d7fc59e914fc5e354
- https://github.com/guillaumekh/wg-terraform-template/commit/effee9cbc473af5d07cfc3aacece50aa6e59753a
- https://github.com/ninthnails/terraform-aws-camellia/commit/0019704e14723aaf326840ab36c594c3f514a2d4
- https://github.com/openaustralia/infrastructure/commit/63ee190c0ae1832bb72681e1e4b1b14a9367b4bb
- https://github.com/robertdebock/terraform-aws-vault/commit/e3b6520960a88aacbf03339dc1368f680a8bee9a
- https://github.com/cisagov/cool-assessment-terraform/commit/3138943ab4d15cc256d322e1128862ef11383c73
- https://github.com/pelias/terraform-elasticsearch/commit/21c1827f4507eae217d43d99ad8cb1bbb1337e21
- https://github.com/lowflying/OVPN---TF/commit/be1245d8634025277ba79a4155ee88d7eaffcdfb
- https://github.com/figurate/bedrock/commit/bffc023eeff075ef281b1fd261897f4c7216b354
- https://github.com/alphagov/govuk-aws/commit/ffa75257747f225577616e6cf517eee965221041
- https://github.com/jg210/aws-experiments/commit/b09b668e5c3a11366551168541480b69e94c8c3a
- https://github.com/ministryofjustice/cloud-platform-environments/commit/ce502048eb3cd95e708f4575efefaf8dc60d7722
- https://github.com/ministryofjustice/cloud-platform-environments/commit/b6cea25115ac93a788cdedc2fe2f94d2c7ff6658
- https://github.com/ministryofjustice/cloud-platform-environments/commit/aa07f2d9772cc376589bec2cbb42f9ba849927db
cloudformation:
- https://github.com/openrelayxyz/ethercattle-deployment/commit/169a5f7292d7e15be885c33b345ce87477d8d227
- https://github.com/guardian/multimedia-launchdetector-v3/commit/f0a2dd00bade5d9ebf943be0af3f8ed3982d54d2
- https://github.com/guardian/archivehunter/commit/c4b49a9c288973886c0d95ae93ef006842e892fe
- https://github.com/chef-boneyard/aws_native_chef_server/commit/f63839453506420064afb7350971c65be47d39a6
- https://github.com/widdix/aws-cf-templates/commit/0156a84027bc371504a520c5ad85b332cdf0197d
- https://github.com/Financial-Times/com.ft.editorial.cms.ecs/commit/ff8be3eafd1e10ec6c80d60e6dac5bb1e6df7c69
- https://github.com/guardian/status-app/commit/018c277e53700d397b89e583b1ff8aec3f695acd
- https://github.com/cyberark/pas-on-cloud/commit/abced10a2e49510831fa7ef82b520b7a1701d8c9
- https://github.com/S8Vega/academic-friends-api/commit/c4747679155f119a07284f5eee455eee5dd7c1a6
- https://github.com/UTSA-ICS/galahad/commit/b40d5ff5e4c2d018a39c1a3536878eaec31df729
- https://github.com/alope107/collage-sam/commit/dbb61c7bd6e0c69f34837b5d2d50bdef3ceb1dfb
- https://github.com/nasa-petal/PeTaL-db/commit/15142ebe0c06722f916db9b447693190437c7136
- https://github.com/FINRAOS/herd-mdl/commit/937aafaf67e678be2978d660b1359c3887a5f933
- https://github.com/primeharbor/pht-prowler-searchcluster/commit/fdf850a04a796ef4bc99a2521eec28edba258ba6
- https://github.com/guardian/multimedia-plasma-dashboard/commit/839575666178bae80c51dc7cd0c9f44a6164fc9e
- https://github.com/atlassian/aws-infrastructure/commit/65a7a5ca335c569c3f4213889034561cf9d5db07
- https://github.com/buildkite/elastic-ci-stack-for-aws/commit/f9738e221b496fd12f5d917c0515ad0e008dfbc1
- https://github.com/BastLeblanc/retail-demo-store/commit/e1c862637b8afdeb2832dedaef25e63253bc6780
- https://github.com/developmentseed/sat-api-pg/commit/7869c28fdd24ae10254a6431f5b93251bd0580f6
- name: Expensive storage type
patternType: antipattern
description: More expensive storage types are often used even when cheaper storage types would be sufficient.
context: |
Developers are able to choose between different storage types (HDD vs SSD, durability guarantees)
for e.g. instances' root disks. However, not all use cases require highly durable SSD storage,
making cheaper storage types a viable way to save cost.
solution: |
Evaluate performance and durability guarantees for storage and switch to
a less expensive type where relevant.
example: |
Switch an OS disk from Premium LRS storage to Standard LRS:
```diff
@@ -1,6 +1,6 @@
resource "azurerm_linux_virtual_machine" "example" {
# ...
os_disk {
- storage_account_type = "Premium_LRS"
+ storage_account_type = "Standard_LRS"
}
}
```
references:
- title: 'Resource: azurerm_linux_virtual_machine (Terraform) - os_disk'
url: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine#os_disk
- title: Amazon EBS volume types
url: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html
- title: Storage options | Compute Engine Documentation | Google Cloud
url: https://cloud.google.com/compute/docs/disks/
- title: Azure managed disk types
url: https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types
occurrences:
terraform:
- https://github.com/thomastodon/jabujabu/commit/02210a3d3ba4a770c29623825b7f54f3ff33f3c7
- https://github.com/giantswarm/giantnetes-terraform/commit/53ed24b573947c73ea9f0f4f8b477c44b7de2d54
- https://github.com/Kalmalyzer/UE-Jenkins-BuildSystem/commit/ee8942b2c5d59546dd3b3be5f2cb88500d0fe1be
- https://github.com/Leonard-Ta/Sample-Security-service-Terraform/commit/c16481a84d5823b65ce96bd811a265222385b43b
- https://github.com/falldamagestudio/UE4-GHA-BuildSystem/commit/e58083adbf91e7daa8ddb5db6c3b2e5c8c0a906c
- https://github.com/bculberson/btc2snowflake/commit/9f8227bf53ebc2b1bb0b99d0697f9f66eed7ab6d
- https://github.com/ministryofjustice/hmpps-env-configs/commit/0328838420ac0d3754cf772a7d2f5bb1612193ed
- https://github.com/travis-infrastructure/terraform-stuff/commit/1e208af4c83d093c900f4cccedbca6183142a07f
- https://github.com/sdcote/cloudsql/commit/dfe44fcf8f5a477e1fbc354f1b1d87af28895c0f
- https://github.com/wellcomecollection/archivematica-infrastructure/commit/ce576be106257496e20d946d6eab5f8783dada92
- https://github.com/jshcmpbll/Cloud-Mac-KVM/commit/361885d22c0304cb44683f9b005f82ca5e269841
- https://github.com/TimonB/tf-azure-example/commit/b49579fbecbe8002932fdfb86146f83efd60bfcf
- https://github.com/phillhocking/aws-ubuntu-irssi/commit/1532e0c298ec4f8d7d749a884f7c46f2a2cf53d3
- https://github.com/bhfsystem/fogg/commit/81e606a72e7c2e06c2f6d9c204086157aa82eac3
- https://github.com/bhfsystem/fogg/commit/7cc487f270d553f819fea0cf96e872c374979305
- https://github.com/cisagov/freeipa-server-tf-module/commit/99fd319a72d25441acf36fd2c167a875e9028935
- https://github.com/ministryofjustice/cloud-platform-terraform-monitoring/commit/87401ba23af26d379d8132cc09fd7cd212773ba1
- https://github.com/ministryofjustice/hmpps-env-configs/commit/7c1ba780a59f6a8682870318e70bf800a2d183a2
cloudformation:
- https://github.com/openrelayxyz/log-flume/commit/281f0cbcb1415cea8e13706c6c4304dfdca5c8e5
- https://github.com/ASFHyP3/asf-stac/commit/3a19e68cda5b174a655a699b8ac74eaa7c826159
- https://github.com/chef-boneyard/aws_native_chef_server/commit/f63839453506420064afb7350971c65be47d39a6
- https://github.com/openrelayxyz/ethercattle-deployment/commit/169a5f7292d7e15be885c33b345ce87477d8d227
- name: Expensive network resource
patternType: antipattern
description: Network resources like NAT gateways, elastic IP addresses and subnets tend to be expensive while not being strictly needed.
context: |
Due to their interdependence, the cost of certain types of networking resources
often adds up. For example, a developer may create multiple subnets, each having
its own NAT gateway, each of which in turn is assigned an IPv4 address. In other
cases, network resources are used which are not strictly required, e.g. load balancers.
solution: |
It is often possible to forego the use of the expensive resources entirely.
Solutions include subnets sharing a single NAT gateway, reducing the number of
subnets or removing the use of load balancers.
example: |
Remove resources that are not strictly required, or reduce the number of networking resources.
For example, the commonly used module terraform-aws-modules/vpc has an option to use a single
NAT gateway instead of creating one per subnet:
```terraform
module "vpc" {
source = "terraform-aws-modules/vpc"
# ...
enable_nat_gateway = true
single_nat_gateway = true
# ...
}
```
references:
- title: AWS VPC Terraform module
url: https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest
- title: Logically Isolated Virtual Network - Amazon VPC Pricing - Amazon Web Services
url: https://aws.amazon.com/vpc/pricing/
- title: Pricing | Cloud NAT | Google Cloud
url: https://cloud.google.com/nat/pricing
- title: All networking pricing | Virtual Private Cloud | Google Cloud
url: https://cloud.google.com/vpc/network-pricing#lb
occurrences:
terraform:
- https://github.com/stealthHat/k8s-terraform/commit/681a3f8b4942be495b3f2528fb9ee40d7a4eb08a
- https://github.com/thomastodon/jabujabu/commit/02210a3d3ba4a770c29623825b7f54f3ff33f3c7
- https://github.com/structurefall/jamulus-builder/commit/7190744187e0aed2df8ce84f2a944294d6d4fc5b
- https://github.com/joshuaspence/infrastructure/commit/d8e1979ea7954076f64ab4d3337b95f14a06fc31
- https://github.com/joshuaspence/infrastructure/commit/b9b9465314e3b5ada78340d06b90703136cdf3dc
- https://github.com/dexterchan/Terraform_Webserver/commit/af5af0b8e6a59a9c5879fde7eaaa86d694c2bfa2
- https://github.com/austin1237/clip-stitcher/commit/4eed76f9bfd4f93181660178ea689d98cd6d66d5
- https://github.com/IoT-Data-Marketplace/mp-infrastructure/commit/5afcf39a85fc972eb9bb3486e5dc8aeeba77d3ee
- https://github.com/InvictrixRom/website-infrastructure/commit/09e400452c1bde25fe393dd56c2fd608b84a18ac
- https://github.com/InvictrixRom/website-infrastructure/commit/44d66328ea4467d05d7fb8092631aff5afbd8b26
- https://github.com/pvandervelde/infrastructure.azure.core.network.hub/commit/0ecf0a154918bd9bdc0f53557bc1f80920da6b14
- https://github.com/Midas-Protocol/webtwo-infra/commit/25ed0319bf8099f0cc79eceba9104c73d9507e0d
- https://github.com/GBergeret/tf-vpc-module/commit/5e63c8390cb1001daf4ad74bb2926cc060c0de08
- https://github.com/GBergeret/micro-service-as-code/commit/46f76d50b8569f450ce909e04f3c5fa81b97737a
- https://github.com/ecsworkshop2018/expertalk-2018-ecs-workshop/commit/034908d914982eacea51b0ac61f2781069387412
- https://github.com/kitchen/personal-terraform/commit/fe1f2665b198308a438ec3d46b24843089df1a2a
- https://github.com/robertlupinek/rh-ex407/commit/0c679d7adfa5bf38d5c7846958f3508fc036b3e9
- https://github.com/skehlet/aws-batch-processing/commit/decdbce98d33cf2599aee554779ef5d8b5361d8f
- https://github.com/poseidon/terraform-aws-kubernetes/commit/ef0372d2684ef920c6e54cf8b9f80d87db90e636
- https://github.com/paperphyte/terraform-drone/commit/f62bfebb54530c9466cfdb21336794f24bcd63a7
- https://github.com/nisunisu/AWS_Blue_Green_Deployment/commit/d0741cddb32ed7970904693e3a697603fa21bbbb
- https://github.com/ryanlg/ryhino-public/commit/e51b9583b2df3154b5c82da361d411d65ed23bab
- https://github.com/masterpointio/terraform-aws-nuke-bomber/commit/33fbb76715ce6e35565b5f83f7ece0f9df37d282
- https://github.com/kinvolk-archives/lokomotive-kubernetes/commit/0c4d59db87b67d7c7a0a0f54677961a01ed8fbe4
- https://github.com/alhardy-net/terraform-core-aws-alhardynet-networking/commit/30be6aa1969e37d512153b558540fe714b635c4c
- https://github.com/alhardy-net/terraform-core-aws-alhardynet-networking/commit/f7b96f0b28008f8aed881cc211a5f3fdb3ae67ac
- https://github.com/alhardy-net/terraform-core-aws-alhardynet-networking/commit/b26b9e5d1b13602a4c192d9697a12df7770906b2
- https://github.com/imma/fogg-env/commit/7de45302cfa8a7dca88ab61b3021091cc480b495
- https://github.com/schubergphilis/terraform-aws-mcaf-matillion/commit/3b0e2fe42d660664c49d54ae8706de004a9b4176
- https://github.com/binbashar/le-tf-infra-aws/commit/a873443bd618ac9c14d12210ed4d12a11cc1f733
- https://github.com/binbashar/le-tf-infra-aws/commit/19c37f7e4e65d14e760f1ff8cf60cfd1e98c1a8b
- https://github.com/binbashar/le-tf-infra-aws/commit/bbfbd2484ace2819ffceac9155b995ab870ee3a3
- https://github.com/mads-hartmann/cloud.mads-hartmann.com/commit/667f5715c19534bfe5b01ad692979447412fd033
- https://github.com/opszero/terraform-aws-kubespot/commit/decc9706133af9978ada6cf58a1a63343468e8a0
- https://github.com/stSoftwareAU/sts-network/commit/bf59a4c995822ccfdeee64781345c12ebefa967f
- https://github.com/lean-delivery/terraform-module-aws-core/commit/25bbff736936b64a6120ef9608498830ecec33c0
- https://github.com/CheesecakeLabs/django-drf-boilerplate/commit/e4003aa3c51b789e2a2b5828768a7d0f34659209
- https://github.com/covidapihub/terraform-covidapihub/commit/3c5d381a20fbd287f1003271ee1ba64272325074
- https://github.com/simplygenius/atmos-recipes/commit/d27b48345a3827b8a10cb5388e42bd5cbea484bb
- https://github.com/hellupline/terraform-eks-cluster/commit/2bd01358b3a30d1680074f9bbd120da3a1456450
- https://github.com/tsub/ecs-sandbox/commit/8501fafbba186919c9e9b55a6a3fc72b4fb80909
- https://github.com/schubergphilis/terraform-aws-mcaf-vpc/commit/6ca41e5ad697201a1d225e5d15134e547ee6ced3
- https://github.com/davidcallen/parkrunpointsleague/commit/21627e4057b3446b511e4369ca366e297cfc87eb
- https://github.com/HarsheshShah08/HS-Terraform/commit/e0d0f044c54ebf491c122664d03e0cfe5d2b0823
- https://github.com/nagpach/terraform-example-aws-vpc/commit/35d26fd046185ae079e09fa6435c41ae685e679e
- https://github.com/appbricks/cloud-inceptor/commit/782a0a3c30cf83bcaeacc942789ccc903576fe8a
- https://github.com/firehawkvfx/firehawk-prototype-deprecated/commit/894fb1d80c7a3953b7a51d7acd5e9b942faced8f
- https://github.com/Xin00163/terraform/commit/f69ce3812180a20bbda69ff1432a1cd36342bc3b
- https://github.com/jeffawang/infrastructure/commit/9f610811aea8c523332e9dccad9bb0800b70691e
- https://github.com/stephengrier/my-infra/commit/e5742d6f4f93dd432c9d8d0a31493d43c45aaff1
- https://github.com/naftulikay/titan/commit/a0ea4fd84a409fe4ee853effa9f309a005b0efc1
- https://github.com/alphagov/govuk-aws/commit/9b54cd6e875843c3ecade45ce37e863357b6e0e9
- https://github.com/binbashar/le-tf-infra-aws/commit/8b1c39cf7e64610b4c17f5b2697a782f0ec99f7e
- https://github.com/robertdebock/terraform-aws-vault/commit/4ddd02182a1f210bb9f614fbba5ef11b4fcbe827
cloudformation:
- https://github.com/stackery/dotnet-framework-webapi/commit/6cabc6cab8331dccf87accc7176fd0d721e22ddb
- https://github.com/Jessinra/TriveryID-Skadi/commit/d91bc4e786a86f7c088413ac1f7ba701cb7e499f
- https://github.com/aws-samples/aws-rosettafold/commit/cb24c548c5871726ece3aa9880336b94967f40ec
- https://github.com/tomwetjens/boardgamefiesta/commit/9e832bb4deb429362e75fc8f26ca820a3981814e
- https://github.com/p-jackson/aws-app/commit/9ce4fe471b53818a98282865ae45585b81e8aba4
- https://github.com/Jessinra/TriveryID-Skadi/commit/d660670eee3c1ad00b82bb947ba5d764c8fe4ced
- https://github.com/jolexa/s3-staticsite-multiregion/commit/db022caa823d1723a8d94160307bcf37017bf5c8
- https://github.com/Jessinra/TriveryID-Skadi/commit/61a1e32bbcf538d6d3aa112207525bc7b55344e9
- https://github.com/aws-samples/amazon-sagemaker-secure-mlops/commit/da9ba03eed01847eed76e3ee6e44f8edd6930e5b
- https://github.com/dismantl/CaseHarvester/commit/c91470e55d9905d687f39a868f5474f6f4804f39
- name: Overprovisioned resources
patternType: antipattern
description: Resources like RAM, storage and CPU utilization are often overprovisioned even when lower values are acceptable.
context: |
In a similar way to overprovisioned instances, it is difficult to estimate
required limits for resources such as root storage upfront, leading developers
to overprovision them, in turn raising costs.
solution: Evaluate the resource requirements and lower the relevant values.
example: |
Shrink the root storage size of an instance to reduce storage costs:
```diff
@@ -2,6 +2,6 @@ resource "aws_instance" "example" {
# ...
root_block_device {
- volume_size = 20 # GB
+ volume_size = 15 # GB
}
}
```
references: []
occurrences:
terraform:
- https://github.com/thomastodon/jabujabu/commit/02210a3d3ba4a770c29623825b7f54f3ff33f3c7
- https://github.com/guilhermerenew/infra-cost/commit/ba858d94e29d03e3e81533df8cd8bc85b9f176f1
- https://github.com/chaspy/terraform-alibaba-isucon8/commit/53588dad5dd4c13903a6c582f74e1afe2671d33e
- https://github.com/dwp/dataworks-aws-data-egress/commit/14f065e5161fee14c286c34df7db9f5516ef9bb6
- https://github.com/akaron/kubeadm_aws/commit/2e2092ec94b27a4c3f0b9f4ee4d46a1983a72518
- https://github.com/robertdebock/terraform-azurerm-container-group/commit/c0d6578f1ebbdcc9cab091017259e4d596bfe8c9
- https://github.com/fdns/terraform-k8s/commit/f106917bb7b2d8d4428022bb119585bf9f35769c
- https://github.com/jackofallops/terraform-aws-mysql-cluster/commit/7b2a446b0915a3ad26093f8234f7493ff152138a
- https://github.com/alphagov/govwifi-terraform/commit/38d0a67cf70d46c26675ce60a7a647eef0f11e52
- https://github.com/pangeo-data/terraform-deploy/commit/f8163bd52bea3774e2f160cff0523c602e65d933
- https://github.com/eduardobaitello/terraform-eks/commit/c11fca6440a5000648f690e6282778fb4ec73309
- https://github.com/jshcmpbll/Cloud-Mac-KVM/commit/361885d22c0304cb44683f9b005f82ca5e269841
- https://github.com/kaz/kiritan.com/commit/1cd96c7f71e56629ffa07c38e12c4da19fcfc5f7
- https://github.com/dylanmtaylor/dylanmtaylor-terraform-aws/commit/44016d6a8e496b69308a81e88af8c9ef8b710ab3
- https://github.com/roysjosh/terraform-unifi/commit/da9e2869456610a0228cb14f850c6eccddbb15e0
- https://github.com/phillhocking/aws-ubuntu-irssi/commit/1532e0c298ec4f8d7d749a884f7c46f2a2cf53d3
- https://github.com/ministryofjustice/cloud-platform-terraform-monitoring/commit/87401ba23af26d379d8132cc09fd7cd212773ba1
cloudformation:
- https://github.com/chef-boneyard/aws_native_chef_server/commit/f63839453506420064afb7350971c65be47d39a6
- https://github.com/sjakthol/cfn-execute-change-set/commit/7aa1557a573a4d44acec840698e34f41efc29df0
- https://github.com/aodn/aws-wps/commit/f262a8b46e328c30a2c08f9c47aba722fb0e1dae
- https://github.com/rotiroti/alessandrina/commit/594d4705adedd07b298d87f8d812e38b11337311
- https://github.com/philipmw/homeontheroute-api/commit/4b108af1165d196af7634133400dc31b14b60abb
- https://github.com/MrMarvin/open-wow-drealmd/commit/0b23fe7bf08d4682835ca171d228380ec81a2fb5
- https://github.com/ASFHyP3/asf-stac/commit/3a19e68cda5b174a655a699b8ac74eaa7c826159
- https://github.com/S8Vega/academic-friends-api/commit/c4747679155f119a07284f5eee455eee5dd7c1a6
- https://github.com/conijnio/aws-security-posture/commit/ba00cfc56fd720277cf54d7987ea58c9c8d3402e
- https://github.com/aws-samples/amazon-transcribe-live-call-analytics/commit/3e90f725d46e4f0ef9d5fac52135e000e319fb55
- https://github.com/bencehornak/copilot-cli/commit/11e2a04ac294a9688f3145c21a8574dee94a0770
- https://github.com/PRX/Infrastructure/commit/7f535b407cc8039f9990ffa6eccf08146cfe8b79
- https://github.com/release-engineering/exodus-lambda/commit/b34df4436dc0a016dde9398b9b1a0b2099feeaaa
- https://github.com/GerritCodeReview/aws-gerrit/commit/6d870855767ffbf684822adeb5136d0788f8a7df
- https://github.com/sjakthol/cfn-execute-change-set/commit/85238260de6d17167ff8a084032ba74372d70321
- https://github.com/ktkiiski/broilerkit/commit/179258e1c38152d411c6da823b74e142d937f6cd
- https://github.com/YubicoLabs/WebAuthnKit/commit/809472cea5cc831c6662be2d6075f6b5bacde276
- https://github.com/aws-samples/route-53-application-recovery-controller/commit/918b45ca80ddd21f0de8dbdb87a39707ea5630c5
- https://github.com/ashley-evans/how-many-buzzwords/commit/265eb03ab39eca06feb21b5f1cb69eb8dcbf9f4c
- https://github.com/cyberark/conjur-ecs-deploy/commit/c115dbc288157656a2fc8c729f3432a6c8ac6783
- https://github.com/AtlasOfLivingAustralia/ala-tokens-portal/commit/7df62872fb0c6ed504ce6d87ea2ea76ee7e794d4
- https://github.com/Sage-Bionetworks/service-catalog-library/commit/44b30a7988a104e8a834ad1d1abc27ef8001fabc
- https://github.com/Saneri/event-signup/commit/869bf7060c744e32326a902c88d9521ccdd5b218
- https://github.com/craigmayhew/aws-transcribe-on-s3-upload/commit/1955b06a16586fcb21a4b1b5dc27bea00384a842
- https://github.com/wolfeidau/aws-billing-store/commit/9cac0ad2ee5ae1dc2d6dc7660ddb597109b15f95
- https://github.com/littermap/littermap-aws-backend/commit/aeade55a66feeee2b7306829d6c22e7000c6faa0
- name: AWS - Expensive DynamoDB
patternType: antipattern
description: |
AWS DynamoDB tables often use features that carry cost but are not required,
especially for infrequently accessed tables.
context: |
DynamoDB tables might use provisioned billing mode, have high (>1) read/write capacity,
or use global secondary indices. These features carry additional cost and are not always
required, especially for infrequently accessed tables.
solution: |
Switching to pay-per-request billing mode, reducing provisioned read/write capacity,
and removing global secondary indices are ways to cost-optimize DynamoDB tables.
example: |
Set billing mode to pay-per-request:
```terraform
resource "aws_dynamodb_table" "example_table" {
name = "HighScores"
billing_mode = "PAY_PER_REQUEST"
attribute {
name = "UserID"
type = "S"
}
attribute {
name = "Score"
type = "N"
}
}
```
references:
- title: 'Resource: aws_dynamodb_table (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table
- title: DynamoDB throughput capacity - Amazon DynamoDB
url: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/capacity-mode.html
- title: Using Global Secondary Indexes in DynamoDB - Amazon DynamoDB
url: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html
- title: Provisioned capacity mode - Amazon DynamoDB
url: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html
occurrences:
terraform:
- https://github.com/deptno/terraform-aws-modules/commit/49f447bdbb3cf23499e8194e78f852ea1e256d3a
- https://github.com/ONSdigital/eq-terraform-dynamodb/commit/40eb651a50d0dfd5cf047ef62c8a6259c1c66e02
- https://github.com/olliefr/aws-terraform-cloud1/commit/bf753832a519b0649f8d58d93aa643afe3f94fc7
- https://github.com/garylb2/terraform-example-patterns/commit/6de6d83d930bd9459e1cf8c311fa7b45c3f90987
- https://github.com/Arkoprabho/TerraformTutorial/commit/ba317d7e402f014589e230fad8c7384016211ba2
- https://github.com/jkstenzel95/jks.gameservers/commit/411ab992ba07e698cb08b56eb4cfc9d6e001d43f
- https://github.com/techservicesillinois/aws-enterprise-vpc/commit/0d21bea79e1936e2bdaee58bd6e328dd08e59b30
- https://github.com/austin1237/gifbot/commit/c11dabf1ea02c0e044c62448986bb3f9abdf3967
- https://github.com/servers-tf/infrastructure/commit/cc9e50a3864511f9fb9f871293e6a6e7e2719d2c
- https://github.com/jsoconno/aws-terraform-remote-state-infrastructure/commit/fed8be2748bc2286a6f9888d282d66763ba612ed
- https://github.com/ONSdigital/eq-terraform/commit/6eaf697bf9f111214a6d74ee3094e5784a57d1bb
- https://github.com/nikkiwritescode/flask-app-terraform-deployment/commit/af47bb6201f1dcc8264e60da429e4ff8d126e56c
- https://github.com/kperson/terraform-modules/commit/53bd2d84776f9ed7ae287fc59ed42f87bd7bbc4b
- https://github.com/kody-abe/terraform/commit/169c7768b0b1584945362c035a2b227d2f579466
- https://github.com/jenkins-x/terraform-aws-eks-jx/commit/cce6b14692fccd30c027851607a9526151d4c3d2
- https://github.com/telia-oss/terraform-aws-terraform-init/commit/e8c7b2eb22d08ddd1a1bb375cb6efa4165c9098f
- https://github.com/trajano/terraform-s3-backend/commit/f4b61c7bedae856439f01499de1ec9050b4c40fc
- https://github.com/poldi2015/chat-app/commit/cb45bf17da799afaa789206e3fcd39d9403e0567
- https://github.com/tesera/terraform-modules/commit/3cd4d7b55ac2003153fd0670151ab395ae182431
- https://github.com/MichaelDeCorte/TerraForm/commit/3799ee8b9677d02254eb6d6f50f3732df4c8374e
- https://github.com/TalkingFox/SignalWs/commit/935d9d683608b4d8a97ef6ccc2c8ab7c14eec0d0
- https://github.com/codequest-eu/terraform-modules/commit/ffe23d4c2cd78035bef0dfb261701e7ed8dd588d
- https://github.com/dgorbov/terraform-s3-backend-setup/commit/81f82740760a357a86b3a77f9ed400624edcb218
- https://github.com/sbogacz/terraform-aws-state-backend/commit/174486319f3b956807d56e5433880f9978884f93
- https://github.com/giuseppeborgese/terraform-locking-s3-state/commit/6b4e59e8b844417dc5c247bdef1b0adb8e2e7028
- https://github.com/Accurate0/infrastructure/commit/eef88fd3e61cf4b5e04682824e76df5348b60de5
- https://github.com/ministryofjustice/cloud-platform-environments/commit/0c1b4028575aeaabf7543c7357c4e26d610677c3
cloudformation:
- https://github.com/turnerlabs/antiope/commit/40a968167182170aa0827ae182bbf72e5e0fd84e
- https://github.com/guardian/mobile-purchases/commit/1c500f5f94de681b5ead3a6ceba208d3efcc790e
- https://github.com/govuk-one-login/txma-infra/commit/dc9567e61048e1bd6993e546c05bcf1a3ce3c3bb
- https://github.com/vladikk/elastic-event-store/commit/4db976b88850eb08a5a36e456312fba05bad42b6
- https://github.com/ruzickap/k8s-tf-eks-gitops/commit/639d0aecc85e4c8da9d538ccb3f28b8f3a9f2d9b
- https://github.com/guardian/mobile-save-for-later/commit/5e8c85b56c8dbe36bc6bf0522dcf947a98ebfc17
- https://github.com/pagopa/pn-radd-fsu/commit/9dd31982fe3540a4ce4b97073f1fd0b97ccff425
- https://github.com/ahamlinman/randomizer/commit/431334e19f28f2da629749345d142c23a2f54888
- https://github.com/aws-cloudformation/cfn-lint/commit/201b12733558c4d7f1ee84bda84fe1a756537265
- https://github.com/Checkmarx/kics/commit/2cba29eeecb8afe156623bc7a6a9712d3fc90433
- https://github.com/turnerlabs/antiope/commit/d2b306008cc3f18af8be8ba1e52ec5ec0a82128b
- https://github.com/casual-simulation/casualos/commit/5140af5e7ab7fae1665352f27dbda887df09f0a2
- https://github.com/koekalenteri/koekalenteri/commit/232becdb8b348bb397ecdf3aeed57da85fcdf710
- https://github.com/stelligent/cfn_nag/commit/f2f5b5a7ef68602ad3d358a77ae76fa22f7c15df
- https://github.com/guardian/mobile-save-for-later/commit/b0afd91084a5ede68e2a53f2a7624f6cc9c27c64
- https://github.com/pagopa/pn-ec/commit/6d201e8153c83c8fe177914ea6ddf097c79d218a
- https://github.com/burke1791/march-madness-calcutta-api/commit/7db4e6e7b67039dc44cae29d3cee1e354a6a6875
- https://github.com/aws-samples/accelerated-data-lake/commit/18bff2bf18a685c840db98d95bd7b7cec03e0e4b
- https://github.com/gnelabs/EpithyRoboTrader/commit/cd6ff50175c1cebc7f448316db46c76e1f357a57
- https://github.com/shinesolutions/aem-aws-stack-builder/commit/7781d14d29b7e19a8b1e2dd46f4904a3041019f4
- https://github.com/guardian/mobile-save-for-later/commit/4ab126e31b1fa32bc3dbb3750bf6dee13de028ef
- https://github.com/caseconsulting/expense-app-api/commit/b2cc61e36477d2b16f0585edba815dbb8d5481c5
- https://github.com/AlisProject/serverless-application/commit/8e8617e3d1054a467945b126496ab05051f656e2
- https://github.com/DEFRA/rod-licensing/commit/5b84cfd0ee4c3d0450be8bf0760507e1655d7992
- https://github.com/NHSDigital/eps-prescription-status-update-api/commit/fe59672a63be823be78f01583ecc8fbce276d6e1
- https://github.com/aws-samples/serverless-rss-filtered-feed-gen/commit/98257ddc10439d60dd87228c0d0c0a5f6bd181ff
- https://github.com/guardian/mobile-n10n/commit/9292c2b30a75a14bb1f662e5bba20468cb3afab3
- https://github.com/gsx95/georgguessr/commit/efbf4b21260a2fea57be2edeea93db0d3c655be1
- https://github.com/biometrixtech/PreProcessing/commit/a37aacc476440312c9da9b20a769600ed082e2d3
- https://github.com/UBC-CIC/EC2Ensemble/commit/ac41affcd965cfe84b69fa05f5072ac17dc6e77c
- https://github.com/pagopa/pn-mandate/commit/f8b0624eff443ac5684d76dfe1059f1a99349128
- https://github.com/guardian/mobile-save-for-later/commit/0607c55b14336854960d81f9af27936b60fe747d
- https://github.com/lambci/lambci/commit/b439c25f32f82f7e318ac8acca6b1ab4796c3397
- https://github.com/viralemergence/pharos-api/commit/6ca33b173c2e9d159a65cdfd740c232e30732ee1
- https://github.com/biometrixtech/infrastructure/commit/fab4c34416dd4fec75df954c171f34d026435bb8
- https://github.com/caseconsulting/expense-app-api/commit/e585d93e5ce516cf2dcb9b87620cd6fa7b81b68e
- https://github.com/govuk-one-login/onboarding-self-service-experience/commit/9678897bfb3ce80012fa9567b1b9a3853e565539
- https://github.com/biometrixtech/Users/commit/14652ad70bf20207cb13b340aedcf66f5012dda9
- https://github.com/ASFHyP3/hyp3/commit/aa801f4d73de736cceb0dbdd2f1646f354ca7b05
- https://github.com/em-shea/vocab/commit/83904598b0023c83d5dff3cca3f242034b7b119a
- https://github.com/troyready/onica-create-2019-serverless/commit/5d80f28767a7b42a7cad730c672272a197d1e364
- https://github.com/aws-samples/aws-serverless-workshop-innovator-island/commit/4b992a5c2701dd79274cab30031f4acd5e130107
- name: Expensive monitoring
patternType: antipattern
description: Monitoring solutions are expensive and might not be needed.
context: |
Cloud providers offer ways to monitor deployed infrastructure and
collect metrics and logs. These solutions add cost for e.g. health checks
and log storage, and the benefits may not outweigh this cost.
solution: Removing monitoring or logs for noncritical infrastructure is an effective way to save cost.
example: |
Remove a Route 53 health check for a private Plex instance to save costs:
```diff
@@ -1,6 +0,0 @@
-resource "aws_route53_health_check" "example" {
- fqdn = "plex.example.com"
- port = 443
- request_interval = "30"
- failure_threshold = "5"
-}
```
references:
- title: 'Resource: aws_route53_health_check (Terraform)'
url: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_health_check
- title: CloudWatch billing and cost - Amazon CloudWatch
url: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_billing.html
- title: Amazon Route 53 pricing - Amazon Web Services
url: https://aws.amazon.com/route53/pricing/
- title: Google Cloud Observability pricing
url: https://cloud.google.com/stackdriver/pricing#monitoring-pricing-summary
- title: Cost Optimization in Azure Monitor
url: https://learn.microsoft.com/en-us/azure/azure-monitor/best-practices-cost
occurrences:
terraform:
- https://github.com/Eximchain/terraform-aws-quorum-cluster/commit/6a56f400f7de3f4d5cef646d92e3f848608031c1
- https://github.com/Accurate0/infrastructure/commit/06889e08148d258f329118d43734f8c8dcff994e
- https://github.com/cloudspout/Gefjun/commit/665692a86bb65ddfa6c001f296c76c17288e2944
- https://github.com/terraform-google-modules/terraform-example-foundation/commit/8391f1bd4322fec04fda7509b537c5f66cddbbd9
- https://github.com/tdooner/flynn/commit/a9ea9d09727825f9a047e70d94caf73c99e6b2a8
- https://github.com/elliotpryde/personal-infrastructure/commit/772c5ad20818738b09d01cd70ca3de80cbf66dcb
- https://github.com/elliotpryde/personal-infrastructure/commit/7c4205cd130c5463d7f39aa6f281e198c143d0d9
- https://github.com/alghanmi/terraform-modules/commit/570d3d8440ed399ed8b30bffe1fd7a2adc197771
- https://github.com/thoughtbot/flightdeck/commit/c784bc0a3f747b66ab7cd01f23bbbdbad3bfe705
- https://github.com/chapas/tf-az-kubernetes/commit/bcc6e190b8f8a12b590089fb755c4f552f179ad0
- https://github.com/Accurate0/infrastructure/commit/bd63efe7cf8fd2d9ae3a1497c342f97a7d22a7f5
- https://github.com/rust-lang/simpleinfra/commit/05370cc8f9852987e20cf5c659e5249dd1f2181c
- https://github.com/binbashar/le-tf-infra-aws/commit/8b1c39cf7e64610b4c17f5b2697a782f0ec99f7e
- https://github.com/dfds/infrastructure-modules/commit/1c9c92d966c342d42ac5c915a7c01f6a98a38122
- https://github.com/matihost/monorepo/commit/6995c99e0561c29b6e8d0ff84d3b2504d1772fe8
- https://github.com/alphagov/govuk-infrastructure/commit/3386d7637c06f84cc3cc252f96d43e511cea428e
- https://github.com/alphagov/govuk-infrastructure/commit/6017d0be84adac6b90b46f3d0bc2376a7e9b8e85
cloudformation:
- https://github.com/lumigo-io/SAR-async-lambda-metrics/commit/c61571e630b0ee5428196969c1cb08a981f36b1c
- https://github.com/aldeka/jolly-roger/commit/2295bd9a939381d1d778b0e273700c54674f0db4
- https://github.com/brwyatt/smartthings_logging/commit/659a001727a43497bd8eaeae16ef507887af9034
- https://github.com/BoraxTheClean/aws-account-setup/commit/a24b6134aab8e2f74fd31eec2ad964636025acc7
- https://github.com/buildkite/elastic-ci-stack-for-aws/commit/5ceefeb51f51c6277348086fa39fda2b5f7c7553
- name: Cost Report
patternType: pattern
description: Cost report elements can be used to obtain information on the actual spendings over a period of time.
context: Given the complexity and scale of cloud computing projects, cost management might be overlooked and, in turn, lead to overspending.
solution: |
Major cloud providers offer cost reporting tools such as CUR buckets and lambda rules to collect and later visualize and analyze cost and
usage information. These tools enable cost tracking, allow programmers to gain insights into spending trends and might uncover cost-related issues
example: |
Add a monthly cost and usage report:
```diff
@@ -0,0 +1,24 @@ resource "cost_report" "example" {
+ AWSTemplateFormatVersion: '2010-09-09'
+ Description: 'Monthly Cost and Usage Report'
+ Parameters:
+ Bucket:
+ Type: String
+ Frequency:
+ Type: String
+ Default: "monthly"
+ AllowedValues:
+ - "monthly"
+ - "weekly"
+ - "hourly"
+ Resources:
+ MonthlyCostReport:
+ Type: "AWS::CUR::ReportDefinition"
+ Properties:
+ ReportName: !Sub "${AWS::StackName}"
+ ReportVersioning: False
+ TimeUnit: !Ref Frequency
+ Compression: "parquet"
+ Format: "parquet"
+ S3Region: !Ref primaryRegion
+ S3Prefix: !Ref Frequency
+ S3Bucket: !Ref Bucket
}
```
references:
- title: AWS Cost and Usage reports
url: https://aws.amazon.com/aws-cost-management/aws-cost-and-usage-reporting/
- title: AWS Cost Explorer
url: https://aws.amazon.com/aws-cost-management/aws-cost-explorer/
- title: Automated AWS Cost Reports
url: https://community.aws/content/2dKeNrWeMj8E1Yh6CXITS7Hg0cU/automate-aws-cost-report-using-eventbridge-lambda-cost-explorer-api?lang=en
- title: Cost Explorer vs Cost and Usage Reports
url: https://www.cloudzero.com/blog/cost-explorer-vs-cost-and-usage-report/
- title: Usage of Cost and Usage reports
url: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_CUR.html
occurrences:
terraform:
- https://github.com/binbashar/le-tf-infra-aws/commit/6184fd167b796d7ef8f04aea5962c0b2774c6371
- https://github.com/nsbno/terraform-aws-cost-alarm/commit/be2ef8e22c98140716d46500520e04fcb132cbd1
- https://github.com/nsbno/terraform-aws-cost-alarm/commit/1b8cec87b9bc03a93c22a300ee87e6fca8b12052
- https://github.com/KiaraGrouwstra/sentia-data-engineering-assignment/commit/7e5c997c23683a707aa384b6a07801210b1839b8
- https://github.com/cloudposse/terraform-spacelift-cloud-infrastructure-automation/commit/f1ad51c1ee8b96d7a60c23dbe49ccd5a3439a3dc
- https://github.com/gravicore/terraform-gravicore-modules/commit/2a9045f5caca2824fbe4035020ffaf72d724d179
cloudformation:
- https://github.com/zaro0508/organizations-infra/commit/f62de2443313d2f963f6101663417d16e696a0a9
- https://github.com/karthickcse05/aws-cost-explorer/commit/2750d8c79ab56e69ce2d06e08f02390ae7ba4183
- https://github.com/nao1215/rainbow/commit/3696053a44e2168d5fbda669b793f587ba0dc5bc
- https://github.com/felixrichardt/cloud-carbon-footprint/commit/f5f4150801b64b5baaa68ecbddccd336a3013d32
- https://github.com/unity-sds/unity-on-demand-cloudformation/commit/f44a61cf6205b431887efa5b3154c446eff0b0ca
- https://github.com/deathandmayhem/jolly-roger/commit/9fed42ab84b2c091748bffc30b2bc29b79f39a41
- https://github.com/aws-samples/aws-serverless-notifier-plugins/commit/935d60da5f246433742fd66496d5caa84a4c80d2
- https://github.com/RLOpenCatalyst/rgdeploy/commit/6f703b23d684a2c8d22ea5c7fd03b07729af3ee5
- https://github.com/aexeagmbh/cfn-lint-rules/commit/d9c9900e765462f6eed75304add98e309e87d1f9
- https://github.com/zaro0508/organizations-infra/commit/ec619370e7601e750d87cf893b85ec1efeab3c84
- https://github.com/PRX/Infrastructure/commit/d5a4f859294e126a3c72582d324672e8ba8b7c32
- https://github.com/superwerker/superwerker/commit/21ef2d4c44d4a881c45e99ace627f1c66fa8d141
- https://github.com/Igor-Ivaniuk/codepipeline-terraform/commit/ccf92afdd32085d36509002274739ae894aeda84
- https://github.com/DEFRA/rod-licensing/commit/5b84cfd0ee4c3d0450be8bf0760507e1655d7992
- https://github.com/cunningham-lab/neurocaas/commit/d4717c0e763233f734ccd991947c201a1438e1d8
- https://github.com/PRX/Infrastructure/commit/d9d90ba0a708d9c37c5f0fde020a3e094f67cf59
- https://github.com/unity-sds/unity-ads-deployment/commit/047c2f09689885552903413632b4d67953e4b0c0
- https://github.com/RLOpenCatalyst/rgdeploy/commit/14daa90b0f32287eb693967b98dcdc6cafde798b
- https://github.com/zaro0508/organizations-infra/commit/1a35ef50ccf357c8319a60fd1c95bd6fd412517b
- https://github.com/APTrust/preservation-services/commit/5b14b81b437bed62952979398a6b014f8458c356
- https://github.com/PRX/Infrastructure/commit/579ba639b31f26998b6817c9558f1db2c6cfd028
- https://github.com/tomwwright/littleorange/commit/4bca2634fd0e7b2f90111838924d68decd71eef5
- https://github.com/neerajtiwar/aws-cost-exporter/commit/3586e5305da734b089406fb6771a00ebb3d9ffb3
- https://github.com/brucehoff/organizations-infra/commit/dae052c3e1ecf6a47da23af60952a30dc0d3d0b6
- https://github.com/cunningham-lab/neurocaas/commit/202fa9ce32b269b54bfa68299dfe8a4c85c3080d
- https://github.com/unity-sds/unity-ads-deployment/commit/d1cdba60f76965d0ba35896b403a4751a3aaaa1f
- https://github.com/awslabs/cid-framework/commit/a9e275cdc1bb0b38fbd2a172b6a61534c869ecd2
- https://github.com/zaro0508/organizations-infra/commit/544592f6cab75e460d3146b55ad892e1e0542aca
- https://github.com/Sage-Bionetworks-IT/organizations-infra/commit/7afa4947fb7321ea8e9d84ac162cc7c3a70075ee
- https://github.com/zaro0508/organizations-infra/commit/beb53a2eeb616963179238a6d11c06b003539e95
- https://github.com/awslabs/aws-well-architected-labs/commit/f82be3a26e356335ebf8feab6971f278215f335c
- https://github.com/primeharbor/aws-account-automation/commit/18f1e36b061d631dca72b494661a21dc37594148
- https://github.com/aws/aws-parallelcluster-ui/commit/4a1d71623f565fd1dfe40d3231201e18ec32893c
- https://github.com/zaro0508/sandbox-infra/commit/189eb2e198dbc4cef0feae56ee4e3d1e342b314c
- https://github.com/SedaiEngineering/sedai-onboarding/commit/545e2ecaeeb535a7a044c98f69a6c71d954ded5b
- https://github.com/PRX/Infrastructure/commit/9961cdbffd8f0750ba4acfa15b3c8f1dc13d4e85
- https://github.com/Sage-Bionetworks/aws-infra/commit/73d9fd5d784eecf01a175ff33152a6ccba5f37ba
- https://github.com/Sage-Bionetworks-IT/organizations-infra/commit/12a3eb189de5a21a09dbf02b46c522e5d5e76190
- name: Preventative Template
patternType: pattern
description: Templates with predefined configurations that enforce cost-optimizing methods can proactively manage and reduce future expenses.
context: Retroactively implementing cost-saving changes can be inefficient and expensive, especially in the context of large systems.
solution: Preventative templates can be designed to prioritize cost-optimizations and lead to a proactive enforcement of good practices further on.
example: |
Adds a full file with a template for cost optimization that is not yet implemented within the project:
```diff
@@ -0,0 +1,111 @@ resource "template" "example" {
+ AWSTemplateFormatVersion: 2010-09-09
+ Description: Template for reducing costs on PN
+
+ Parameters:
+ StopEc2FuctionTagName:
+ Type: String
+ Default: 'tostop'
+ Description: Name of EC2 Tag that will be stopped
+
+ StopEc2FuctionTagValue:
+ Type: String
+ Default: 'true'
+ Description: Value of EC2 Tag that will be stopped
+
+ StopEc2FuctionTagNameCronExpression:
+ Type: String
+ Default: 'cron(0 22 * * ? *)'
+ Description: Cron expression when ec2 stop
# ...
}
```
references:
- title: AWS Budget template
url: https://docs.aws.amazon.com/cost-management/latest/userguide/budget-templates.html
occurrences:
cloudformation:
- https://github.com/adrian83/aws-samples/commit/2aedc136fc1ed5e6b794268e5aeba6b625fcf903
- https://github.com/awslabs/aws-well-architected-labs/commit/f82be3a26e356335ebf8feab6971f278215f335c
- https://github.com/primeharbor/aws-account-automation/commit/18f1e36b061d631dca72b494661a21dc37594148
- https://github.com/sjakthol/aws-account-infra/commit/ab4424e4f8a34f47d8511c982b84bfce7086d59a
- https://github.com/PRX/Infrastructure/commit/9961cdbffd8f0750ba4acfa15b3c8f1dc13d4e85
- https://github.com/Sage-Bionetworks/aws-infra/commit/73d9fd5d784eecf01a175ff33152a6ccba5f37ba
- https://github.com/kennyk65/aws-teaching-demos/commit/5dfc77f0065462480ee1eec85927cee7c7d57a77
- https://github.com/karthickcse05/aws-cost-explorer/commit/2750d8c79ab56e69ce2d06e08f02390ae7ba4183
- https://github.com/felixrichardt/cloud-carbon-footprint/commit/f5f4150801b64b5baaa68ecbddccd336a3013d32
- https://github.com/aws-samples/aws-serverless-notifier-plugins/commit/935d60da5f246433742fd66496d5caa84a4c80d2
- https://github.com/danielgblanco/diaspora-aws/commit/e758a12feaaa4b56c18068c1f4426442b9840c79
- https://github.com/superwerker/superwerker/commit/21ef2d4c44d4a881c45e99ace627f1c66fa8d141
- https://github.com/pagopa/pn-infra/commit/4845feae578f173eaa75ffbf03f049a7fe735552
- https://github.com/PRX/Infrastructure/commit/d9d90ba0a708d9c37c5f0fde020a3e094f67cf59
- https://github.com/Nonagon-Media/acg/commit/dfc8a883d178a78c5233e1d790cc5f8209f93b6b
- https://github.com/xhiroga/til/commit/9d549cbcad7886c8861c5f69fb8f3d549e2f7664
- https://github.com/christoferson/aws-cloudformation/commit/fbde48d9640dbff07552bb4f7357b44b16ad9675
- https://github.com/btkrausen/aws/commit/84932c34ae2a4967809a76e58a67b41f89e43dde
- https://github.com/PRX/Infrastructure/commit/579ba639b31f26998b6817c9558f1db2c6cfd028
- https://github.com/tomwwright/littleorange/commit/4bca2634fd0e7b2f90111838924d68decd71eef5
- https://github.com/nathanpeck/ecs-patterns-vitepress/commit/58f54cb34506995953cf59a380ad6670be93ed50
- https://github.com/Nxtra/aws-billing-alarms/commit/0a15638e30d0e0a55ee76c3402a67ff91c50339e
- https://github.com/awslabs/cid-framework/commit/a9e275cdc1bb0b38fbd2a172b6a61534c869ecd2