Skip to content

Commit 720019f

Browse files
author
Ballantyne
committed
Revert "Removing CloudWatch Logs resource and adding support to define via parameters. Added support for C4 instances."
This reverts commit 0667ade.
1 parent 0617012 commit 720019f

File tree

1 file changed

+44
-108
lines changed

1 file changed

+44
-108
lines changed

cloudformation/cfncluster.cfn.json

Lines changed: 44 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
"c3.2xlarge",
1919
"c3.xlarge",
2020
"c3.large",
21-
"c4.8xlarge",
22-
"c4.4xlarge",
23-
"c4.2xlarge",
24-
"c4.xlarge",
25-
"c4.large",
2621
"r3.8xlarge",
2722
"r3.4xlarge",
2823
"r3.2xlarge",
@@ -57,11 +52,6 @@
5752
"c3.2xlarge",
5853
"c3.xlarge",
5954
"c3.large",
60-
"c4.8xlarge",
61-
"c4.4xlarge",
62-
"c4.2xlarge",
63-
"c4.xlarge",
64-
"c4.large",
6555
"r3.8xlarge",
6656
"r3.4xlarge",
6757
"r3.2xlarge",
@@ -340,16 +330,6 @@
340330
"Description" : "Additional VPC secuirty group to be added to instances. Defaults to NONE",
341331
"Type" : "String",
342332
"Default" : "NONE"
343-
},
344-
"CWLRegion" : {
345-
"Description" : "CloudWatch Logs region",
346-
"Type" : "String",
347-
"Default" : "NONE"
348-
},
349-
"CWLLogGroup" : {
350-
"Description" : "CloudWatch Logs LogGroup",
351-
"Type" : "String",
352-
"Default" : "NONE"
353333
}
354334
},
355335
"Conditions" : {
@@ -552,31 +532,17 @@
552532
]
553533
},
554534
"CloudWatchLogs" : {
555-
"Fn::And" : [
535+
"Fn::Equals" : [
556536
{
557-
"Fn::Not" : [
537+
"Fn::FindInMap" : [
538+
"AWSRegion2Capabilites",
558539
{
559-
"Fn::Equals" : [
560-
{
561-
"Ref" : "CWLRegion"
562-
},
563-
"NONE"
564-
]
565-
}
540+
"Ref" : "AWS::Region"
541+
},
542+
"cwl"
566543
]
567544
},
568-
{
569-
"Fn::Not" : [
570-
{
571-
"Fn::Equals" : [
572-
{
573-
"Ref" : "CWLLogGroup"
574-
},
575-
"NONE"
576-
]
577-
}
578-
]
579-
}
545+
"true"
580546
]
581547
},
582548
"AddAdditionalSG" : {
@@ -642,26 +608,6 @@
642608
"Arch" : "64HVM",
643609
"EBSOpt" : "False"
644610
},
645-
"c4.8xlarge" : {
646-
"Arch" : "64HVM",
647-
"EBSOpt" : "True"
648-
},
649-
"c4.4xlarge" : {
650-
"Arch" : "64HVM",
651-
"EBSOpt" : "True"
652-
},
653-
"c4.2xlarge" : {
654-
"Arch" : "64HVM",
655-
"EBSOpt" : "True"
656-
},
657-
"c4.xlarge" : {
658-
"Arch" : "64HVM",
659-
"EBSOpt" : "True"
660-
},
661-
"c4.large" : {
662-
"Arch" : "64HVM",
663-
"EBSOpt" : "True"
664-
},
665611
"r3.8xlarge" : {
666612
"Arch" : "64HVM",
667613
"EBSOpt" : "False"
@@ -755,42 +701,49 @@
755701
"centos6" : {
756702
"User" : "ec2-user"
757703
},
758-
"alinux" : {
759-
"User" : "ec2-user"
760-
},
761704
"ubuntu" : {
762705
"User" : "ubuntu"
763706
}
764707
},
765708
"AWSRegion2Capabilites" : {
766709
"eu-west-1" : {
710+
"cwl" : "true",
767711
"arn" : "aws"
768712
},
769713
"us-east-1" : {
714+
"cwl" : "true",
770715
"arn" : "aws"
771716
},
772717
"ap-northeast-1" : {
718+
"cwl" : "true",
773719
"arn" : "aws"
774720
},
775721
"us-west-2" : {
722+
"cwl" : "true",
776723
"arn" : "aws"
777724
},
778725
"sa-east-1" : {
726+
"cwl" : "false",
779727
"arn" : "aws"
780728
},
781729
"us-west-1" : {
730+
"cwl" : "false",
782731
"arn" : "aws"
783732
},
784733
"ap-southeast-1" : {
734+
"cwl" : "true",
785735
"arn" : "aws"
786736
},
787737
"ap-southeast-2" : {
738+
"cwl" : "true",
788739
"arn" : "aws"
789740
},
790741
"eu-central-1" : {
742+
"cwl" : "false",
791743
"arn" : "aws"
792744
},
793745
"us-gov-west-1" : {
746+
"cwl" : "false",
794747
"arn" : "aws-us-gov"
795748
}
796749
}
@@ -1208,18 +1161,20 @@
12081161
" || error_exit 'Failed to run cfn-init. If --norollback was specified, check /var/log/cfn-init.log and /var/log/cfncluster.log.'\n",
12091162
"cfn_cwl=",
12101163
{
1211-
"Fn::If" : [
1212-
"CloudWatchLogs",
1213-
"true",
1214-
"false"
1164+
"Fn::FindInMap" : [
1165+
"AWSRegion2Capabilites",
1166+
{
1167+
"Ref" : "AWS::Region"
1168+
},
1169+
"cwl"
12151170
]
12161171
},
12171172
"\n",
12181173
"if [ \"$cfn_cwl\" == \"true\" ]; then\n",
12191174
"# Setup CloudWatch Logs agent\n",
12201175
"python /root/awslogs-agent-setup.py -n -r ",
12211176
{
1222-
"Ref" : "CWLRegion"
1177+
"Ref" : "AWS::Region"
12231178
},
12241179
" -c /tmp/cwlogs/cfn-logs.conf || error_exit 'Failed to run CloudWatch Logs agent setup'\n",
12251180
"fi\n",
@@ -1313,25 +1268,16 @@
13131268
"file = /var/log/cloud-init.log\n",
13141269
"log_group_name = ",
13151270
{
1316-
"Ref" : "CWLLogGroup"
1271+
"Ref" : "CfnClusterLogs"
13171272
},
13181273
"\n",
13191274
"log_stream_name = {instance_id}/cloud-init.log\n",
13201275
"datetime_format = %d/%b/%Y:%H:%M:%S\n",
1321-
"[/var/log/cloud-init-output.log]\n",
1322-
"file = /var/log/cloud-init-output.log\n",
1323-
"log_group_name = ",
1324-
{
1325-
"Ref" : "CWLLogGroup"
1326-
},
1327-
"\n",
1328-
"log_stream_name = {instance_id}/cloud-init-output.log\n",
1329-
"datetime_format = %d/%b/%Y:%H:%M:%S\n",
13301276
"[/var/log/cfn-init.log]\n",
13311277
"file = /var/log/cfn-init.log\n",
13321278
"log_group_name = ",
13331279
{
1334-
"Ref" : "CWLLogGroup"
1280+
"Ref" : "CfnClusterLogs"
13351281
},
13361282
"\n",
13371283
"log_stream_name = {instance_id}/cfn-init.log\n",
@@ -1340,7 +1286,7 @@
13401286
"file = /var/log/cfn-wire.log\n",
13411287
"log_group_name = ",
13421288
{
1343-
"Ref" : "CWLLogGroup"
1289+
"Ref" : "CfnClusterLogs"
13441290
},
13451291
"\n",
13461292
"log_stream_name = {instance_id}/cfn-wire.log\n",
@@ -1410,11 +1356,6 @@
14101356
"Ref" : "EphemeralDir"
14111357
},
14121358
"\n",
1413-
"cfn_shared_dir=",
1414-
{
1415-
"Ref" : "SharedDir"
1416-
},
1417-
"\n",
14181359
"cfn_proxy=",
14191360
{
14201361
"Ref" : "ProxyServer"
@@ -1696,18 +1637,20 @@
16961637
" || error_exit 'Failed to run cfn-init'\n",
16971638
"cfn_cwl=",
16981639
{
1699-
"Fn::If" : [
1700-
"CloudWatchLogs",
1701-
"true",
1702-
"false"
1640+
"Fn::FindInMap" : [
1641+
"AWSRegion2Capabilites",
1642+
{
1643+
"Ref" : "AWS::Region"
1644+
},
1645+
"cwl"
17031646
]
17041647
},
17051648
"\n",
17061649
"if [ \"$cfn_cwl\" == \"true\" ]; then\n",
17071650
"# Setup CloudWatch Logs agent\n",
17081651
"python /root/awslogs-agent-setup.py -n -r ",
17091652
{
1710-
"Ref" : "CWLRegion"
1653+
"Ref" : "AWS::Region"
17111654
},
17121655
" -c /tmp/cwlogs/cfn-logs.conf || error_exit 'Failed to run CloudWatch Logs agent setup'\n",
17131656
"fi\n",
@@ -1829,11 +1772,6 @@
18291772
"Ref" : "EphemeralDir"
18301773
},
18311774
"\n",
1832-
"cfn_shared_dir=",
1833-
{
1834-
"Ref" : "SharedDir"
1835-
},
1836-
"\n",
18371775
"cfn_encrypted_ephemeral=",
18381776
{
18391777
"Ref" : "EncryptedEphemeral"
@@ -1908,25 +1846,16 @@
19081846
"file = /var/log/cloud-init.log\n",
19091847
"log_group_name = ",
19101848
{
1911-
"Ref" : "CWLLogGroup"
1849+
"Ref" : "CfnClusterLogs"
19121850
},
19131851
"\n",
19141852
"log_stream_name = {instance_id}/cloud-init.log\n",
19151853
"datetime_format = %d/%b/%Y:%H:%M:%S\n",
1916-
"[/var/log/cloud-init-output.log]\n",
1917-
"file = /var/log/cloud-init-output.log\n",
1918-
"log_group_name = ",
1919-
{
1920-
"Ref" : "CWLLogGroup"
1921-
},
1922-
"\n",
1923-
"log_stream_name = {instance_id}/cloud-init-output.log\n",
1924-
"datetime_format = %d/%b/%Y:%H:%M:%S\n",
19251854
"[/var/log/cfn-init.log]\n",
19261855
"file = /var/log/cfn-init.log\n",
19271856
"log_group_name = ",
19281857
{
1929-
"Ref" : "CWLLogGroup"
1858+
"Ref" : "CfnClusterLogs"
19301859
},
19311860
"\n",
19321861
"log_stream_name = {instance_id}/cfn-init.log\n",
@@ -1935,7 +1864,7 @@
19351864
"file = /var/log/cfn-wire.log\n",
19361865
"log_group_name = ",
19371866
{
1938-
"Ref" : "CWLLogGroup"
1867+
"Ref" : "CfnClusterLogs"
19391868
},
19401869
"\n",
19411870
"log_stream_name = {instance_id}/cfn-wire.log\n",
@@ -2274,6 +2203,13 @@
22742203
}
22752204
}
22762205
},
2206+
"CfnClusterLogs" : {
2207+
"Type" : "AWS::Logs::LogGroup",
2208+
"Properties" : {
2209+
"RetentionInDays" : 7
2210+
},
2211+
"Condition" : "CloudWatchLogs"
2212+
},
22772213
"AssosiateEIP" : {
22782214
"Type" : "AWS::EC2::EIPAssociation",
22792215
"Properties" : {

0 commit comments

Comments
 (0)