@@ -68,6 +68,14 @@ func resourceMongoDBAtlasCloudProviderAccess() *schema.Resource {
68
68
Computed : true ,
69
69
},
70
70
},
71
+ SchemaVersion : 1 ,
72
+ StateUpgraders : []schema.StateUpgrader {
73
+ {
74
+ Type : resourceMongoDBAtlasCloudProviderAccessV0 ().CoreConfigSchema ().ImpliedType (),
75
+ Upgrade : resourceMongoDBAtlasCloudProviderAccessStateUpgradeV0 ,
76
+ Version : 0 ,
77
+ },
78
+ },
71
79
}
72
80
}
73
81
@@ -248,3 +256,53 @@ func splitCloudProviderAccessID(id string) (projectID, providerName, roleID stri
248
256
249
257
return
250
258
}
259
+
260
+ func resourceMongoDBAtlasCloudProviderAccessV0 () * schema.Resource {
261
+ return & schema.Resource {
262
+ Schema : map [string ]* schema.Schema {
263
+ "project_id" : {
264
+ Type : schema .TypeString ,
265
+ Required : true ,
266
+ },
267
+ "provider_name" : {
268
+ Type : schema .TypeString ,
269
+ Required : true ,
270
+ ValidateFunc : validation .StringInSlice ([]string {"AWS" }, false ),
271
+ },
272
+ "atlas_aws_account_arn" : {
273
+ Type : schema .TypeString ,
274
+ Computed : true ,
275
+ },
276
+ "atlas_assumed_role_external_id" : {
277
+ Type : schema .TypeString ,
278
+ Computed : true ,
279
+ },
280
+ "authorized_date" : {
281
+ Type : schema .TypeString ,
282
+ Computed : true ,
283
+ },
284
+ "created_date" : {
285
+ Type : schema .TypeString ,
286
+ Computed : true ,
287
+ },
288
+ "iam_assumed_role_arn" : {
289
+ Type : schema .TypeString ,
290
+ Optional : true ,
291
+ },
292
+ "role_id" : {
293
+ Type : schema .TypeString ,
294
+ Computed : true ,
295
+ },
296
+ "feature_usages" : {
297
+ Type : schema .TypeList ,
298
+ Elem : featureUsagesSchemaV0 (),
299
+ Computed : true ,
300
+ },
301
+ },
302
+ }
303
+ }
304
+
305
+ func resourceMongoDBAtlasCloudProviderAccessStateUpgradeV0 (ctx context.Context , rawState map [string ]interface {}, meta interface {}) (map [string ]interface {}, error ) {
306
+ rawState ["feature_usages" ] = []interface {}{map [string ]interface {}{}}
307
+ return rawState , nil
308
+ }
0 commit comments