@@ -40,37 +40,36 @@ func resourceEnterpriseOrg() *schema.Resource {
40
40
Required : true ,
41
41
ForceNew : true ,
42
42
},
43
+ // Computed
43
44
"enterprise_id" : {
44
- Description : "UUID of the Enterprise under which the organization should be created" ,
45
+ Description : "UUID of the Enterprise under which the organization is created" ,
45
46
Type : schema .TypeString ,
46
- Required : true ,
47
- ForceNew : true ,
47
+ Computed : true ,
48
48
},
49
- // Computed
50
49
"organization_id" : {
51
- Description : "The Astra organization ID (UUID) for the created Enterprise organization." ,
52
- Type : schema .TypeString ,
53
- Computed : true ,
50
+ Description : "The Astra organization ID (UUID) for the created Enterprise organization." ,
51
+ Type : schema .TypeString ,
52
+ Computed : true ,
54
53
},
55
54
"organization_type" : {
56
- Description : "The type of the organization." ,
57
- Type : schema .TypeString ,
58
- Computed : true ,
55
+ Description : "The type of the organization." ,
56
+ Type : schema .TypeString ,
57
+ Computed : true ,
59
58
},
60
59
"organization_group_id" : {
61
- Description : "The group ID (UUID) of the organization." ,
62
- Type : schema .TypeString ,
63
- Computed : true ,
60
+ Description : "The group ID (UUID) of the organization." ,
61
+ Type : schema .TypeString ,
62
+ Computed : true ,
64
63
},
65
64
"created_at" : {
66
- Description : "The timestamp when the organization was created." ,
67
- Type : schema .TypeString ,
68
- Computed : true ,
65
+ Description : "The timestamp when the organization was created." ,
66
+ Type : schema .TypeString ,
67
+ Computed : true ,
69
68
},
70
69
"last_modified" : {
71
- Description : "The timestamp when the organization was last modified." ,
72
- Type : schema .TypeString ,
73
- Computed : true ,
70
+ Description : "The timestamp when the organization was last modified." ,
71
+ Type : schema .TypeString ,
72
+ Computed : true ,
74
73
},
75
74
// TODO: Add MarketPlaceData
76
75
},
@@ -83,13 +82,11 @@ func resourceEnterpriseOrgCreate(ctx context.Context, d *schema.ResourceData, me
83
82
orgName := d .Get ("name" ).(string )
84
83
orgEmail := d .Get ("email" ).(string )
85
84
adminUid := d .Get ("admin_user_id" ).(string )
86
- enterpriseId := d .Get ("enterprise_id" ).(string )
87
85
88
86
orgReq := astra.CreateOrganizationInEnterpriseJSONRequestBody {
89
87
Name : orgName ,
90
88
Email : orgEmail ,
91
89
AdminUserID : adminUid ,
92
- EnterpriseID : enterpriseId ,
93
90
}
94
91
95
92
resp , err := client .CreateOrganizationInEnterpriseWithResponse (ctx , orgReq )
@@ -132,7 +129,7 @@ func setEnterpriseOrgData(d *schema.ResourceData, org *astra.CreateOrgInEnterpri
132
129
if org == nil {
133
130
return errors .New ("organization is nil" )
134
131
}
135
-
132
+ d . Set ( "enterprise_id" , * org . EnterpriseId )
136
133
d .Set ("organization_id" , * org .OrganizationID )
137
134
d .Set ("organization_type" , * org .OrgType )
138
135
d .Set ("organization_group_id" , * org .OrganizationGroupId )
0 commit comments