@@ -120,6 +120,7 @@ func ResourcePermissions() *schema.Resource {
120
120
Type : schema .TypeList ,
121
121
Optional : true ,
122
122
Computed : true ,
123
+ ForceNew : true ,
123
124
MaxItems : 1 ,
124
125
ExactlyOneOf : []string {
125
126
"catalog_resource" ,
@@ -132,6 +133,12 @@ func ResourcePermissions() *schema.Resource {
132
133
},
133
134
Elem : & schema.Resource {
134
135
Schema : map [string ]* schema.Schema {
136
+ "catalog_id" : {
137
+ Type : schema .TypeString ,
138
+ ForceNew : true ,
139
+ Optional : true ,
140
+ Computed : true ,
141
+ },
135
142
"key" : {
136
143
Type : schema .TypeString ,
137
144
Required : true ,
@@ -141,19 +148,13 @@ func ResourcePermissions() *schema.Resource {
141
148
"values" : {
142
149
Type : schema .TypeSet ,
143
150
Required : true ,
151
+ ForceNew : true ,
144
152
MinItems : 1 ,
145
153
MaxItems : 15 ,
146
154
Elem : & schema.Schema {
147
155
Type : schema .TypeString ,
148
156
ValidateFunc : validateLFTagValues (),
149
157
},
150
- Set : schema .HashString ,
151
- },
152
- "catalog_id" : {
153
- Type : schema .TypeString ,
154
- ForceNew : true ,
155
- Optional : true ,
156
- Computed : true ,
157
158
},
158
159
},
159
160
},
@@ -162,6 +163,7 @@ func ResourcePermissions() *schema.Resource {
162
163
Type : schema .TypeList ,
163
164
Optional : true ,
164
165
Computed : true ,
166
+ ForceNew : true ,
165
167
MaxItems : 1 ,
166
168
ExactlyOneOf : []string {
167
169
"catalog_resource" ,
@@ -181,34 +183,35 @@ func ResourcePermissions() *schema.Resource {
181
183
ValidateFunc : verify .ValidAccountID ,
182
184
},
183
185
"expression" : {
184
- Type : schema .TypeList ,
186
+ Type : schema .TypeSet ,
185
187
Required : true ,
186
188
MinItems : 1 ,
187
- MaxItems : 5 ,
188
189
Elem : & schema.Resource {
189
190
Schema : map [string ]* schema.Schema {
190
191
"key" : {
191
192
Type : schema .TypeString ,
192
193
Required : true ,
194
+ ForceNew : true ,
193
195
ValidateFunc : validation .StringLenBetween (1 , 128 ),
194
196
},
195
197
"values" : {
196
198
Type : schema .TypeSet ,
197
199
Required : true ,
200
+ ForceNew : true ,
198
201
MinItems : 1 ,
199
202
MaxItems : 15 ,
200
203
Elem : & schema.Schema {
201
204
Type : schema .TypeString ,
202
205
ValidateFunc : validateLFTagValues (),
203
206
},
204
- Set : schema .HashString ,
205
207
},
206
208
},
207
209
},
208
210
},
209
211
"resource_type" : {
210
212
Type : schema .TypeString ,
211
213
Required : true ,
214
+ ForceNew : true ,
212
215
ValidateFunc : validation .StringInSlice (lakeformation .ResourceType_Values (), false ),
213
216
},
214
217
},
@@ -320,7 +323,6 @@ func ResourcePermissions() *schema.Resource {
320
323
Type : schema .TypeSet ,
321
324
ForceNew : true ,
322
325
Optional : true ,
323
- Set : schema .HashString ,
324
326
Elem : & schema.Schema {
325
327
Type : schema .TypeString ,
326
328
ValidateFunc : validation .NoZeroValues ,
@@ -339,7 +341,6 @@ func ResourcePermissions() *schema.Resource {
339
341
Type : schema .TypeSet ,
340
342
ForceNew : true ,
341
343
Optional : true ,
342
- Set : schema .HashString ,
343
344
Elem : & schema.Schema {
344
345
Type : schema .TypeString ,
345
346
ValidateFunc : validation .NoZeroValues ,
@@ -888,8 +889,8 @@ func ExpandLFTagPolicyResource(tfMap map[string]interface{}) *lakeformation.LFTa
888
889
apiObject .CatalogId = aws .String (v )
889
890
}
890
891
891
- if v , ok := tfMap ["expression" ]; ok && v != nil {
892
- apiObject .Expression = ExpandLFTagExpression (v .([] interface {} ))
892
+ if v , ok := tfMap ["expression" ].( * schema. Set ) ; ok && v . Len () > 0 {
893
+ apiObject .Expression = ExpandLFTagExpression (v .List ( ))
893
894
}
894
895
895
896
if v , ok := tfMap ["resource_type" ].(string ); ok && v != "" {
0 commit comments