terraform: computed key
This commit is contained in:
parent
02fde14fb6
commit
4397c566a0
|
@ -7,8 +7,9 @@ import (
|
|||
"github.com/hashicorp/terraform/config"
|
||||
)
|
||||
|
||||
// smcProviders matches up the resources with a provider
|
||||
// those providers and does the initial `Configure` on the provider.
|
||||
// smcProviders matches up the resources with a provider and initializes
|
||||
// it. This does not call "Configure" on the ResourceProvider, since that
|
||||
// might actually depend on upstream resources.
|
||||
func smcProviders(c *Config) (map[*config.Resource]ResourceProvider, []error) {
|
||||
var errs []error
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ type Config struct {
|
|||
Config *config.Config
|
||||
Providers map[string]ResourceProviderFactory
|
||||
Variables map[string]string
|
||||
|
||||
computedPlaceholder string
|
||||
}
|
||||
|
||||
// New creates a new Terraform structure, initializes resource providers
|
||||
|
@ -35,6 +37,9 @@ type Config struct {
|
|||
func New(c *Config) (*Terraform, error) {
|
||||
var errs []error
|
||||
|
||||
// Calculate the computed key placeholder
|
||||
c.computedPlaceholder = "tf_computed_placeholder"
|
||||
|
||||
// Validate that all required variables have values
|
||||
if err := smcVariables(c); err != nil {
|
||||
errs = append(errs, err...)
|
||||
|
|
Loading…
Reference in New Issue