Merge pull request #19312 from hashicorp/b-undefined-timeout
helper/schema: Avoid erroring out on undefined timeouts
This commit is contained in:
commit
4b04e31dd8
|
@ -5,6 +5,7 @@ import (
|
|||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/terraform/config"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
"github.com/mitchellh/copystructure"
|
||||
)
|
||||
|
@ -105,11 +106,17 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig)
|
|||
|
||||
*timeout = rt
|
||||
}
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
if v, ok := raw.(string); ok && v == config.UnknownVariableValue {
|
||||
// Timeout is not defined in the config
|
||||
// Defaults will be used instead
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Printf("[ERROR] Invalid timeout structure: %T", raw)
|
||||
return fmt.Errorf("Invalid Timeout structure found")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue