terraform: Store resource config along side provisioner

This commit is contained in:
Armon Dadgar 2014-07-07 15:58:06 -07:00
parent 55124b9e28
commit b2758666eb
1 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,16 @@ import (
"github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/config"
) )
// ResourceProvisionerConfig is used to pair a provisioner
// with it's provided configuration. This allows us to use singleton
// instances of each ResourceProvisioner and to keep the relevant
// configuration instead of instantiating a new Provisioner for each
// resource.
type ResourceProvisionerConfig struct {
Provisioner ResourceProvisioner
Config *ResourceConfig
}
// Resource encapsulates a resource, its configuration, its provider, // Resource encapsulates a resource, its configuration, its provider,
// its current state, and potentially a desired diff from the state it // its current state, and potentially a desired diff from the state it
// wants to reach. // wants to reach.
@ -18,7 +28,7 @@ type Resource struct {
Diff *ResourceDiff Diff *ResourceDiff
Provider ResourceProvider Provider ResourceProvider
State *ResourceState State *ResourceState
Provisioners []ResourceProvisioner Provisioners []*ResourceProvisionerConfig
} }
// Vars returns the mapping of variables that should be replaced in // Vars returns the mapping of variables that should be replaced in