@@ -24,6 +24,8 @@ import (
24
24
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
25
25
)
26
26
27
+ var sqlAuditNonUpdatableParams = []string {"instance_id" }
28
+
27
29
// @API RDS GET /v3/{project_id}/instances/{instance_id}/auditlog-policy
28
30
// @API RDS PUT /v3/{project_id}/instances/{instance_id}/auditlog-policy
29
31
func ResourceSQLAudit () * schema.Resource {
@@ -32,10 +34,13 @@ func ResourceSQLAudit() *schema.Resource {
32
34
UpdateContext : resourceSQLAuditUpdate ,
33
35
ReadContext : resourceSQLAuditRead ,
34
36
DeleteContext : resourceSQLAuditDelete ,
37
+
35
38
Importer : & schema.ResourceImporter {
36
39
StateContext : schema .ImportStatePassthroughContext ,
37
40
},
38
41
42
+ CustomizeDiff : config .FlexibleForceNew (sqlAuditNonUpdatableParams ),
43
+
39
44
Timeouts : & schema.ResourceTimeout {
40
45
Create : schema .DefaultTimeout (30 * time .Minute ),
41
46
Update : schema .DefaultTimeout (30 * time .Minute ),
@@ -52,7 +57,6 @@ func ResourceSQLAudit() *schema.Resource {
52
57
"instance_id" : {
53
58
Type : schema .TypeString ,
54
59
Required : true ,
55
- ForceNew : true ,
56
60
Description : `Specifies the ID of the RDS instance.` ,
57
61
},
58
62
"keep_days" : {
@@ -74,6 +78,12 @@ func ResourceSQLAudit() *schema.Resource {
74
78
Description : `Specifies whether the historical audit logs will be reserved for some time when SQL
75
79
audit is disabled.` ,
76
80
},
81
+ "enable_force_new" : {
82
+ Type : schema .TypeString ,
83
+ Optional : true ,
84
+ ValidateFunc : validation .StringInSlice ([]string {"true" , "false" }, false ),
85
+ Description : utils .SchemaDesc ("" , utils.SchemaDescInput {Internal : true }),
86
+ },
77
87
},
78
88
}
79
89
}
0 commit comments