Skip to content

Commit 408aad3

Browse files
committed
fix: changing a request attribute data_type lead to an error
The data_type of `dynatrace_request_attribute` is immutable once created. The API rejected the request if the type changed. Therefore, adding a forceNew here, so that the resource is re-created if the data_type changes
1 parent 75e48fb commit 408aad3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dynatrace/api/v1/config/requestattributes/settings/data_source.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (me *DataSource) MarshalJSON() ([]byte, error) {
399399
if err := m.Marshal("cicsTransactionCallType", me.CICSTransactionCallType); err != nil {
400400
return nil, err
401401
}
402-
if err := m.Marshal("iibNodeTypeCondition", me.IIBMethodNodeCondition); err != nil {
402+
if err := m.Marshal("iibNodeTypeCondition", me.IIBNodeTypeCondition); err != nil {
403403
return nil, err
404404
}
405405
if err := m.Marshal("imsTransactionCallType", me.IMSTransactionCallType); err != nil {
@@ -461,7 +461,7 @@ func (me *DataSource) UnmarshalJSON(data []byte) error {
461461
if err := m.Unmarshal("cicsTransactionCallType", &me.CICSTransactionCallType); err != nil {
462462
return err
463463
}
464-
if err := m.Unmarshal("iibNodeTypeCondition", &me.IIBMethodNodeCondition); err != nil {
464+
if err := m.Unmarshal("iibNodeTypeCondition", &me.IIBNodeTypeCondition); err != nil {
465465
return err
466466
}
467467
if err := m.Unmarshal("imsTransactionCallType", &me.IMSTransactionCallType); err != nil {

dynatrace/api/v1/config/requestattributes/settings/request_attribute.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func (me *RequestAttribute) Schema() map[string]*schema.Schema {
7272
Type: schema.TypeString,
7373
Description: "The data type of the request attribute",
7474
Required: true,
75+
ForceNew: true,
7576
},
7677
"normalization": {
7778
Type: schema.TypeString,

0 commit comments

Comments
 (0)