Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrType ¶
type AttrType byte
AttrType is an enum that tells the ResourceBuilder what type of attribute an attribute is, affecting the overall diff output.
The valid values are:
AttrTypeCreate - This attribute can only be set or updated on create. This means that if this attribute is changed, it will require a new resource to be created if it is already created.
AttrTypeUpdate - This attribute can be set at create time or updated in-place. Changing this attribute does not require a new resource.
type PreProcessFunc ¶
PreProcessFunc is used with the PreProcess field in a ResourceBuilder
type ResourceBuilder ¶
type ResourceBuilder struct { // Attrs are the mapping of attributes that can be set from the // configuration, and the affect they have. See the documentation for // AttrType for more info. // // Sometimes attributes in here are also computed. For example, an // "availability_zone" might be optional, but will be chosen for you // by AWS. In that case, specify it both here and in ComputedAttrs. // This will make sure that the absence of the configuration won't // cause a diff by setting it to the empty string. Attrs map[string]AttrType // ComputedAttrs are the attributes that are computed at // resource creation time. ComputedAttrs []string // ComputedAttrsUpdate are the attributes that are computed // at resource update time (this includes creation). ComputedAttrsUpdate []string // PreProcess is a mapping of exact keys that are sent through // a pre-processor before comparing values. The original value will // be put in the "NewExtra" field of the diff. PreProcess map[string]PreProcessFunc }
ResourceBuilder is a helper that knows about how a single resource changes and how those changes affect the diff.
func (*ResourceBuilder) Diff ¶
func (b *ResourceBuilder) Diff( s *terraform.InstanceState, c *terraform.ResourceConfig) (*terraform.InstanceDiff, error)
Diff returns the ResourceDiff for a resource given its state and configuration.