-
Notifications
You must be signed in to change notification settings - Fork 22
/
pipeline.yml
1840 lines (1771 loc) · 74.2 KB
/
pipeline.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
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
groups:
- name: terraform
jobs:
- apply-concourse-production
- apply-concourse-staging
- apply-development
- apply-dns
- apply-ecr
- apply-external-development
- apply-external-production
- apply-external-staging
- apply-production
- apply-staging
- apply-tooling
- plan-concourse-production
- plan-concourse-staging
- plan-development
- plan-dns
- plan-ecr
- plan-external-development
- plan-external-production
- plan-external-staging
- plan-production
- plan-staging
- plan-tooling
- pull-status-check
- webacl-test-development
- webacl-test-production
- webacl-test-staging
- name: certs
jobs:
- acme-certificate-dev-pages
- acme-certificate-dev-wildcard-pages
- acme-certificate-dev-wildcard-pages-sites
- acme-certificate-development
- acme-certificate-pages
- acme-certificate-production
- acme-certificate-production-apps
- acme-certificate-staging
- acme-certificate-staging-pages
- acme-certificate-staging-pages
- acme-certificate-staging-wildcard-pages
- acme-certificate-staging-wildcard-pages-sites
- acme-certificate-dev-pages
- acme-certificate-dev-wildcard-pages
- acme-certificate-dev-wildcard-pages-sites
- acme-certificate-wildcard-pages
- acme-certificate-wildcard-pages-sites
- delete-old-certificates-dev
- delete-old-certificates-staging
- delete-old-certificates-production
jobs:
- name: pull-status-check
plan:
- get: general-task
- get: pull-request
version: every
trigger: true
- in_parallel:
steps:
- put: pull-request
params:
path: pull-request
status: pending
context: format-terraform
- put: pull-request
params:
path: pull-request
status: pending
context: validate-terraform
- in_parallel:
steps:
- task: format-terraform
image: general-task
config:
platform: linux
inputs:
- name: pull-request
params:
run:
dir: pull-request
path: ci/scripts/terraform_fmt.sh
on_success:
put: pull-request
params:
path: pull-request
status: success
context: format-terraform
on_failure:
put: pull-request
params:
path: pull-request
status: failure
context: format-terraform
- task: validate-terraform
image: general-task
config:
platform: linux
inputs:
- name: pull-request
params:
run:
path: pull-request/validate.sh
on_success:
put: pull-request
params:
path: pull-request
status: success
context: validate-terraform
on_failure:
put: pull-request
params:
path: pull-request
status: failure
context: validate-terraform
- name: plan-external-development
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- task: terraform-plan-external-development
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &external-development-params
TERRAFORM_ACTION: plan
STACK_NAME: external-development
TEMPLATE_SUBDIR: terraform/stacks/external
S3_TFSTATE_BUCKET: ((aws_external_s3_tfstate_bucket))
AWS_ACCESS_KEY_ID: ((aws_external_access_key_id))
AWS_SECRET_ACCESS_KEY: ((aws_external_secret_access_key))
AWS_DEFAULT_REGION: ((aws_external_region))
TF_VAR_stack_description: development
TF_VAR_aws_default_region: ((aws_external_region))
TF_VAR_cdn_broker_hosted_zone: ((cdn_broker_hosted_zone_development))
TF_VAR_lets_encrypt_hosted_zone: ((lets_encrypt_hosted_zone_development))
TF_VAR_external_domain_broker_hosted_zone: ((external_domain_broker_hosted_zone_development))
TF_VAR_external_domain_waf_rate_limit_count_threshold: ((external_domain_waf_rate_limit_count_threshold))
TF_VAR_external_domain_waf_rate_limit_challenge_threshold: ((external_domain_waf_rate_limit_challenge_threshold))
TF_VAR_sns_cg_platform_notifications_email: ((development_sns_cg_platform_notifications_email))
TF_VAR_sns_cg_platform_slack_notifications_email: ((development_sns_cg_platform_slack_notifications_email))
TF_VAR_terraform_state_bucket: ((aws_external_s3_tfstate_bucket))
- ¬ify-slack
put: slack
params:
text_file: terraform-state/message.txt
text: |
:terraform: $BUILD_JOB_NAME needs review
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: apply-external-development
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-external-development]
- task: terraform-apply-external-development
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *external-development-params
TERRAFORM_ACTION: apply
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-external-development
params:
file: terraform-yaml/state.yml
- name: plan-external-staging
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- task: terraform-plan-external-staging
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &external-staging-params
TERRAFORM_ACTION: plan
STACK_NAME: external-staging
TEMPLATE_SUBDIR: terraform/stacks/external
S3_TFSTATE_BUCKET: ((aws_external_s3_tfstate_bucket))
AWS_ACCESS_KEY_ID: ((aws_external_access_key_id))
AWS_SECRET_ACCESS_KEY: ((aws_external_secret_access_key))
AWS_DEFAULT_REGION: ((aws_external_region))
TF_VAR_stack_description: staging
TF_VAR_aws_default_region: ((aws_external_region))
TF_VAR_cdn_broker_hosted_zone: ((cdn_broker_hosted_zone_staging))
TF_VAR_lets_encrypt_hosted_zone: ((lets_encrypt_hosted_zone_staging))
TF_VAR_external_domain_broker_hosted_zone: ((external_domain_broker_hosted_zone_staging))
TF_VAR_external_domain_waf_rate_limit_count_threshold: ((external_domain_waf_rate_limit_count_threshold))
TF_VAR_external_domain_waf_rate_limit_challenge_threshold: ((external_domain_waf_rate_limit_challenge_threshold))
TF_VAR_sns_cg_platform_notifications_email: ((staging_sns_cg_platform_notifications_email))
TF_VAR_sns_cg_platform_slack_notifications_email: ((staging_sns_cg_platform_slack_notifications_email))
TF_VAR_terraform_state_bucket: ((aws_external_s3_tfstate_bucket))
- ¬ify-slack
put: slack
params:
text_file: terraform-state/message.txt
text: |
:terraform: $BUILD_JOB_NAME needs review
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: apply-external-staging
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-external-staging]
- task: terraform-apply-external-staging
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *external-staging-params
TERRAFORM_ACTION: apply
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-external-staging
params:
file: terraform-yaml/state.yml
- name: plan-external-production
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- task: terraform-plan-external-production
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &external-production-params
TERRAFORM_ACTION: plan
STACK_NAME: external-production
TEMPLATE_SUBDIR: terraform/stacks/external
S3_TFSTATE_BUCKET: ((aws_external_s3_tfstate_bucket))
AWS_ACCESS_KEY_ID: ((aws_external_access_key_id))
AWS_SECRET_ACCESS_KEY: ((aws_external_secret_access_key))
AWS_DEFAULT_REGION: ((aws_external_region))
TF_VAR_stack_description: production
TF_VAR_aws_default_region: ((aws_external_region))
TF_VAR_cdn_broker_hosted_zone: ((cdn_broker_hosted_zone_production))
TF_VAR_lets_encrypt_hosted_zone: ((lets_encrypt_hosted_zone_production))
TF_VAR_external_domain_broker_hosted_zone: ((external_domain_broker_hosted_zone_production))
TF_VAR_external_domain_waf_rate_limit_count_threshold: ((external_domain_waf_rate_limit_count_threshold))
TF_VAR_external_domain_waf_rate_limit_challenge_threshold: ((external_domain_waf_rate_limit_challenge_threshold))
TF_VAR_sns_cg_platform_notifications_email: ((production_sns_cg_platform_notifications_email))
TF_VAR_sns_cg_platform_slack_notifications_email: ((production_sns_cg_platform_slack_notifications_email))
TF_VAR_terraform_state_bucket: ((aws_external_s3_tfstate_bucket))
- *notify-slack
- name: apply-external-production
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-external-production]
- task: terraform-apply-external-production
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *external-production-params
TERRAFORM_ACTION: apply
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-external-production
params:
file: terraform-yaml/state.yml
- name: plan-dns
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- task: plan-dns
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &dns-params
TERRAFORM_ACTION: plan
STACK_NAME: dns
TEMPLATE_SUBDIR: terraform/stacks/dns
S3_TFSTATE_BUCKET: ((aws_external_s3_tfstate_bucket))
TF_VAR_aws_access_key: ((aws_external_access_key_id))
TF_VAR_aws_secret_key: ((aws_external_secret_access_key))
TF_VAR_aws_region: ((aws_external_region))
TF_VAR_remote_state_bucket: ((aws_s3_tfstate_bucket))
TF_VAR_remote_state_region: ((aws_default_region))
TF_VAR_tooling_stack_name: tooling
TF_VAR_production_stack_name: production
TF_VAR_staging_stack_name: staging
TF_VAR_development_stack_name: development
- *notify-slack
- name: apply-dns
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-dns]
- task: terraform-apply-dns
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *dns-params
TERRAFORM_ACTION: apply
- name: plan-tooling
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- task: terraform-plan-tooling
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &tooling-params
TERRAFORM_ACTION: plan
STACK_NAME: tooling
TEMPLATE_SUBDIR: terraform/stacks/tooling
S3_TFSTATE_BUCKET: ((aws_s3_tfstate_bucket))
AWS_DEFAULT_REGION: ((aws_default_region))
TF_VAR_aws_default_region: ((aws_default_region))
TF_VAR_rds_password: ((tooling_rds_password))
TF_VAR_bosh_default_ssh_public_key: ((tooling_ssh_key))
# Enable for database upgrades:
#TF_VAR_rds_apply_immediately: "true"
#TF_VAR_rds_allow_major_version_upgrade: "true"
TF_VAR_credhub_rds_password: ((tooling_credhub_rds_password))
TF_VAR_concourse_prod_rds_password: ((concourse_prod_rds_password))
TF_VAR_concourse_prod_pages_rds_password: ((concourse_prod_pages_rds_password))
TF_VAR_concourse_staging_rds_password: ((concourse_staging_rds_password))
TF_VAR_credhub_prod_rds_password: ((credhub_prod_rds_password))
TF_VAR_credhub_staging_rds_password: ((credhub_staging_rds_password))
TF_VAR_opsuaa_rds_password: ((opsuaa_rds_password))
TF_VAR_opslogin_hostname: opslogin.fr.cloud.gov
TF_VAR_remote_state_bucket: ((aws_s3_tfstate_bucket))
TF_VAR_cloudtrail_bucket: ((aws_s3_cloudtrail_bucket))
TF_VAR_vpc_cidr: ((tooling_vpc_cidr))
TF_VAR_smtp_ingress_cidr_blocks: '["((development_private_cidr_1))", "((development_private_cidr_2))","((staging_private_cidr_1))", "((staging_private_cidr_2))", "((production_private_cidr_1))", "((production_private_cidr_2))"]'
TF_VAR_restricted_ingress_web_cidrs: ((tooling_restricted_ingress_web_cidrs))
TF_VAR_restricted_ingress_web_ipv6_cidrs: ((tooling_restricted_ingress_web_ipv6_cidrs))
TF_VAR_blobstore_bucket_name: bosh-tooling-blobstore
TF_VAR_concourse_production_hosts: '["ci.fr.cloud.gov"]'
TF_VAR_concourse_production_pages_hosts: '["ci-pages.fr.cloud.gov"]'
TF_VAR_concourse_staging_hosts: '["ci.fr-stage.cloud.gov"]'
TF_VAR_credhub_production_hosts: '["credhub.fr.cloud.gov"]'
TF_VAR_credhub_staging_hosts: '["credhub.fr-stage.cloud.gov"]'
TF_VAR_monitoring_production_hosts: '["prometheus.fr.cloud.gov", "alertmanager.fr.cloud.gov", "grafana.fr.cloud.gov"]'
TF_VAR_monitoring_staging_hosts: '["prometheus.fr-stage.cloud.gov", "alertmanager.fr-stage.cloud.gov", "grafana.fr-stage.cloud.gov"]'
TF_VAR_nessus_hosts: '["nessus.fr.cloud.gov"]'
TF_VAR_wildcard_staging_certificate_name_prefix: star.fr-stage.cloud.gov
TF_VAR_wildcard_production_certificate_name_prefix: star.fr.cloud.gov
TF_VAR_concourse_varz_bucket: ((concourse_varz_bucket))
TF_VAR_doomsday_oidc_client: ((tooling_doomsday_oidc_client))
TF_VAR_doomsday_oidc_client_secret: ((tooling_doomsday_oidc_client_secret))
TF_VAR_nessus_oidc_client: ((tooling_nessus_oidc_client))
TF_VAR_nessus_oidc_client_secret: ((tooling_nessus_oidc_client_secret))
TF_VAR_payer_account_id: ((payer_account_id))
TF_VAR_s3_gateway_policy_accounts: ((tooling_s3_gateway_policy_accounts))
TF_VAR_waf_drop_logs_label: ((waf_drop_logs_label))
TF_VAR_waf_drop_logs_hostnames: ((waf_drop_logs_hostnames))
TF_VAR_defectdojo_staging_rds_password: ((tooling_defectdojo_staging_rds_password))
TF_VAR_defectdojo_staging_hosts: '["defectdojo.fr-stage.cloud.gov"]'
TF_VAR_defectdojo_staging_oidc_client: ((tooling_defectdojo_staging_oidc_client))
TF_VAR_defectdojo_staging_oidc_client_secret: ((tooling_defectdojo_staging_oidc_client_secret))
TF_VAR_rds_db_engine_version_bosh: "15.7"
TF_VAR_rds_parameter_group_family_bosh: "postgres15"
TF_VAR_rds_db_engine_version_bosh_credhub: "15.7"
TF_VAR_rds_parameter_group_family_bosh_credhub: "postgres15"
TF_VAR_rds_db_engine_version_credhub_staging: "15.7"
TF_VAR_rds_parameter_group_family_credhub_staging: "postgres15"
TF_VAR_rds_db_engine_version_credhub_production: "15.7"
TF_VAR_rds_parameter_group_family_credhub_production: "postgres15"
TF_VAR_rds_db_engine_version_concourse_staging: "15.7"
TF_VAR_rds_parameter_group_family_concourse_staging: "postgres15"
TF_VAR_rds_db_engine_version_concourse_production: "15.7"
TF_VAR_rds_parameter_group_family_concourse_production: "postgres15"
TF_VAR_rds_db_engine_version_opsuaa: "16.3"
TF_VAR_rds_parameter_group_family_opsuaa: "postgres16"
TF_VAR_aws_lb_listener_ssl_policy: "ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04"
- *notify-slack
- name: apply-tooling
plan:
- in_parallel:
- get: general-task
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-tooling]
- task: terraform-apply-tooling
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *tooling-params
TERRAFORM_ACTION: apply
- in_parallel:
- task: init-bosh-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-bosh-db.sh
- task: init-opsuaa-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-opsuaa-db.sh
- do:
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-tooling
params:
file: terraform-yaml/state.yml
- name: plan-development
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
resource: cg-provision-repo-development
trigger: true
- get: plan-timer
trigger: true
- get: check-s3-cidr-ranges
trigger: true
- task: terraform-plan-development
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &development-params
TERRAFORM_ACTION: plan
STACK_NAME: development
TEMPLATE_SUBDIR: terraform/stacks/main
S3_TFSTATE_BUCKET: ((aws_s3_tfstate_bucket))
AWS_DEFAULT_REGION: ((aws_default_region))
TF_VAR_assume_arn: ((development_assume_arn))
TF_VAR_parent_assume_arn: ((development_parent_assume_arn))
TF_VAR_parent_stack_name: ((development_parent_stack_name))
TF_VAR_bosh_default_ssh_public_key: ((development_ssh_key))
TF_VAR_stack_description: development
TF_VAR_force_restricted_network: "yes"
TF_VAR_include_tcp_routes: ((development_include_tcp_routes))
# Do not copy the pattern below. You should not need separate variables
# for staging/prod. Instead, use ${var.stack_name} in your .tf and get
# IDs from `data` resources.
TF_VAR_rds_password: ((development_rds_password))
TF_VAR_rds_db_size: ((development_rds_db_size))
# Enable for database upgrades:
#TF_VAR_rds_apply_immediately: "true"
#TF_VAR_rds_allow_major_version_upgrade: "true"
TF_VAR_rds_multi_az: "false"
TF_VAR_remote_state_bucket: ((aws_s3_tfstate_bucket))
TF_VAR_vpc_cidr: ((development_vpc_cidr))
TF_VAR_rds_db_engine_version: "15.7"
TF_VAR_rds_parameter_group_family: "postgres15"
TF_VAR_rds_db_engine_version_cf: "16.3"
TF_VAR_rds_parameter_group_family_cf: "postgres16"
TF_VAR_cf_rds_password: ((development_cf_rds_password))
TF_VAR_cf_as_rds_instance_type: ((development_cf_as_rds_instance_type))
TF_VAR_credhub_rds_password: ((development_credhub_rds_password))
TF_VAR_rds_db_engine_version_bosh_credhub: "15.7"
TF_VAR_rds_parameter_group_family_bosh_credhub: "postgres15"
TF_VAR_restricted_ingress_web_cidrs: ((development_restricted_ingress_web_cidrs))
TF_VAR_restricted_ingress_web_ipv6_cidrs: ((development_restricted_ingress_web_ipv6_cidrs))
TF_VAR_wildcard_certificate_name_prefix: star.dev.us-gov-west-1.aws-us-gov.cloud.gov
TF_VAR_wildcard_apps_certificate_name_prefix: star.dev.us-gov-west-1.aws-us-gov.cloud.gov
TF_VAR_bucket_prefix: development-cg
TF_VAR_blobstore_bucket_name: bosh-development-blobstore
TF_VAR_upstream_blobstore_bucket_name: bosh-tooling-blobstore
TF_VAR_admin_hosts: '["admin.dev.us-gov-west-1.aws-us-gov.cloud.gov"]'
TF_VAR_shibboleth_hosts: '["idp.dev.us-gov-west-1.aws-us-gov.cloud.gov"]'
TF_VAR_platform_kibana_hosts: '["logs-platform.dev.us-gov-west-1.aws-us-gov.cloud.gov"]'
TF_VAR_domains_broker_alb_count: "2"
TF_VAR_domains_broker_rds_username: ((development_domains_broker_rds_username))
TF_VAR_domains_broker_rds_password: ((development_domains_broker_rds_password))
TF_VAR_pages_cert_patterns: "[]"
TF_VAR_waf_regular_expressions: ((development_waf_regular_expressions))
TF_VAR_waf_drop_logs_hosts_regular_expressions: ((development_waf_drop_logs_hosts_regular_expressions))
TF_VAR_s3_gateway_policy_accounts: ((development_s3_gateway_policy_accounts))
TF_VAR_sns_cg_platform_notifications_email: ((development_sns_cg_platform_notifications_email))
TF_VAR_sns_cg_platform_slack_notifications_email: ((development_sns_cg_platform_slack_notifications_email))
TF_VAR_scope_down_known_bad_inputs_not_match_origin_search_string: ((development_scope_down_known_bad_inputs_not_match_origin_search_string))
TF_VAR_scope_down_known_bad_inputs_not_match_uri_path_regex_string: ((development_scope_down_known_bad_inputs_not_match_uri_path_regex_string))
TF_VAR_waf_drop_logs_label: ((waf_drop_logs_label))
TF_VAR_waf_drop_logs_hostnames: ((waf_drop_logs_hostnames))
TF_VAR_logstash_hosts: ((development_logstash_hosts))
TF_VAR_gsa_ip_range_ip_set_arn: ((gsa_ip_range_ip_set_arn))
TF_VAR_malicious_ja3_fingerprint_ids: ((malicious_ja3_fingerprint_ids))
TF_VAR_api_data_gov_hosts_regex_pattern_arn: ((api_data_gov_hosts_regex_pattern_arn))
TF_VAR_customer_whitelist_ip_ranges_set_arn: ((customer_whitelist_ip_ranges_set_arn))
TF_VAR_customer_whitelist_source_ip_ranges_set_arn: ((customer_whitelist_source_ip_ranges_set_arn))
TF_VAR_internal_vpc_cidrs_set_arn: ((internal_vpc_cidrs_set_arn))
TF_VAR_cg_egress_ip_set_arn: ((cg_egress_ip_set_arn))
TF_VAR_cidr_blocks: ((cidr_blocks))
TF_VAR_domains_lbgroup_count: 2
TF_VAR_waf_regex_rules: "((development_waf_regex_rules))"
TF_VAR_aws_lb_listener_ssl_policy: "ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04"
TF_VAR_bosh_blobstore_sse: "aws:kms"
- *notify-slack
- name: apply-development
plan:
- in_parallel:
- get: general-task
- get: pipeline-tasks
- get: cg-provision-repo
resource: cg-provision-repo-development
passed: [plan-development]
- task: terraform-apply-development
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *development-params
TERRAFORM_ACTION: apply
- in_parallel:
- do:
- task: init-bosh-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-bosh-db.sh
- task: init-cf-db
image: general-task
config:
platform: linux
image_resource:
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-cf-db.sh
- do:
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-development
params:
file: terraform-yaml/state.yml
- name: webacl-test-development
plan:
- in_parallel:
- get: general-task
- get: cg-provision-repo
resource: cg-provision-repo-development
passed: [apply-development]
trigger: true
- get: waf-test-files
resource: waf-tests-development
trigger: true
- task: test-waf-rules
image: general-task
file: cg-provision-repo/ci/waf-tests/test-waf-rules.yml
params:
WAF_TEST_APP_URL: ((development_waf_test_app_url))
on_failure:
put: slack
params:
text: |
:x: WAF Rules Test Development FAILED
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: WAF Rules Test Development PASSED
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: plan-staging
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- get: check-s3-cidr-ranges
trigger: true
- task: terraform-plan-staging
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &staging-params
TERRAFORM_ACTION: plan
STACK_NAME: staging
TEMPLATE_SUBDIR: terraform/stacks/main
S3_TFSTATE_BUCKET: ((aws_s3_tfstate_bucket))
AWS_DEFAULT_REGION: ((aws_default_region))
TF_VAR_assume_arn: ((staging_assume_arn))
TF_VAR_parent_assume_arn: ((staging_parent_assume_arn))
TF_VAR_parent_stack_name: ((staging_parent_stack_name))
TF_VAR_bosh_default_ssh_public_key: ((staging_ssh_key))
TF_VAR_stack_description: staging
TF_VAR_force_restricted_network: "no"
TF_VAR_include_tcp_routes: ((staging_include_tcp_routes))
# Do not copy the pattern below. You should not need separate variables
# for staging/prod. Instead, use ${var.stack_name} in your .tf and get
# IDs from `data` resources.
TF_VAR_rds_password: ((staging_rds_password))
TF_VAR_rds_db_size: ((staging_rds_db_size))
# Enable for database upgrades:
#TF_VAR_rds_apply_immediately: "true"
#TF_VAR_rds_allow_major_version_upgrade: "true"
TF_VAR_rds_db_engine_version: "15.7"
TF_VAR_rds_parameter_group_family: "postgres15"
TF_VAR_rds_db_engine_version_cf: "16.3"
TF_VAR_rds_parameter_group_family_cf: "postgres16"
TF_VAR_credhub_rds_password: ((staging_credhub_rds_password))
TF_VAR_rds_db_engine_version_bosh_credhub: "15.7"
TF_VAR_rds_parameter_group_family_bosh_credhub: "postgres15"
TF_VAR_remote_state_bucket: ((aws_s3_tfstate_bucket))
TF_VAR_vpc_cidr: ((staging_vpc_cidr))
TF_VAR_cf_rds_password: ((staging_cf_rds_password))
TF_VAR_cf_as_rds_instance_type: ((staging_cf_as_rds_instance_type))
TF_VAR_restricted_ingress_web_cidrs: ((staging_restricted_ingress_web_cidrs))
TF_VAR_restricted_ingress_web_ipv6_cidrs: ((staging_restricted_ingress_web_ipv6_cidrs))
TF_VAR_wildcard_certificate_name_prefix: star.fr-stage.cloud.gov
TF_VAR_wildcard_apps_certificate_name_prefix: star.fr-stage.cloud.gov
TF_VAR_bucket_prefix: staging-cg
TF_VAR_blobstore_bucket_name: bosh-staging-blobstore
TF_VAR_upstream_blobstore_bucket_name: bosh-tooling-blobstore
TF_VAR_shibboleth_hosts: '["idp.fr-stage.cloud.gov"]'
TF_VAR_platform_kibana_hosts: '["logs-platform.fr-stage.cloud.gov"]'
TF_VAR_domains_broker_alb_count: "2"
TF_VAR_domains_broker_rds_username: ((staging_domains_broker_rds_username))
TF_VAR_domains_broker_rds_password: ((staging_domains_broker_rds_password))
TF_VAR_pages_cert_patterns: "[]"
TF_VAR_waf_regular_expressions: ((staging_waf_regular_expressions))
TF_VAR_waf_drop_logs_hosts_regular_expressions: ((staging_waf_drop_logs_hosts_regular_expressions))
TF_VAR_s3_gateway_policy_accounts: ((staging_s3_gateway_policy_accounts))
TF_VAR_sns_cg_platform_notifications_email: ((staging_sns_cg_platform_notifications_email))
TF_VAR_sns_cg_platform_slack_notifications_email: ((staging_sns_cg_platform_slack_notifications_email))
TF_VAR_scope_down_known_bad_inputs_not_match_origin_search_string: ((staging_scope_down_known_bad_inputs_not_match_origin_search_string))
TF_VAR_scope_down_known_bad_inputs_not_match_uri_path_regex_string: ((staging_scope_down_known_bad_inputs_not_match_uri_path_regex_string))
TF_VAR_waf_drop_logs_label: ((waf_drop_logs_label))
TF_VAR_waf_drop_logs_hostnames: ((waf_drop_logs_hostnames))
TF_VAR_logstash_hosts: ((staging_logstash_hosts))
TF_VAR_gsa_ip_range_ip_set_arn: ((gsa_ip_range_ip_set_arn))
TF_VAR_malicious_ja3_fingerprint_ids: ((malicious_ja3_fingerprint_ids))
TF_VAR_api_data_gov_hosts_regex_pattern_arn: ((api_data_gov_hosts_regex_pattern_arn))
TF_VAR_customer_whitelist_ip_ranges_set_arn: ((customer_whitelist_ip_ranges_set_arn))
TF_VAR_customer_whitelist_source_ip_ranges_set_arn: ((customer_whitelist_source_ip_ranges_set_arn))
TF_VAR_internal_vpc_cidrs_set_arn: ((internal_vpc_cidrs_set_arn))
TF_VAR_cg_egress_ip_set_arn: ((cg_egress_ip_set_arn))
TF_VAR_cidr_blocks: ((cidr_blocks))
TF_VAR_domains_lbgroup_count: 3
TF_VAR_waf_regex_rules: "((staging_waf_regex_rules))"
TF_VAR_aws_lb_listener_ssl_policy: "ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04"
- *notify-slack
- name: apply-staging
plan:
- in_parallel:
- get: general-task
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-staging]
- task: terraform-apply-staging
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *staging-params
TERRAFORM_ACTION: apply
- in_parallel:
- do:
- task: init-bosh-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-bosh-db.sh
- task: init-cf-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-cf-db.sh
- do:
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-staging
params:
file: terraform-yaml/state.yml
- name: webacl-test-staging
plan:
- in_parallel:
- get: general-task
- get: cg-provision-repo
resource: cg-provision-repo
passed: [apply-staging]
trigger: true
- get: waf-test-files
resource: waf-tests-staging
trigger: true
- task: test-waf-rules
image: general-task
file: cg-provision-repo/ci/waf-tests/test-waf-rules.yml
params:
WAF_TEST_APP_URL: ((staging_waf_test_app_url))
on_failure:
put: slack
params:
text: |
:x: WAF Rules Test Staging FAILED
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: WAF Rules Test Staging PASSED
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: plan-production
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- get: check-s3-cidr-ranges
trigger: true
- task: terraform-plan-production
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &production-params
TERRAFORM_ACTION: plan
STACK_NAME: production
TEMPLATE_SUBDIR: terraform/stacks/main
S3_TFSTATE_BUCKET: ((aws_s3_tfstate_bucket))
AWS_DEFAULT_REGION: ((aws_default_region))
TF_VAR_assume_arn: ((production_assume_arn))
TF_VAR_parent_assume_arn: ((production_parent_assume_arn))
TF_VAR_parent_stack_name: ((production_parent_stack_name))
TF_VAR_bosh_default_ssh_public_key: ((production_ssh_key))
TF_VAR_stack_description: production
TF_VAR_force_restricted_network: "no"
TF_VAR_include_tcp_routes: ((production_include_tcp_routes))
# Do not copy the pattern below. You should not need separate variables
# for staging/prod. Instead, use ${var.stack_name} in your .tf and get
# IDs from `data` resources.
TF_VAR_rds_db_engine_version: "15.7"
TF_VAR_rds_parameter_group_family: "postgres15"
TF_VAR_rds_password: ((production_rds_password))
TF_VAR_rds_db_size: ((production_rds_db_size))
# Enable for database upgrades:
#TF_VAR_rds_apply_immediately: "true"
#TF_VAR_rds_allow_major_version_upgrade: "true"
TF_VAR_credhub_rds_password: ((production_credhub_rds_password))
TF_VAR_rds_db_engine_version_bosh_credhub: "15.7"
TF_VAR_rds_parameter_group_family_bosh_credhub: "postgres15"
TF_VAR_remote_state_bucket: ((aws_s3_tfstate_bucket))
TF_VAR_vpc_cidr: ((production_vpc_cidr))
TF_VAR_cf_rds_password: ((production_cf_rds_password))
TF_VAR_cf_as_rds_instance_type: ((production_cf_as_rds_instance_type))
TF_VAR_rds_db_engine_version_cf: "16.3"
TF_VAR_rds_parameter_group_family_cf: "postgres16"
TF_VAR_restricted_ingress_web_cidrs: ((production_restricted_ingress_web_cidrs))
TF_VAR_restricted_ingress_web_ipv6_cidrs: ((production_restricted_ingress_web_ipv6_cidrs))
TF_VAR_wildcard_certificate_name_prefix: star.fr.cloud.gov
TF_VAR_wildcard_apps_certificate_name_prefix: star.app.cloud.gov
TF_VAR_bucket_prefix: cg
TF_VAR_blobstore_bucket_name: bosh-prod-blobstore
TF_VAR_upstream_blobstore_bucket_name: bosh-tooling-blobstore
TF_VAR_shibboleth_hosts: '["idp.fr.cloud.gov"]'
TF_VAR_platform_kibana_hosts: '["logs-platform.fr.cloud.gov"]'
TF_VAR_domains_broker_alb_count: "11"
TF_VAR_domains_broker_rds_username: ((production_domains_broker_rds_username))
TF_VAR_domains_broker_rds_password: ((production_domains_broker_rds_password))
TF_VAR_pages_cert_patterns: '["pages.cloud.gov","pages-staging.cloud.gov","pages-dev.cloud.gov"]'
TF_VAR_waf_regular_expressions: ((production_waf_regular_expressions))
TF_VAR_waf_drop_logs_hosts_regular_expressions: ((production_waf_drop_logs_hosts_regular_expressions))
TF_VAR_s3_gateway_policy_accounts: ((production_s3_gateway_policy_accounts))
TF_VAR_sns_cg_platform_notifications_email: ((production_sns_cg_platform_notifications_email))
TF_VAR_sns_cg_platform_slack_notifications_email: ((production_sns_cg_platform_slack_notifications_email))
TF_VAR_scope_down_known_bad_inputs_not_match_origin_search_string: ((production_scope_down_known_bad_inputs_not_match_origin_search_string))
TF_VAR_scope_down_known_bad_inputs_not_match_uri_path_regex_string: ((production_scope_down_known_bad_inputs_not_match_uri_path_regex_string))
TF_VAR_waf_drop_logs_label: ((waf_drop_logs_label))
TF_VAR_waf_drop_logs_hostnames: ((waf_drop_logs_hostnames))
TF_VAR_logstash_hosts: ((production_logstash_hosts))
TF_VAR_gsa_ip_range_ip_set_arn: ((gsa_ip_range_ip_set_arn))
TF_VAR_malicious_ja3_fingerprint_ids: ((malicious_ja3_fingerprint_ids))
TF_VAR_api_data_gov_hosts_regex_pattern_arn: ((api_data_gov_hosts_regex_pattern_arn))
TF_VAR_customer_whitelist_ip_ranges_set_arn: ((customer_whitelist_ip_ranges_set_arn))
TF_VAR_customer_whitelist_source_ip_ranges_set_arn: ((customer_whitelist_source_ip_ranges_set_arn))
TF_VAR_internal_vpc_cidrs_set_arn: ((internal_vpc_cidrs_set_arn))
TF_VAR_cg_egress_ip_set_arn: ((cg_egress_ip_set_arn))
TF_VAR_cidr_blocks: ((cidr_blocks))
TF_VAR_domains_lbgroup_count: 4
TF_VAR_waf_regex_rules: "((production_waf_regex_rules))"
TF_VAR_aws_lb_listener_ssl_policy: "ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04"
- *notify-slack
- name: apply-production
plan:
- in_parallel:
- get: general-task
- get: pipeline-tasks
- get: cg-provision-repo
passed: [plan-production]
- task: terraform-apply-production
tags: [iaas]
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params:
<<: *production-params
TERRAFORM_ACTION: apply
- in_parallel:
- do:
- task: init-bosh-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-bosh-db.sh
- task: init-cf-db
image: general-task
config:
platform: linux
inputs:
- name: cg-provision-repo
- name: terraform-state
params:
STATE_FILE_PATH: terraform-state/terraform.tfstate
run:
path: sh
args:
- -e
- -c
- cg-provision-repo/ci/scripts/update-cf-db.sh
- do:
- task: terraform-state-to-yaml
file: pipeline-tasks/terraform12-state-to-yaml.yml
params:
STATE_FILE: terraform.tfstate
- put: terraform-yaml-production
params:
file: terraform-yaml/state.yml
- name: webacl-test-production
plan:
- in_parallel:
- get: general-task
- get: cg-provision-repo
resource: cg-provision-repo
passed: [apply-production]
trigger: true
- get: waf-test-files
resource: waf-tests-production
trigger: true
- task: test-waf-rules
image: general-task
file: cg-provision-repo/ci/waf-tests/test-waf-rules.yml
params:
WAF_TEST_APP_URL: ((production_waf_test_app_url))
on_failure:
put: slack
params:
text: |
:x: WAF Rules Test Production FAILED
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: WAF Rules Test Production PASSED
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: plan-ecr
plan:
- in_parallel:
- get: pipeline-tasks
- get: cg-provision-repo
trigger: true
- get: plan-timer
trigger: true
- task: terraform-plan-ecr
file: pipeline-tasks/terraform-apply.yml
input_mapping: { terraform-templates: cg-provision-repo }
params: &tf-ecr
TERRAFORM_ACTION: plan
TEMPLATE_SUBDIR: terraform/stacks/ecr
STACK_NAME: ecr
S3_TFSTATE_BUCKET: ((ecr-tf-state-bucket))