Skip to content

Commit

Permalink
Only apply AutoName to inputs (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehoban authored Jul 6, 2018
1 parent 3b21fba commit f4d089d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,8 @@ func Provider() tfbridge.ProviderInfo {
const gcpName = "name"
for resname, res := range prov.Resources {
if schema := p.ResourcesMap[resname]; schema != nil {
if _, has := schema.Schema[gcpName]; has {
// Only apply auto-name to input properties (Optional || Required) named `name`
if tfs, has := schema.Schema[gcpName]; has && (tfs.Optional || tfs.Required) {
if _, hasfield := res.Fields[gcpName]; !hasfield {
if res.Fields == nil {
res.Fields = make(map[string]*tfbridge.SchemaInfo)
Expand Down

0 comments on commit f4d089d

Please sign in to comment.