Skip to content

Commit a589da3

Browse files
authored
Put in fixes for ECS LogDriver configs (#3937)
1 parent 90485a1 commit a589da3

File tree

8 files changed

+241
-105
lines changed

8 files changed

+241
-105
lines changed

scripts/boto/update_schemas_from_boto.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
]
3030

3131
exceptions = {
32-
"ses": ["/definitions/EventDestination/properties/MatchingEventTypes/items"]
32+
"ses": ["/definitions/EventDestination/properties/MatchingEventTypes/items"],
33+
"ecs": ["/definitions/LogConfiguration/properties/LogDriver"],
3334
}
3435

3536

src/cfnlint/data/schemas/extensions/aws_ecs_taskdefinition/fargate_properties.json

+107-42
Original file line numberDiff line numberDiff line change
@@ -16,54 +16,119 @@
1616
]
1717
},
1818
"then": {
19-
"if": {
20-
"properties": {
21-
"Cpu": {
22-
"type": [
23-
"string",
24-
"integer"
19+
"allOf": [
20+
{
21+
"if": {
22+
"properties": {
23+
"NetworkMode": {
24+
"type": "string"
25+
}
26+
},
27+
"required": [
28+
"NetworkMode"
29+
]
30+
},
31+
"required": [
32+
"NetworkMode"
33+
],
34+
"then": {
35+
"properties": {
36+
"NetworkMode": {
37+
"enum": [
38+
"awsvpc"
39+
],
40+
"type": "string"
41+
}
42+
},
43+
"required": [
44+
"NetworkMode"
2545
]
2646
}
2747
},
28-
"required": [
29-
"Cpu"
30-
]
31-
},
32-
"not": {
33-
"required": [
34-
"PlacementConstraints"
35-
]
36-
},
37-
"required": [
38-
"Cpu",
39-
"Memory"
40-
],
41-
"then": {
42-
"properties": {
43-
"Cpu": {
44-
"else": {
45-
"pattern": "^(\\.25|\\.5|1|2|4|8|16)\\s*(?i)vCpu$"
46-
},
47-
"if": {
48-
"pattern": "^\\d+$",
49-
"type": [
50-
"integer",
51-
"string"
52-
]
48+
{
49+
"properties": {
50+
"ContainerDefinitions": {
51+
"items": {
52+
"properties": {
53+
"LogConfiguration": {
54+
"if": {
55+
"properties": {
56+
"LogDriver": {
57+
"type": "string"
58+
}
59+
},
60+
"required": [
61+
"LogDriver"
62+
]
63+
},
64+
"then": {
65+
"properties": {
66+
"LogDriver": {
67+
"enum": [
68+
"awslogs",
69+
"splunk",
70+
"awsfirelens"
71+
]
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
}
80+
},
81+
{
82+
"if": {
83+
"properties": {
84+
"Cpu": {
85+
"type": [
86+
"string",
87+
"integer"
88+
]
89+
}
5390
},
54-
"then": {
55-
"enum": [
56-
"256",
57-
"512",
58-
"1024",
59-
"2048",
60-
"4096",
61-
"8192",
62-
"16384"
63-
]
91+
"required": [
92+
"Cpu"
93+
]
94+
},
95+
"not": {
96+
"required": [
97+
"PlacementConstraints"
98+
]
99+
},
100+
"required": [
101+
"Cpu",
102+
"Memory"
103+
],
104+
"then": {
105+
"properties": {
106+
"Cpu": {
107+
"else": {
108+
"pattern": "^(\\.25|\\.5|1|2|4|8|16)\\s*(?i)vCpu$"
109+
},
110+
"if": {
111+
"pattern": "^\\d+$",
112+
"type": [
113+
"integer",
114+
"string"
115+
]
116+
},
117+
"then": {
118+
"enum": [
119+
"256",
120+
"512",
121+
"1024",
122+
"2048",
123+
"4096",
124+
"8192",
125+
"16384"
126+
]
127+
}
128+
}
64129
}
65130
}
66131
}
67-
}
132+
]
68133
}
69134
}

src/cfnlint/data/schemas/patches/extensions/all/aws_ecs_service/boto.json

-14
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,6 @@
99
"path": "/definitions/Tag/properties/Value/pattern",
1010
"value": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
1111
},
12-
{
13-
"op": "add",
14-
"path": "/definitions/LogConfiguration/properties/LogDriver/enum",
15-
"value": [
16-
"awsfirelens",
17-
"awslogs",
18-
"fluentd",
19-
"gelf",
20-
"journald",
21-
"json-file",
22-
"splunk",
23-
"syslog"
24-
]
25-
},
2612
{
2713
"op": "add",
2814
"path": "/definitions/EBSTagSpecification/properties/ResourceType/enum",

src/cfnlint/data/schemas/patches/extensions/all/aws_ecs_taskdefinition/boto.json

-14
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,6 @@
7171
"stack"
7272
]
7373
},
74-
{
75-
"op": "add",
76-
"path": "/definitions/LogConfiguration/properties/LogDriver/enum",
77-
"value": [
78-
"awsfirelens",
79-
"awslogs",
80-
"fluentd",
81-
"gelf",
82-
"journald",
83-
"json-file",
84-
"splunk",
85-
"syslog"
86-
]
87-
},
8874
{
8975
"op": "add",
9076
"path": "/definitions/ResourceRequirement/properties/Type/enum",

src/cfnlint/data/schemas/providers/eu_central_1/aws-ecs-service.json

-10
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,6 @@
174174
"additionalProperties": false,
175175
"properties": {
176176
"LogDriver": {
177-
"enum": [
178-
"awsfirelens",
179-
"awslogs",
180-
"fluentd",
181-
"gelf",
182-
"journald",
183-
"json-file",
184-
"splunk",
185-
"syslog"
186-
],
187177
"type": "string"
188178
},
189179
"Options": {

src/cfnlint/data/schemas/providers/us_east_1/aws-ecs-taskdefinition.json

-10
Original file line numberDiff line numberDiff line change
@@ -581,16 +581,6 @@
581581
"additionalProperties": false,
582582
"properties": {
583583
"LogDriver": {
584-
"enum": [
585-
"awsfirelens",
586-
"awslogs",
587-
"fluentd",
588-
"gelf",
589-
"journald",
590-
"json-file",
591-
"splunk",
592-
"syslog"
593-
],
594584
"type": "string"
595585
},
596586
"Options": {

src/cfnlint/data/schemas/providers/us_west_2/aws-ecs-service.json

-10
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,6 @@
174174
"additionalProperties": false,
175175
"properties": {
176176
"LogDriver": {
177-
"enum": [
178-
"awsfirelens",
179-
"awslogs",
180-
"fluentd",
181-
"gelf",
182-
"journald",
183-
"json-file",
184-
"splunk",
185-
"syslog"
186-
],
187177
"type": "string"
188178
},
189179
"Options": {

0 commit comments

Comments
 (0)