diff: don't magically put ID in there, assumed if not set
This commit is contained in:
parent
c5a621a47a
commit
9b4b89c16c
|
@ -29,6 +29,10 @@ func (p *ResourceProvider) Apply(
|
|||
ID: "foo",
|
||||
}
|
||||
result = result.MergeDiff(d)
|
||||
result.Attributes["public_dns"] = "foo"
|
||||
result.Attributes["public_ip"] = "foo"
|
||||
result.Attributes["private_dns"] = "foo"
|
||||
result.Attributes["private_ip"] = "foo"
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
|
|
@ -64,13 +64,6 @@ func (b *ResourceBuilder) Diff(
|
|||
// If we require a new resource, then process all the attributes
|
||||
// that will be changing due to the creation of the resource.
|
||||
if requiresNew {
|
||||
attrs["id"] = &terraform.ResourceAttrDiff{
|
||||
Old: s.ID,
|
||||
NewComputed: true,
|
||||
RequiresNew: true,
|
||||
Type: terraform.DiffAttrOutput,
|
||||
}
|
||||
|
||||
for _, k := range b.CreateComputedAttrs {
|
||||
old := s.Attributes[k]
|
||||
attrs[k] = &terraform.ResourceAttrDiff{
|
||||
|
|
|
@ -144,24 +144,20 @@ func TestResourceBuilder_vars(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
const testRBNewDiff = `CREATE
|
||||
const testRBNewDiff = `UPDATE
|
||||
IN foo: "" => "bar"
|
||||
OUT id: "" => "<computed>" (forces new resource)
|
||||
OUT private_ip: "" => "<computed>"
|
||||
`
|
||||
|
||||
const testRBRequiresNewDiff = `CREATE
|
||||
IN ami: "foo" => "bar" (forces new resource)
|
||||
OUT id: "1" => "<computed>" (forces new resource)
|
||||
OUT private_ip: "127.0.0.1" => "<computed>"
|
||||
`
|
||||
|
||||
const testRBUnknownDiff = `CREATE
|
||||
const testRBUnknownDiff = `UPDATE
|
||||
IN foo: "" => "${var.unknown}"
|
||||
OUT id: "" => "<computed>" (forces new resource)
|
||||
`
|
||||
|
||||
const testRBVarsDiff = `CREATE
|
||||
const testRBVarsDiff = `UPDATE
|
||||
IN foo: "" => "bar"
|
||||
OUT id: "" => "<computed>" (forces new resource)
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue