@@ -2,7 +2,7 @@ package codefresh
2
2
3
3
import (
4
4
cfClient "github.com/codefresh-io/terraform-provider-codefresh/client"
5
- "github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5
+ "github.com/hashicorp/terraform-plugin-sdk/v2/ helper/schema"
6
6
)
7
7
8
8
func resourceAccount () * schema.Resource {
@@ -26,6 +26,21 @@ func resourceAccount() *schema.Resource {
26
26
// Type: schema.TypeString,
27
27
// },
28
28
// },
29
+
30
+ "features" : {
31
+ Type : schema .TypeMap ,
32
+ Optional : true ,
33
+ Elem : & schema.Schema {
34
+ Type : schema .TypeBool ,
35
+ },
36
+ Default : map [string ]bool {
37
+ "OfflineLogging" : true ,
38
+ "ssoManagement" : true ,
39
+ "teamsManagement" : true ,
40
+ "abac" : true ,
41
+ "customKubernetesCluster" : true ,
42
+ },
43
+ },
29
44
"limits" : {
30
45
Type : schema .TypeList ,
31
46
Optional : true ,
@@ -137,6 +152,10 @@ func mapAccountToResource(account *cfClient.Account, d *schema.ResourceData) err
137
152
// if err != nil {
138
153
// return err
139
154
// }
155
+ err = d .Set ("features" , account .Features )
156
+ if err != nil {
157
+ return err
158
+ }
140
159
141
160
err = d .Set ("limits" , []map [string ]interface {}{flattenLimits (* account .Limits )})
142
161
if err != nil {
@@ -173,6 +192,9 @@ func mapResourceToAccount(d *schema.ResourceData) *cfClient.Account {
173
192
// Admins: convertStringArr(admins),
174
193
}
175
194
195
+ if _ , ok := d .GetOk ("features" ); ok {
196
+ account .SetFeatures (d .Get ("features" ).(map [string ]interface {}))
197
+ }
176
198
if _ , ok := d .GetOk ("limits" ); ok {
177
199
account .Limits = & cfClient.Limits {
178
200
Collaborators : cfClient.Collaborators {
0 commit comments