@@ -94,15 +94,15 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
9494 "group_sync" : schema.SingleNestedBlock {
9595 Attributes : map [string ]schema.Attribute {
9696 "field" : schema.StringAttribute {
97- Required : true ,
97+ Optional : true ,
9898 MarkdownDescription : "The claim field that specifies what groups " +
9999 "a user should be in." ,
100100 Validators : []validator.String {
101101 stringvalidator .LengthAtLeast (1 ),
102102 },
103103 },
104104 "regex" : schema.StringAttribute {
105- Required : true ,
105+ Optional : true ,
106106 MarkdownDescription : "A regular expression that will be used to " +
107107 "filter the groups returned by the OIDC provider. Any group " +
108108 "not matched will be ignored." ,
@@ -111,21 +111,21 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
111111 },
112112 },
113113 "auto_create_missing" : schema.BoolAttribute {
114- Required : true ,
114+ Optional : true ,
115115 MarkdownDescription : "Controls whether groups will be created if " +
116116 "they are missing." ,
117117 },
118118 "mapping" : schema.MapAttribute {
119119 ElementType : UUIDType ,
120- Required : true ,
120+ Optional : true ,
121121 MarkdownDescription : "A map from OIDC group name to Coder group ID." ,
122122 },
123123 },
124124 },
125125 "role_sync" : schema.SingleNestedBlock {
126126 Attributes : map [string ]schema.Attribute {
127127 "field" : schema.StringAttribute {
128- Required : true ,
128+ Optional : true ,
129129 MarkdownDescription : "The claim field that specifies what " +
130130 "organization roles a user should be given." ,
131131 Validators : []validator.String {
@@ -134,7 +134,7 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
134134 },
135135 "mapping" : schema.MapAttribute {
136136 ElementType : UUIDType ,
137- Required : true ,
137+ Optional : true ,
138138 MarkdownDescription : "A map from OIDC group name to Coder " +
139139 "organization role." ,
140140 },
@@ -285,7 +285,7 @@ func (r *OrganizationResource) Update(ctx context.Context, req resource.UpdateRe
285285 if data .GroupSync .IsNull () {
286286 err = r .patchGroupSync (ctx , orgID , data .GroupSync )
287287 if err != nil {
288- resp .Diagnostics .AddError ("Group Sync Update error" , "uh oh john" )
288+ resp .Diagnostics .AddError ("Group Sync Update error" , err . Error () )
289289 return
290290 }
291291 }
0 commit comments