Skip to content

Commit

Permalink
Add new capabilities for schema comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Jan 22, 2025
1 parent 7a4e135 commit 199889d
Show file tree
Hide file tree
Showing 44 changed files with 284 additions and 59 deletions.
7 changes: 6 additions & 1 deletion scripts/update_schemas_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ def _create_patch(value: dict[str, str], ref: Sequence[str], resolver: RefResolv
path="/properties/GroupName",
),
Patch(
values={"format": "AWS::EC2::SecurityGroup.Id"},
values={
"anyOf": [
{"format": "AWS::EC2::SecurityGroup.Id"},
{"format": "AWS::EC2::SecurityGroup.Name"},
]
},
path="/properties/Id",
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@
},
{
"op": "add",
"path": "/properties/Id/format",
"value": "AWS::EC2::SecurityGroup.Id"
"path": "/properties/Id/anyOf",
"value": [
{
"format": "AWS::EC2::SecurityGroup.Id"
},
{
"format": "AWS::EC2::SecurityGroup.Name"
}
]
},
{
"op": "add",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"type": "object"
},
"SecurityGroupId": {
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "sg-\\w{8,17}",
"type": "string"
},
Expand Down Expand Up @@ -139,6 +140,7 @@
"additionalProperties": false,
"properties": {
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"$ref": "#/definitions/SecurityGroupId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down Expand Up @@ -254,7 +254,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down Expand Up @@ -738,7 +738,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
"SecurityGroups": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "^\\S{1,50}$",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"type": "object"
},
"SecurityGroupId": {
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "sg-\\w{8,17}",
"type": "string"
},
Expand Down Expand Up @@ -139,6 +140,7 @@
"additionalProperties": false,
"properties": {
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"$ref": "#/definitions/SecurityGroupId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
],
"properties": {
"AmiId": {
"format": "AWS::EC2::Image.Id",
"pattern": "^ami-[a-z0-9]+$",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"type": "object"
},
"SecurityGroupId": {
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "sg-\\w{8,17}",
"type": "string"
},
Expand Down Expand Up @@ -139,6 +140,7 @@
"additionalProperties": false,
"properties": {
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"$ref": "#/definitions/SecurityGroupId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "^\\S{1,50}$",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"type": "object"
},
"SecurityGroupId": {
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "sg-\\w{8,17}",
"type": "string"
},
Expand Down Expand Up @@ -139,6 +140,7 @@
"additionalProperties": false,
"properties": {
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"$ref": "#/definitions/SecurityGroupId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "^\\S{1,50}$",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "^\\S{1,50}$",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"type": "object"
},
"SecurityGroupId": {
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "sg-\\w{8,17}",
"type": "string"
},
Expand Down Expand Up @@ -139,6 +140,7 @@
"additionalProperties": false,
"properties": {
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"$ref": "#/definitions/SecurityGroupId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"pattern": "^\\S{1,50}$",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down Expand Up @@ -254,7 +254,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down Expand Up @@ -738,7 +738,7 @@
"format": "AWS::EC2::SecurityGroup.Ids",
"insertionOrder": false,
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
"SecurityGroups": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"maxLength": 32,
"pattern": "[-0-9a-zA-Z]+",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"SecurityGroupIds": {
"format": "AWS::EC2::SecurityGroup.Ids",
"items": {
"format": "AWS::EC2::SecurityGroup.GroupId",
"format": "AWS::EC2::SecurityGroup.Id",
"type": "string"
},
"type": "array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@
"type": "string"
},
"Id": {
"format": "AWS::EC2::SecurityGroup.Id",
"anyOf": [
{
"format": "AWS::EC2::SecurityGroup.Id"
},
{
"format": "AWS::EC2::SecurityGroup.Name"
}
],
"type": "string"
},
"SecurityGroupEgress": {
Expand Down
Loading

0 comments on commit 199889d

Please sign in to comment.