helper/schema: computed values should not be Get-able
This commit is contained in:
parent
4ae1673580
commit
3800dffdeb
|
@ -273,7 +273,7 @@ func (d *ResourceData) getPrimitive(
|
|||
|
||||
if d.diff != nil && source >= getSourceDiff {
|
||||
attrD, ok := d.diff.Attributes[k]
|
||||
if ok {
|
||||
if ok && !attrD.NewComputed {
|
||||
result = attrD.New
|
||||
resultSet = true
|
||||
}
|
||||
|
|
|
@ -15,6 +15,33 @@ func TestResourceDataGet(t *testing.T) {
|
|||
Key string
|
||||
Value interface{}
|
||||
}{
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"availability_zone": &Schema{
|
||||
Type: TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
|
||||
State: nil,
|
||||
|
||||
Diff: &terraform.ResourceDiff{
|
||||
Attributes: map[string]*terraform.ResourceAttrDiff{
|
||||
"availability_zone": &terraform.ResourceAttrDiff{
|
||||
Old: "",
|
||||
New: "",
|
||||
NewComputed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Key: "availability_zone",
|
||||
|
||||
Value: nil,
|
||||
},
|
||||
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"availability_zone": &Schema{
|
||||
|
|
Loading…
Reference in New Issue