- return nil, nil
-}
-
-// EvalInputProvider is an EvalNode implementation that asks for input
-// for the given provider configurations.
-type EvalInputProvider struct {
- Name string
- Provider *ResourceProvider
- Config **ResourceConfig
-}
-
-func (n *EvalInputProvider) Eval(ctx EvalContext) (interface{}, error) {
- // If we already configured this provider, then don't do this again
- if v := ctx.ProviderInput(n.Name); v != nil {
- return nil, nil
- }
-
- rc := *n.Config
-
- // Wrap the input into a namespace
- input := &PrefixUIInput{
- IdPrefix: fmt.Sprintf("provider.%s", n.Name),
- QueryPrefix: fmt.Sprintf("provider.%s.", n.Name),
- UIInput: ctx.Input(),
- }
-
- // Go through each provider and capture the input necessary
- // to satisfy it.
- config, err := (*n.Provider).Input(input, rc)
- if err != nil {
- return nil, fmt.Errorf(
- "Error configuring %s: %s", n.Name, err)
- }
-
- // Set the input that we received so that child modules don't attempt
- // to ask for input again.
- if config != nil && len(config.Config) > 0 {
- // This repository of provider input results on the context doesn't
- // retain config.ComputedKeys, so we need to filter those out here
- // in order that later users of this data won't try to use the unknown
- // value placeholder as if it were a literal value. This map is just
- // of known values we've been able to complete so far; dynamic stuff
- // will be merged in by EvalBuildProviderConfig on subsequent
- // (post-input) walks.
- confMap := config.Config
- if config.ComputedKeys != nil {
- for _, key := range config.ComputedKeys {
- delete(confMap, key)
- }
- }
-
- ctx.SetProviderInput(n.Name, confMap)
- } else {
- ctx.SetProviderInput(n.Name, map[string]interface{}{})