mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
8212a6a9d0
Adding and removing a single map that requires a new resource can cause empty diffs, relying on the core proposed state values for destruction.
40 lines
836 B
Go
40 lines
836 B
Go
package test
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
)
|
|
|
|
func testResourceForceNew() *schema.Resource {
|
|
return &schema.Resource{
|
|
Create: testResourceForceNewCreate,
|
|
Read: testResourceForceNewRead,
|
|
Delete: testResourceForceNewDelete,
|
|
|
|
Importer: &schema.ResourceImporter{
|
|
State: schema.ImportStatePassthrough,
|
|
},
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
"triggers": {
|
|
Type: schema.TypeMap,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
func testResourceForceNewCreate(d *schema.ResourceData, meta interface{}) error {
|
|
d.SetId("testId")
|
|
return testResourceForceNewRead(d, meta)
|
|
}
|
|
|
|
func testResourceForceNewRead(d *schema.ResourceData, meta interface{}) error {
|
|
return nil
|
|
}
|
|
|
|
func testResourceForceNewDelete(d *schema.ResourceData, meta interface{}) error {
|
|
d.SetId("")
|
|
return nil
|
|
}
|