-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(generator): begin development on terraform generator
- Loading branch information
1 parent
3a96092
commit 7b90c6c
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Code generated by tutone: DO NOT EDIT | ||
package {{.PackageName | lower}} | ||
{{$packageName := .PackageName}} | ||
|
||
{{- if gt (len .Imports) 0 }} | ||
import( | ||
{{- range .Imports}} | ||
"{{.}}" | ||
{{- end}} | ||
) | ||
{{- end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Code generated by tutone: DO NOT EDIT | ||
package {{.PackageName | lower}} | ||
{{$packageName := .PackageName}} | ||
|
||
{{- if gt (len .Imports) 0 }} | ||
import( | ||
{{- range .Imports}} | ||
"{{.}}" | ||
{{- end}} | ||
) | ||
{{- end}} | ||
|
||
func resource{{.PackageName | title}}{{.ResourceName | title}}() *schema.Resource { | ||
return &schema.Resource{ | ||
CreateContext: resource{{.PackageName | title}}{{.ResourceName | title}}Create, | ||
ReadContext: resource{{.PackageName | title}}{{.ResourceName | title}}Read, | ||
UpdateContext: resource{{.PackageName | title}}{{.ResourceName | title}}Update, | ||
DeleteContext: resource{{.PackageName | title}}{{.ResourceName | title}}Delete, | ||
Importer: &schema.ResourceImporter{ | ||
StateContext: schema.ImportStatePassthroughContext, | ||
}, | ||
Schema: map[string]*schema.Schema{ | ||
{{ range .Attributes }} | ||
"{{.Name}}": { | ||
Type: schema.Type{{.Type}}, | ||
}, | ||
}, | ||
} | ||
} |