@@ -374,10 +374,7 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error
374
374
options := tfe.WorkspaceCreateOptions {
375
375
Name : tfe .String (name ),
376
376
AllowDestroyPlan : tfe .Bool (d .Get ("allow_destroy_plan" ).(bool )),
377
- AutoApply : tfe .Bool (d .Get ("auto_apply" ).(bool )),
378
377
AutoApplyRunTrigger : tfe .Bool (d .Get ("auto_apply_run_trigger" ).(bool )),
379
- Description : tfe .String (d .Get ("description" ).(string )),
380
- AssessmentsEnabled : tfe .Bool (d .Get ("assessments_enabled" ).(bool )),
381
378
FileTriggersEnabled : tfe .Bool (d .Get ("file_triggers_enabled" ).(bool )),
382
379
QueueAllRuns : tfe .Bool (d .Get ("queue_all_runs" ).(bool )),
383
380
SpeculativeEnabled : tfe .Bool (d .Get ("speculative_enabled" ).(bool )),
@@ -391,6 +388,18 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error
391
388
options .GlobalRemoteState = tfe .Bool (globalRemoteState .(bool ))
392
389
}
393
390
391
+ if v , ok := d .GetOkExists ("auto_apply" ); ok {
392
+ options .AutoApply = tfe .Bool (v .(bool ))
393
+ }
394
+
395
+ if v , ok := d .GetOkExists ("assessments_enabled" ); ok {
396
+ options .AssessmentsEnabled = tfe .Bool (v .(bool ))
397
+ }
398
+
399
+ if v , ok := d .GetOk ("description" ); ok {
400
+ options .Description = tfe .String (v .(string ))
401
+ }
402
+
394
403
if v , ok := d .GetOk ("agent_pool_id" ); ok && v .(string ) != "" {
395
404
options .AgentPoolID = tfe .String (v .(string ))
396
405
options .SettingOverwrites = & tfe.WorkspaceSettingOverwritesOptions {
@@ -726,13 +735,13 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error
726
735
}
727
736
728
737
if d .HasChange ("assessments_enabled" ) {
729
- if v , ok := d .GetOk ("assessments_enabled" ); ok {
738
+ if v , ok := d .GetOkExists ("assessments_enabled" ); ok {
730
739
options .AssessmentsEnabled = tfe .Bool (v .(bool ))
731
740
}
732
741
}
733
742
734
743
if d .HasChange ("auto_apply" ) {
735
- if v , ok := d .GetOk ("auto_apply" ); ok {
744
+ if v , ok := d .GetOkExists ("auto_apply" ); ok {
736
745
options .AutoApply = tfe .Bool (v .(bool ))
737
746
}
738
747
}
0 commit comments