@@ -2,7 +2,7 @@ package codefresh
22
33import (
44 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"
66)
77
88func resourceAccount () * schema.Resource {
@@ -26,6 +26,21 @@ func resourceAccount() *schema.Resource {
2626 // Type: schema.TypeString,
2727 // },
2828 // },
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+ },
2944 "limits" : {
3045 Type : schema .TypeList ,
3146 Optional : true ,
@@ -137,6 +152,10 @@ func mapAccountToResource(account *cfClient.Account, d *schema.ResourceData) err
137152 // if err != nil {
138153 // return err
139154 // }
155+ err = d .Set ("features" , account .Features )
156+ if err != nil {
157+ return err
158+ }
140159
141160 err = d .Set ("limits" , []map [string ]interface {}{flattenLimits (* account .Limits )})
142161 if err != nil {
@@ -173,6 +192,9 @@ func mapResourceToAccount(d *schema.ResourceData) *cfClient.Account {
173192 // Admins: convertStringArr(admins),
174193 }
175194
195+ if _ , ok := d .GetOk ("features" ); ok {
196+ account .SetFeatures (d .Get ("features" ).(map [string ]interface {}))
197+ }
176198 if _ , ok := d .GetOk ("limits" ); ok {
177199 account .Limits = & cfClient.Limits {
178200 Collaborators : cfClient.Collaborators {
0 commit comments