Skip to content

Commit

Permalink
AWS CloudFormation schema generator
Browse files Browse the repository at this point in the history
Usage: `go test -v ./scraper/.` will generate updated:
	* schema.go
 	* schema.json

files in the package root
  • Loading branch information
mweagle committed Jun 10, 2017
1 parent 461ee49 commit 414240e
Show file tree
Hide file tree
Showing 2 changed files with 496 additions and 0 deletions.
45 changes: 45 additions & 0 deletions scraper/aws_schema.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package scraper

// See:
// * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification-format.html and
// * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// for more information

// CloudFormationSchema represents the root of the
// schema
type CloudFormationSchema struct {
PropertyTypes map[string]PropertyTypes
ResourceTypes map[string]ResourceTypes
ResourceSpecificationVersion string
}

// PropertyTypes is a definition of a property
type PropertyTypes struct {
Documentation string
Properties map[string]PropertyTypeDefinition
}

// ResourceTypes is a definition of a resource
type ResourceTypes struct {
Documentation string
Attributes map[string]ResourceAttribute
Properties map[string]PropertyTypeDefinition
}

// ResourceAttribute are outputs of CloudFormation
// reosurce
type ResourceAttribute struct {
PrimitiveType string
}

// PropertyTypeDefinition is the definition of a property
type PropertyTypeDefinition struct {
Required bool
Documentation string
PrimitiveType string
UpdateType string
Type string
DuplicatesAllowed bool
ItemType string
PrimitiveItemType string
}
Loading

0 comments on commit 414240e

Please sign in to comment.