Skip to content

Commit

Permalink
Put in fixes for ECS LogDriver configs (#3937)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored Jan 29, 2025
1 parent 90485a1 commit a589da3
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 105 deletions.
3 changes: 2 additions & 1 deletion scripts/boto/update_schemas_from_boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
]

exceptions = {
"ses": ["/definitions/EventDestination/properties/MatchingEventTypes/items"]
"ses": ["/definitions/EventDestination/properties/MatchingEventTypes/items"],
"ecs": ["/definitions/LogConfiguration/properties/LogDriver"],
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,119 @@
]
},
"then": {
"if": {
"properties": {
"Cpu": {
"type": [
"string",
"integer"
"allOf": [
{
"if": {
"properties": {
"NetworkMode": {
"type": "string"
}
},
"required": [
"NetworkMode"
]
},
"required": [
"NetworkMode"
],
"then": {
"properties": {
"NetworkMode": {
"enum": [
"awsvpc"
],
"type": "string"
}
},
"required": [
"NetworkMode"
]
}
},
"required": [
"Cpu"
]
},
"not": {
"required": [
"PlacementConstraints"
]
},
"required": [
"Cpu",
"Memory"
],
"then": {
"properties": {
"Cpu": {
"else": {
"pattern": "^(\\.25|\\.5|1|2|4|8|16)\\s*(?i)vCpu$"
},
"if": {
"pattern": "^\\d+$",
"type": [
"integer",
"string"
]
{
"properties": {
"ContainerDefinitions": {
"items": {
"properties": {
"LogConfiguration": {
"if": {
"properties": {
"LogDriver": {
"type": "string"
}
},
"required": [
"LogDriver"
]
},
"then": {
"properties": {
"LogDriver": {
"enum": [
"awslogs",
"splunk",
"awsfirelens"
]
}
}
}
}
}
}
}
}
},
{
"if": {
"properties": {
"Cpu": {
"type": [
"string",
"integer"
]
}
},
"then": {
"enum": [
"256",
"512",
"1024",
"2048",
"4096",
"8192",
"16384"
]
"required": [
"Cpu"
]
},
"not": {
"required": [
"PlacementConstraints"
]
},
"required": [
"Cpu",
"Memory"
],
"then": {
"properties": {
"Cpu": {
"else": {
"pattern": "^(\\.25|\\.5|1|2|4|8|16)\\s*(?i)vCpu$"
},
"if": {
"pattern": "^\\d+$",
"type": [
"integer",
"string"
]
},
"then": {
"enum": [
"256",
"512",
"1024",
"2048",
"4096",
"8192",
"16384"
]
}
}
}
}
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@
"path": "/definitions/Tag/properties/Value/pattern",
"value": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
},
{
"op": "add",
"path": "/definitions/LogConfiguration/properties/LogDriver/enum",
"value": [
"awsfirelens",
"awslogs",
"fluentd",
"gelf",
"journald",
"json-file",
"splunk",
"syslog"
]
},
{
"op": "add",
"path": "/definitions/EBSTagSpecification/properties/ResourceType/enum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,6 @@
"stack"
]
},
{
"op": "add",
"path": "/definitions/LogConfiguration/properties/LogDriver/enum",
"value": [
"awsfirelens",
"awslogs",
"fluentd",
"gelf",
"journald",
"json-file",
"splunk",
"syslog"
]
},
{
"op": "add",
"path": "/definitions/ResourceRequirement/properties/Type/enum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,6 @@
"additionalProperties": false,
"properties": {
"LogDriver": {
"enum": [
"awsfirelens",
"awslogs",
"fluentd",
"gelf",
"journald",
"json-file",
"splunk",
"syslog"
],
"type": "string"
},
"Options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,16 +581,6 @@
"additionalProperties": false,
"properties": {
"LogDriver": {
"enum": [
"awsfirelens",
"awslogs",
"fluentd",
"gelf",
"journald",
"json-file",
"splunk",
"syslog"
],
"type": "string"
},
"Options": {
Expand Down
10 changes: 0 additions & 10 deletions src/cfnlint/data/schemas/providers/us_west_2/aws-ecs-service.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,6 @@
"additionalProperties": false,
"properties": {
"LogDriver": {
"enum": [
"awsfirelens",
"awslogs",
"fluentd",
"gelf",
"journald",
"json-file",
"splunk",
"syslog"
],
"type": "string"
},
"Options": {
Expand Down
Loading

0 comments on commit a589da3

Please sign in to comment.