-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCentOS7-NICE-DCV.yaml
2328 lines (2214 loc) · 74.7 KB
/
CentOS7-NICE-DCV.yaml
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
AWSTemplateFormatVersion: 2010-09-09
Description: CentOS 7 with DCV ( https://github.com/aws-samples/amazon-ec2-nice-dcv-samples ) (uksb-632il17651) (tag:CentOS7)
Transform: "AWS::LanguageExtensions"
Metadata:
License:
Description: |
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Subscribe from AWS Marketplace before launching ( https://aws.amazon.com/marketplace/pp/prodview-foff247vr2zfw ). Note that this OS has EOL (end of life) and is not supported
- Label:
default: EC2
Parameters:
- ec2Name
- ec2KeyPair
- imageId
- instanceType
- ec2TerminationProtection
- Label:
default: DCV
Parameters:
- sessionType
- listenPort
- Label:
default: Network
Parameters:
- vpcID
- subnetID
- displayPublicIP
- assignStaticIP
- Label:
default: Remote access
Parameters:
- ingressIPv4
- ingressIPv6
- allowSSHport
- installWebmin
- Label:
default: Web server
Parameters:
- enableCloudFront
- originType
- allowWebServerPorts
- Label:
default: EBS volume
Parameters:
- volumeSize
- volumeType
- Label:
default: Backup
Parameters:
- enableBackup
- scheduleExpression
- scheduleExpressionTimezone
- deleteAfterDays
- Label:
default: AWS Global Accelerator (AGA)
Parameters:
- enableAGA
- Label:
default: Others
Parameters:
- installDocker
- r53ZoneID
ParameterLabels:
ec2Name:
default: "EC2 instance name"
ec2KeyPair:
default: "Key pair"
imageId:
default: "CentOS 7 (x86_64) AMI ID"
instanceType:
default: "Instance type (x86_64)"
ec2TerminationProtection:
default: "Enable EC2 termination protection to prevent accidental deletion"
sessionType:
default: "DCV session type"
listenPort:
default: "TCP/UDP listen port"
vpcID:
default: "VPC with internet connectivity"
subnetID:
default: "Subnet with internet connectivity"
displayPublicIP:
default: "Display EC2 public IP in CloudFormation Outputs"
assignStaticIP:
default: "[Elastic IP] Associate static public IPv4 address"
ingressIPv4:
default: "Allowed source prefix (IPv4)"
ingressIPv6:
default: "Allowed source prefix (IPv6)"
allowSSHport:
default: "Allow SSH from network"
installWebmin:
default: "Install Webmin"
enableCloudFront:
default: "Create Amazon CloudFront distribution"
originType:
default: "CloudFront origin type"
allowWebServerPorts:
default: "Allow HTTP/HTTPS inbound to EC2 instance"
volumeSize:
default: "Volume size (GiB)"
volumeType:
default: "Volume type"
enableBackup:
default: "Backup EC2 instance"
scheduleExpression:
default: "CRON expression specifying when AWS Backup initiates a backup job"
scheduleExpressionTimezone:
default: "Timezone to set backup schedule"
deleteAfterDays:
default: "Number of days after creation that a recovery point (backup) is deleted"
enableAGA:
default: "Deploy AWS Global Accelerator"
installDocker:
default: "Install Docker"
r53ZoneID:
default: "Route 53 Zone ID access for Certbot Route 53 DNS plugin"
Parameters:
imageId:
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
Description: https://aws.amazon.com/marketplace/pp/prodview-foff247vr2zfw
Default: /aws/service/marketplace/prod-a77hqdkwpdk3o/latest
ec2Name:
Type: String
#Description: EC2 instance name
Default: CentOS 7
ec2KeyPair:
Type: AWS::EC2::KeyPair::KeyName
Description: https://console.aws.amazon.com/ec2/#KeyPairs
AllowedPattern: .+
ConstraintDescription: Select a key pair
instanceType:
Type: String
Description: https://console.aws.amazon.com/ec2/#InstanceTypes
AllowedPattern: "^[a-z\\-\\d\\.]+$"
ConstraintDescription: Specify valid EC2 instance type
Default: t3.medium
ec2TerminationProtection:
Type: String
Description: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingDisableAPITermination.html
Default: "Yes"
AllowedValues:
- "Yes"
- "No"
sessionType:
Type: String
Description: https://docs.aws.amazon.com/dcv/latest/adminguide/managing-sessions.html#managing-sessions-intro
AllowedValues:
- "virtual"
- "console"
Default: "virtual"
listenPort:
Type: Number
Description: https://docs.aws.amazon.com/dcv/latest/adminguide/manage-port-addr.html
MinValue: 1024
MaxValue: 65535
Default: 8443
vpcID:
Type: AWS::EC2::VPC::Id
Description: "https://console.aws.amazon.com/vpcconsole/home#vpcs:"
AllowedPattern: .+
ConstraintDescription: Select a VPC
subnetID:
Type: AWS::EC2::Subnet::Id
Description: "https://console.aws.amazon.com/vpcconsole/home#subnets:"
AllowedPattern: .+
ConstraintDescription: Select a Subnet
displayPublicIP:
Type: String
Description: Select No if EC2 has no public IP
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
assignStaticIP:
Type: String
Description: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
ingressIPv4:
Type: String
Description: e.g. 1.2.3.4/32, get your internet IPv4 address from https://checkip.amazonaws.com
AllowedPattern: "^\\d+\\.\\d+\\.\\d+\\.\\d+\\/\\d+$"
ConstraintDescription: Specify valid IPv4 prefix
Default: 0.0.0.0/0
ingressIPv6:
Type: String
Description: e.g. 1:2:3:4::/64, get your internet IPv6 address (if any) with tools such as https://ifconfig.co
AllowedPattern: .+
ConstraintDescription: Specify valid IPv6 prefix
Default: ::/0
allowSSHport:
Type: String
Description: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-ssh.html
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
installWebmin:
Type: String
Description: https://webmin.com/
AllowedValues:
- "Yes"
- "No"
Default: "No"
enableCloudFront:
Type: String
Description: https://docs.aws.amazon.com/cloudfront/
AllowedValues:
- "Yes"
- "No"
Default: "No"
originType:
Type: String
Description: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-vpc-origins.html
AllowedValues:
- "EC2"
- "VPC Origin"
Default: "EC2"
allowWebServerPorts:
Type: String
# Description: Allow HTTP/HTTPS inbound to EC2 instance
AllowedValues:
- "No"
- HTTP-and-HTTPS
- HTTP
- HTTPS
Default: "No"
volumeSize:
Type: Number
Description: https://docs.aws.amazon.com/ebs/latest/userguide/volume_constraints.html
MinValue: 10
MaxValue: 16384
Default: 25
volumeType:
Type: String
Description: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html
AllowedValues:
- gp3
- gp2
Default: gp3
enableBackup:
Type: String
Description: https://docs.aws.amazon.com/aws-backup/
AllowedValues:
- "Yes"
- "No"
Default: "No"
scheduleExpression:
Type: String
Description: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html
AllowedPattern: .+
Default: "cron(0 1 ? * * *)"
scheduleExpressionTimezone: # https://nodatime.org/TimeZones?version=2024a&format=json
Type: String
Description: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html#time-zones
AllowedValues:
- Africa/Abidjan
- Africa/Algiers
- Africa/Bissau
- Africa/Cairo
- Africa/Casablanca
- Africa/Ceuta
- Africa/El_Aaiun
- Africa/Johannesburg
- Africa/Juba
- Africa/Khartoum
- Africa/Lagos
- Africa/Maputo
- Africa/Monrovia
- Africa/Nairobi
- Africa/Ndjamena
- Africa/Sao_Tome
- Africa/Tripoli
- Africa/Tunis
- Africa/Windhoek
- America/Adak
- America/Anchorage
- America/Araguaina
- America/Argentina/Buenos_Aires
- America/Argentina/Catamarca
- America/Argentina/Cordoba
- America/Argentina/Jujuy
- America/Argentina/La_Rioja
- America/Argentina/Mendoza
- America/Argentina/Rio_Gallegos
- America/Argentina/Salta
- America/Argentina/San_Juan
- America/Argentina/San_Luis
- America/Argentina/Tucuman
- America/Argentina/Ushuaia
- America/Asuncion
- America/Bahia
- America/Bahia_Banderas
- America/Barbados
- America/Belem
- America/Belize
- America/Boa_Vista
- America/Bogota
- America/Boise
- America/Cambridge_Bay
- America/Campo_Grande
- America/Cancun
- America/Caracas
- America/Cayenne
- America/Chicago
- America/Chihuahua
- America/Ciudad_Juarez
- America/Costa_Rica
- America/Cuiaba
- America/Danmarkshavn
- America/Dawson
- America/Dawson_Creek
- America/Denver
- America/Detroit
- America/Edmonton
- America/Eirunepe
- America/El_Salvador
- America/Fort_Nelson
- America/Fortaleza
- America/Glace_Bay
- America/Goose_Bay
- America/Grand_Turk
- America/Guatemala
- America/Guayaquil
- America/Guyana
- America/Halifax
- America/Havana
- America/Hermosillo
- America/Indiana/Indianapolis
- America/Indiana/Knox
- America/Indiana/Marengo
- America/Indiana/Petersburg
- America/Indiana/Tell_City
- America/Indiana/Vevay
- America/Indiana/Vincennes
- America/Indiana/Winamac
- America/Inuvik
- America/Iqaluit
- America/Jamaica
- America/Juneau
- America/Kentucky/Louisville
- America/Kentucky/Monticello
- America/La_Paz
- America/Lima
- America/Los_Angeles
- America/Maceio
- America/Managua
- America/Manaus
- America/Martinique
- America/Matamoros
- America/Mazatlan
- America/Menominee
- America/Merida
- America/Metlakatla
- America/Mexico_City
- America/Miquelon
- America/Moncton
- America/Monterrey
- America/Montevideo
- America/New_York
- America/Nome
- America/Noronha
- America/North_Dakota/Beulah
- America/North_Dakota/Center
- America/North_Dakota/New_Salem
- America/Nuuk
- America/Ojinaga
- America/Panama
- America/Paramaribo
- America/Phoenix
- America/Port-au-Prince
- America/Porto_Velho
- America/Puerto_Rico
- America/Punta_Arenas
- America/Rankin_Inlet
- America/Recife
- America/Regina
- America/Resolute
- America/Rio_Branco
- America/Santarem
- America/Santiago
- America/Santo_Domingo
- America/Sao_Paulo
- America/Scoresbysund
- America/Sitka
- America/St_Johns
- America/Swift_Current
- America/Tegucigalpa
- America/Thule
- America/Tijuana
- America/Toronto
- America/Vancouver
- America/Whitehorse
- America/Winnipeg
- America/Yakutat
- Antarctica/Casey
- Antarctica/Davis
- Antarctica/Macquarie
- Antarctica/Mawson
- Antarctica/Palmer
- Antarctica/Rothera
- Antarctica/Troll
- Antarctica/Vostok
- Asia/Almaty
- Asia/Amman
- Asia/Anadyr
- Asia/Aqtau
- Asia/Aqtobe
- Asia/Ashgabat
- Asia/Atyrau
- Asia/Baghdad
- Asia/Baku
- Asia/Bangkok
- Asia/Barnaul
- Asia/Beirut
- Asia/Bishkek
- Asia/Chita
- Asia/Choibalsan
- Asia/Colombo
- Asia/Damascus
- Asia/Dhaka
- Asia/Dili
- Asia/Dubai
- Asia/Dushanbe
- Asia/Famagusta
- Asia/Gaza
- Asia/Hebron
- Asia/Ho_Chi_Minh
- Asia/Hong_Kong
- Asia/Hovd
- Asia/Irkutsk
- Asia/Jakarta
- Asia/Jayapura
- Asia/Jerusalem
- Asia/Kabul
- Asia/Kamchatka
- Asia/Karachi
- Asia/Kathmandu
- Asia/Khandyga
- Asia/Kolkata
- Asia/Krasnoyarsk
- Asia/Kuching
- Asia/Macau
- Asia/Magadan
- Asia/Makassar
- Asia/Manila
- Asia/Nicosia
- Asia/Novokuznetsk
- Asia/Novosibirsk
- Asia/Omsk
- Asia/Oral
- Asia/Pontianak
- Asia/Pyongyang
- Asia/Qatar
- Asia/Qostanay
- Asia/Qyzylorda
- Asia/Riyadh
- Asia/Sakhalin
- Asia/Samarkand
- Asia/Seoul
- Asia/Shanghai
- Asia/Singapore
- Asia/Srednekolymsk
- Asia/Taipei
- Asia/Tashkent
- Asia/Tbilisi
- Asia/Tehran
- Asia/Thimphu
- Asia/Tokyo
- Asia/Tomsk
- Asia/Ulaanbaatar
- Asia/Urumqi
- Asia/Ust-Nera
- Asia/Vladivostok
- Asia/Yakutsk
- Asia/Yangon
- Asia/Yekaterinburg
- Asia/Yerevan
- Atlantic/Azores
- Atlantic/Bermuda
- Atlantic/Canary
- Atlantic/Cape_Verde
- Atlantic/Faroe
- Atlantic/Madeira
- Atlantic/South_Georgia
- Atlantic/Stanley
- Australia/Adelaide
- Australia/Brisbane
- Australia/Broken_Hill
- Australia/Darwin
- Australia/Eucla
- Australia/Hobart
- Australia/Lindeman
- Australia/Lord_Howe
- Australia/Melbourne
- Australia/Perth
- Australia/Sydney
- CET
- CST6CDT
- EET
- EST
- EST5EDT
- Etc/GMT
- Etc/GMT+1
- Etc/GMT+10
- Etc/GMT+11
- Etc/GMT+12
- Etc/GMT+2
- Etc/GMT+3
- Etc/GMT+4
- Etc/GMT+5
- Etc/GMT+6
- Etc/GMT+7
- Etc/GMT+8
- Etc/GMT+9
- Etc/GMT-1
- Etc/GMT-10
- Etc/GMT-11
- Etc/GMT-12
- Etc/GMT-13
- Etc/GMT-14
- Etc/GMT-2
- Etc/GMT-3
- Etc/GMT-4
- Etc/GMT-5
- Etc/GMT-6
- Etc/GMT-7
- Etc/GMT-8
- Etc/GMT-9
- Etc/UTC
- Europe/Andorra
- Europe/Astrakhan
- Europe/Athens
- Europe/Belgrade
- Europe/Berlin
- Europe/Brussels
- Europe/Bucharest
- Europe/Budapest
- Europe/Chisinau
- Europe/Dublin
- Europe/Gibraltar
- Europe/Helsinki
- Europe/Istanbul
- Europe/Kaliningrad
- Europe/Kirov
- Europe/Kyiv
- Europe/Lisbon
- Europe/London
- Europe/Madrid
- Europe/Malta
- Europe/Minsk
- Europe/Moscow
- Europe/Paris
- Europe/Prague
- Europe/Riga
- Europe/Rome
- Europe/Samara
- Europe/Saratov
- Europe/Simferopol
- Europe/Sofia
- Europe/Tallinn
- Europe/Tirane
- Europe/Ulyanovsk
- Europe/Vienna
- Europe/Vilnius
- Europe/Volgograd
- Europe/Warsaw
- Europe/Zurich
- HST
- Indian/Chagos
- Indian/Maldives
- Indian/Mauritius
- MET
- MST
- MST7MDT
- PST8PDT
- Pacific/Apia
- Pacific/Auckland
- Pacific/Bougainville
- Pacific/Chatham
- Pacific/Easter
- Pacific/Efate
- Pacific/Fakaofo
- Pacific/Fiji
- Pacific/Galapagos
- Pacific/Gambier
- Pacific/Guadalcanal
- Pacific/Guam
- Pacific/Honolulu
- Pacific/Kanton
- Pacific/Kiritimati
- Pacific/Kosrae
- Pacific/Kwajalein
- Pacific/Marquesas
- Pacific/Nauru
- Pacific/Niue
- Pacific/Norfolk
- Pacific/Noumea
- Pacific/Pago_Pago
- Pacific/Palau
- Pacific/Pitcairn
- Pacific/Port_Moresby
- Pacific/Rarotonga
- Pacific/Tahiti
- Pacific/Tarawa
- Pacific/Tongatapu
- WET
Default: Etc/UTC
deleteAfterDays:
Type: Number
# Description: Number of days after creation that a recovery point (backup) is deleted
Default: 35
enableAGA:
Type: String
Description: https://docs.aws.amazon.com/global-accelerator/
AllowedValues:
- "Yes"
- "No"
Default: "No"
installDocker:
Type: String
Description: https://docs.docker.com/engine/
AllowedValues:
- "Yes"
- "No"
Default: "No"
r53ZoneID:
Type: String
Description: https://console.aws.amazon.com/route53/hostedzones https://certbot-dns-route53.readthedocs.io/
Default: ""
Conditions:
useElasticIP: !Equals [!Ref assignStaticIP, "Yes"]
displayPublicIP: !Equals [!Ref displayPublicIP, "Yes"]
enableProtection: !Equals [!Ref ec2TerminationProtection, "Yes"]
hasEIC:
!Not [
!Equals [
!FindInMap [
EICprefixMap,
!Ref AWS::Region,
IpPrefix,
DefaultValue: 127.0.0.1/32,
],
127.0.0.1/32,
],
]
createSgEIC: !And [!Condition hasEIC, !Condition displayPublicIP]
createSgHTTP:
!Or [
!Equals [!Ref allowWebServerPorts, HTTP],
!Equals [!Ref allowWebServerPorts, HTTP-and-HTTPS],
]
createSgHTTPS:
!Or [
!Equals [!Ref allowWebServerPorts, HTTPS],
!Equals [!Ref allowWebServerPorts, HTTP-and-HTTPS],
]
hasCFprefix:
!Not [
!Equals [
!FindInMap [
CFprefixMap,
!Ref AWS::Region,
PrefixList,
DefaultValue: pl-none,
],
pl-none,
],
]
createCFsgHTTP:
!And [
!Or [!Condition createSgHTTP, !Condition createCloudFront],
!Condition hasCFprefix,
]
createCFsgHTTPS:
!And [
!Or [!Condition createSgHTTPS, !Condition createCloudFront],
!Condition hasCFprefix,
]
createCloudFront: !Equals [!Ref enableCloudFront, "Yes"]
cfVPCOrigin:
!And [!Condition createCloudFront, !Equals [!Ref originType, "VPC Origin"]]
createSgSSH: !Equals [!Ref allowSSHport, "Yes"]
createBackup: !Equals [!Ref enableBackup, "Yes"]
installWebmin: !Equals [!Ref installWebmin, "Yes"]
hasR53Zone: !Not [!Equals [!Ref r53ZoneID, ""]]
createAGA: !Equals [!Ref enableAGA, "Yes"]
Mappings:
EICprefixMap: # EC2 instance connect: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-prerequisites.html#ec2-instance-connect-setup-security-group
af-south-1:
IpPrefix: 13.244.121.196/30
Ipv6Prefix: 2406:da11:700:3b00::/56
ap-east-1:
IpPrefix: 43.198.192.104/29
Ipv6Prefix: 2406:da1e:da1:3c00::/56
ap-northeast-1:
IpPrefix: 3.112.23.0/29
Ipv6Prefix: 2406:da14:1c18:2100::/56
ap-northeast-2:
IpPrefix: 13.209.1.56/29
Ipv6Prefix: 2406:da12:1e1:d900::/56
ap-northeast-3:
IpPrefix: 15.168.105.160/29
Ipv6Prefix: 2406:da16:856:a500::/56
ap-south-1:
IpPrefix: 13.233.177.0/29
Ipv6Prefix: 2406:da1a:74a:4b00::/56
ap-south-2:
IpPrefix: 18.60.252.248/29
Ipv6Prefix: 2406:da1b:d1d:8800::/56
ap-southeast-1:
IpPrefix: 3.0.5.32/29
Ipv6Prefix: 2406:da18:752:6600::/56
ap-southeast-2:
IpPrefix: 13.239.158.0/29
Ipv6Prefix: 2406:da1c:90e:4a00::/56
ap-southeast-3:
IpPrefix: 43.218.193.64/29
Ipv6Prefix: 2406:da19:14b:8c00::/56
ap-southeast-4:
IpPrefix: 16.50.248.80/29
Ipv6Prefix: 2406:da1f:b4f:4600::/56
ca-central-1:
IpPrefix: 35.183.92.176/29
Ipv6Prefix: 2600:1f11:ae3:700::/56
ca-west-1:
IpPrefix: 40.176.213.168/29
Ipv6Prefix: 2600:1f1a:4ff6:d500::/56
cn-north-1:
IpPrefix: 43.196.20.40/29
Ipv6Prefix: 2400:7fc0:86fd:e00::/56
cn-northwest-1:
IpPrefix: 43.192.155.8/29
Ipv6Prefix: 2404:c2c0:87aa:4800::/56
eu-central-1:
IpPrefix: 3.120.181.40/29
Ipv6Prefix: 2a05:d014:17a8:8b00::/56
eu-central-2:
IpPrefix: 16.63.77.8/29
Ipv6Prefix: 2a05:d019:1d6:2100::/56
eu-north-1:
IpPrefix: 13.48.4.200/30
Ipv6Prefix: 2a05:d016:494:f00::/56
eu-south-1:
IpPrefix: 15.161.135.164/30
Ipv6Prefix: 2a05:d01a:c03:4a00::/56
eu-south-2:
IpPrefix: 18.101.90.48/29
Ipv6Prefix: 2a05:d011:cbe:f700::/56
eu-west-1:
IpPrefix: 18.202.216.48/29
Ipv6Prefix: 2a05:d018:403:4e00::/56
eu-west-2:
IpPrefix: 3.8.37.24/29
Ipv6Prefix: 2a05:d01c:4ac:3100::/56
eu-west-3:
IpPrefix: 35.180.112.80/29
Ipv6Prefix: 2a05:d012:c9e:d600::/56
il-central-1:
IpPrefix: 51.16.183.224/29
Ipv6Prefix: 2a05:d025:451:7d00::/56
me-central-1:
IpPrefix: 3.29.147.40/29
Ipv6Prefix: 2406:da17:1db:b00::/56
me-south-1:
IpPrefix: 16.24.46.56/29
Ipv6Prefix: 2a05:d01e:27f:ac00::/56
sa-east-1:
IpPrefix: 18.228.70.32/29
Ipv6Prefix: 2600:1f1e:d1d:e700::/56
us-east-1:
IpPrefix: 18.206.107.24/29
Ipv6Prefix: 2600:1f18:6fe3:8c00::/56
us-east-2:
IpPrefix: 3.16.146.0/29
Ipv6Prefix: 2600:1f16:138f:cf00::/56
us-gov-east-1:
IpPrefix: 18.252.4.0/30
Ipv6Prefix: 2600:1f15:d63:bd00::/56
us-gov-west-1:
IpPrefix: 15.200.28.80/30
Ipv6Prefix: 2600:1f12:fa9:5100::/56
us-west-1:
IpPrefix: 13.52.6.112/29
Ipv6Prefix: 2600:1f1c:12d:e900::/56
us-west-2:
IpPrefix: 18.237.140.160/29
Ipv6Prefix: 2600:1f13:a0d:a700::/56
CFprefixMap: # aws ec2 describe-managed-prefix-lists --query "PrefixLists[?PrefixListName=='com.amazonaws.global.cloudfront.origin-facing']" --region <REGION>
af-south-1:
PrefixList: pl-c0aa4fa9
ap-east-1:
PrefixList: pl-14b2577d
ap-northeast-1:
PrefixList: pl-58a04531
ap-northeast-2:
PrefixList: pl-22a6434b
ap-northeast-3:
PrefixList: pl-31a14458
ap-south-1:
PrefixList: pl-9aa247f3
ap-south-2:
PrefixList: pl-0a25c3463226fcc61
ap-southeast-1:
PrefixList: pl-31a34658
ap-southeast-2:
PrefixList: pl-b8a742d1
ap-southeast-3:
PrefixList: pl-bca247d5
ap-southeast-4:
PrefixList: pl-0fb7e7cfe038ae0e9
ap-southeast-5:
PrefixList: pl-09076f83e90b139d0
ca-central-1:
PrefixList: pl-38a64351
ca-west-1:
PrefixList: pl-0530d4c590b35122b
eu-central-1:
PrefixList: pl-a3a144ca
eu-central-2:
PrefixList: pl-00b37293991dbe6a8
eu-north-1:
PrefixList: pl-fab65393
eu-south-1:
PrefixList: pl-1bbc5972
eu-south-2:
PrefixList: pl-052dcbe0f793f19da
eu-west-1:
PrefixList: pl-4fa04526
eu-west-2:
PrefixList: pl-93a247fa
eu-west-3:
PrefixList: pl-75b1541c
il-central-1:
PrefixList: pl-0dd89524416301988
me-central-1:
PrefixList: pl-05266a86378662c23
me-south-1:
PrefixList: pl-17b2577e
sa-east-1:
PrefixList: pl-5da64334
us-east-1:
PrefixList: pl-3b927c52
us-east-2:
PrefixList: pl-b6a144df
us-west-1:
PrefixList: pl-4ea04527
us-west-2:
PrefixList: pl-82a045eb
ConsoleUrl:
aws:
url: console.aws.amazon.com
aws-cn:
url: console.amazonaws.cn
aws-gov:
url: console.amazonaws-us-gov.com
Resources:
instanceIamRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service: [ec2.amazonaws.com]
Action: [sts:AssumeRole]
Path: /
Policies:
- PolicyName: dcvLicensing
PolicyDocument: # https://docs.aws.amazon.com/dcv/latest/adminguide/setting-up-license.html
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- s3:GetObject
Resource: !Sub arn:aws:s3:::dcv-license.${AWS::Region}/*
- !If
- hasR53Zone
- PolicyName: Route53CertbotAccess
PolicyDocument: # Certbot dns_route53 : https://certbot-dns-route53.readthedocs.io/en/stable/
Version: "2012-10-17"
Statement: # https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/specifying-rrset-conditions.html
- Effect: Allow
Action:
- route53:ListHostedZones
- route53:GetChange
Resource: "*"
- Effect: Allow
Action:
- route53:ChangeResourceRecordSets
Resource: !Sub arn:${AWS::Partition}:route53:::hostedzone/${r53ZoneID}
Condition:
IpAddress:
aws:SourceIp: 0.0.0.0/0
ForAllValues:StringEquals:
route53:ChangeResourceRecordSetsRecordTypes: [TXT]
ForAllValues:StringLike:
route53:ChangeResourceRecordSetsNormalizedRecordNames:
[_acme-challenge.*]
- !Ref AWS::NoValue
ManagedPolicyArns:
- !Sub "arn:${AWS::Partition}:iam::aws:policy/AmazonSSMManagedInstanceCore"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/CloudWatchAgentServerPolicy"
- !Sub "arn:${AWS::Partition}:iam::aws:policy/AWSXRayDaemonWriteAccess"
Tags:
- Key: StackName
Value: !Ref AWS::StackName
- Key: StackId
Value: !Ref AWS::StackId
- Key: GitHub
Value: https://github.com/aws-samples/amazon-ec2-nice-dcv-samples
instanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Path: /
Roles:
- !Ref instanceIamRole
securityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Allow inbound DCV and SSH
VpcId: !Ref vpcID
SecurityGroupIngress:
- !If
- installWebmin
- Description: Webmin (IPv4)
IpProtocol: tcp
FromPort: 10000
ToPort: 10000
CidrIp: !Ref ingressIPv4
- !Ref AWS::NoValue
- !If
- installWebmin
- Description: Webmin (IPv6)
IpProtocol: tcp
FromPort: 10000
ToPort: 10000
CidrIpv6: !Ref ingressIPv6
- !Ref AWS::NoValue
- !If
- createSgSSH
- Description: SSH (IPv4)
IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: !Ref ingressIPv4
- !Ref AWS::NoValue
- !If