Skip to content

Commit

Permalink
feat(schema): Support custom resource types
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinkney-aws authored and rubenfonseca committed May 3, 2022
1 parent 955f6f5 commit 1274ccd
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 1 deletion.
31 changes: 30 additions & 1 deletion generate/templates/schema.template
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@
"^[a-zA-Z0-9]+$": {
"anyOf": [
{{$length := len .Resources}}{{$c := counter $length}}{{range $name, $resources := .Resources}} { "$ref": "#/definitions/{{$name}}" }{{if call $c}}, {{end}}
{{end}}
{{end}},
{
"$ref": "#/definitions/CustomResource"
}
]
}
},
Expand Down Expand Up @@ -206,6 +209,32 @@
"Type"
]
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},

{{range $name, $resource := .Resources}}
{{$resource.Schema $name false}},
Expand Down
29 changes: 29 additions & 0 deletions schema/cdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -132194,6 +132194,32 @@ var CdkSchema = `{
],
"type": "object"
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},
"Parameter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -135098,6 +135124,9 @@ var CdkSchema = `{
},
{
"$ref": "#/definitions/Alexa::ASK::Skill"
},
{
"$ref": "#/definitions/CustomResource"
}
]
}
Expand Down
29 changes: 29 additions & 0 deletions schema/cdk.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -132189,6 +132189,32 @@
],
"type": "object"
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},
"Parameter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -135093,6 +135119,9 @@
},
{
"$ref": "#/definitions/Alexa::ASK::Skill"
},
{
"$ref": "#/definitions/CustomResource"
}
]
}
Expand Down
29 changes: 29 additions & 0 deletions schema/cloudformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -132136,6 +132136,32 @@ var CloudformationSchema = `{
],
"type": "object"
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},
"Parameter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -135037,6 +135063,9 @@ var CloudformationSchema = `{
},
{
"$ref": "#/definitions/Alexa::ASK::Skill"
},
{
"$ref": "#/definitions/CustomResource"
}
]
}
Expand Down
29 changes: 29 additions & 0 deletions schema/cloudformation.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -132131,6 +132131,32 @@
],
"type": "object"
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},
"Parameter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -135032,6 +135058,9 @@
},
{
"$ref": "#/definitions/Alexa::ASK::Skill"
},
{
"$ref": "#/definitions/CustomResource"
}
]
}
Expand Down
29 changes: 29 additions & 0 deletions schema/sam.go
Original file line number Diff line number Diff line change
Expand Up @@ -134704,6 +134704,32 @@ var SamSchema = `{
],
"type": "object"
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},
"Parameter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -137915,6 +137941,9 @@ var SamSchema = `{
},
{
"$ref": "#/definitions/Alexa::ASK::Skill"
},
{
"$ref": "#/definitions/CustomResource"
}
]
}
Expand Down
29 changes: 29 additions & 0 deletions schema/sam.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -134699,6 +134699,32 @@
],
"type": "object"
},
"CustomResource": {
"additionalProperties": false,
"properties": {
"Properties": {
"additionalProperties": true,
"properties": {
"ServiceToken": {
"type": "string"
}
},
"required": [
"ServiceToken"
],
"type": "object"
},
"Type": {
"pattern": "^Custom::[a-zA-Z_@-]+$",
"type": "string"
}
},
"required": [
"Type",
"Properties"
],
"type": "object"
},
"Parameter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -137910,6 +137936,9 @@
},
{
"$ref": "#/definitions/Alexa::ASK::Skill"
},
{
"$ref": "#/definitions/CustomResource"
}
]
}
Expand Down

0 comments on commit 1274ccd

Please sign in to comment.