diff --git a/builtin/providers/aws/resource_provider.go b/builtin/providers/aws/resource_provider.go index 47ededc21..fb2930a12 100644 --- a/builtin/providers/aws/resource_provider.go +++ b/builtin/providers/aws/resource_provider.go @@ -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 } diff --git a/diff/resource_builder.go b/diff/resource_builder.go index abd4ea39f..063c1295b 100644 --- a/diff/resource_builder.go +++ b/diff/resource_builder.go @@ -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{ diff --git a/diff/resource_builder_test.go b/diff/resource_builder_test.go index 54a913228..1cd8a685a 100644 --- a/diff/resource_builder_test.go +++ b/diff/resource_builder_test.go @@ -144,24 +144,20 @@ func TestResourceBuilder_vars(t *testing.T) { } } -const testRBNewDiff = `CREATE +const testRBNewDiff = `UPDATE IN foo: "" => "bar" - OUT id: "" => "" (forces new resource) OUT private_ip: "" => "" ` const testRBRequiresNewDiff = `CREATE IN ami: "foo" => "bar" (forces new resource) - OUT id: "1" => "" (forces new resource) OUT private_ip: "127.0.0.1" => "" ` -const testRBUnknownDiff = `CREATE +const testRBUnknownDiff = `UPDATE IN foo: "" => "${var.unknown}" - OUT id: "" => "" (forces new resource) ` -const testRBVarsDiff = `CREATE +const testRBVarsDiff = `UPDATE IN foo: "" => "bar" - OUT id: "" => "" (forces new resource) `