terraform: make sure the config is initialized

This commit is contained in:
Mitchell Hashimoto 2014-07-08 16:16:55 -07:00
parent 8f4cd641df
commit d0dc045282
2 changed files with 12 additions and 7 deletions

View File

@ -199,8 +199,9 @@ func graphAddConfigResources(
Type: r.Type, Type: r.Type,
Config: r, Config: r,
Resource: &Resource{ Resource: &Resource{
Id: name, Id: name,
State: state, State: state,
Config: NewResourceConfig(r.RawConfig),
}, },
}, },
} }
@ -429,8 +430,9 @@ func graphAddOrphans(g *depgraph.Graph, c *config.Config, s *State) {
Type: rs.Type, Type: rs.Type,
Orphan: true, Orphan: true,
Resource: &Resource{ Resource: &Resource{
Id: k, Id: k,
State: rs, State: rs,
Config: NewResourceConfig(nil),
}, },
}, },
} }

View File

@ -135,8 +135,11 @@ func (c *ResourceConfig) interpolate(ctx *Context) error {
} }
} }
c.ComputedKeys = c.raw.UnknownKeys() if c.raw != nil {
c.Raw = c.raw.Raw c.ComputedKeys = c.raw.UnknownKeys()
c.Config = c.raw.Config() c.Raw = c.raw.Raw
c.Config = c.raw.Config()
}
return nil return nil
} }