mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
providers/aws: generate diff
This commit is contained in:
parent
a58b2c8675
commit
4711850cf3
@ -4,10 +4,10 @@ import (
|
|||||||
"github.com/hashicorp/terraform/diff"
|
"github.com/hashicorp/terraform/diff"
|
||||||
)
|
)
|
||||||
|
|
||||||
var diffBuilder *diff.LazyResourceMap
|
var diffMap *diff.LazyResourceMap
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
diffBuilder = &diff.LazyResourceMap{
|
diffMap = &diff.LazyResourceMap{
|
||||||
Resources: map[string]diff.ResourceBuilderFactory{
|
Resources: map[string]diff.ResourceBuilderFactory{
|
||||||
"aws_instance": diffBuilder_aws_instance,
|
"aws_instance": diffBuilder_aws_instance,
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package aws
|
package aws
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,7 +25,12 @@ func (p *ResourceProvider) Configure(*terraform.ResourceConfig) error {
|
|||||||
func (p *ResourceProvider) Diff(
|
func (p *ResourceProvider) Diff(
|
||||||
s *terraform.ResourceState,
|
s *terraform.ResourceState,
|
||||||
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
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 {
|
func (p *ResourceProvider) Resources() []terraform.ResourceType {
|
||||||
|
Loading…
Reference in New Issue
Block a user