providers/aws: generate diff

This commit is contained in:
Mitchell Hashimoto 2014-06-18 09:33:13 -07:00
parent a58b2c8675
commit 4711850cf3
2 changed files with 10 additions and 3 deletions

View File

@ -4,10 +4,10 @@ import (
"github.com/hashicorp/terraform/diff"
)
var diffBuilder *diff.LazyResourceMap
var diffMap *diff.LazyResourceMap
func init() {
diffBuilder = &diff.LazyResourceMap{
diffMap = &diff.LazyResourceMap{
Resources: map[string]diff.ResourceBuilderFactory{
"aws_instance": diffBuilder_aws_instance,
},

View File

@ -1,6 +1,8 @@
package aws
import (
"fmt"
"github.com/hashicorp/terraform/terraform"
)
@ -23,7 +25,12 @@ func (p *ResourceProvider) Configure(*terraform.ResourceConfig) error {
func (p *ResourceProvider) Diff(
s *terraform.ResourceState,
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
return nil, nil
b := diffMap.Get(s.Type)
if b == nil {
return nil, fmt.Errorf("Unknown type: %s", s.Type)
}
return b.Diff(s, c)
}
func (p *ResourceProvider) Resources() []terraform.ResourceType {