providers/aws: generate diff
This commit is contained in:
parent
a58b2c8675
commit
4711850cf3
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue