@@ -2955,65 +2955,19 @@ func TestAccTFEWorkspace_HYOKEnabled(t *testing.T) {
29552955 t .Skip ("HYOK_ORGANIZATION_NAME environment variable must be set to run this test" )
29562956 }
29572957
2958- // Testing workspace hyok enabled going from false to true.
29592958 resource .Test (t , resource.TestCase {
29602959 PreCheck : func () { testAccPreCheck (t ) },
29612960 ProtoV6ProviderFactories : testAccMuxedProviders ,
29622961 CheckDestroy : testAccCheckTFEWorkspaceDestroy ,
29632962 Steps : []resource.TestStep {
2964- // Create workspace with hyok_enabled set to false
29652963 {
2966- Config : testAccTFEWorkspaceHYOKEnabledConfig (orgName , false ),
2964+ Config : testAccTFEWorkspaceConfig (orgName ),
29672965 Check : resource .ComposeAggregateTestCheckFunc (
29682966 resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "organization" , orgName ),
2967+ resource .TestCheckResourceAttrSet ("tfe_workspace.foobar" , "hyok_enabled" ),
29692968 resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "hyok_enabled" , "false" ),
29702969 ),
29712970 },
2972- // Import
2973- {
2974- ResourceName : "tfe_workspace.foobar" ,
2975- ImportState : true ,
2976- ImportStateVerify : true ,
2977- },
2978- // Update hyok_enabled to true
2979- {
2980- Config : testAccTFEWorkspaceHYOKEnabledConfig (orgName , true ),
2981- Check : resource .ComposeAggregateTestCheckFunc (
2982- resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "organization" , orgName ),
2983- resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "hyok_enabled" , "true" ),
2984- ),
2985- },
2986- },
2987- })
2988-
2989- // Testing workspace hyok enabled going from true to false.
2990- resource .Test (t , resource.TestCase {
2991- PreCheck : func () { testAccPreCheck (t ) },
2992- ProtoV6ProviderFactories : testAccMuxedProviders ,
2993- CheckDestroy : testAccCheckTFEWorkspaceDestroy ,
2994- Steps : []resource.TestStep {
2995- // Create workspace with hyok_enabled set to true
2996- {
2997- Config : testAccTFEWorkspaceHYOKEnabledConfig (orgName , true ),
2998- Check : resource .ComposeAggregateTestCheckFunc (
2999- resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "organization" , orgName ),
3000- resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "hyok_enabled" , "true" ),
3001- ),
3002- },
3003- // Import
3004- {
3005- ResourceName : "tfe_workspace.foobar" ,
3006- ImportState : true ,
3007- ImportStateVerify : true ,
3008- },
3009- // Update hyok_enabled to false, however hyok_enabled cannot be disabled once enabled.
3010- {
3011- Config : testAccTFEWorkspaceHYOKEnabledConfig (orgName , false ),
3012- Check : resource .ComposeAggregateTestCheckFunc (
3013- resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "organization" , orgName ),
3014- resource .TestCheckResourceAttr ("tfe_workspace.foobar" , "hyok_enabled" , "true" ),
3015- ),
3016- },
30172971 },
30182972 })
30192973}
@@ -4228,12 +4182,11 @@ resource "tfe_workspace" "foobar" {
42284182}` , rInt )
42294183}
42304184
4231- func testAccTFEWorkspaceHYOKEnabledConfig (orgName string , hyokEnabled bool ) string {
4185+ func testAccTFEWorkspaceConfig (orgName string ) string {
42324186 return fmt .Sprintf (`
42334187resource "tfe_workspace" "foobar" {
42344188 organization = "%s"
42354189 name = "tfe-provider-test-workspace-hyok-enabled"
4236- hyok_enabled = %t
42374190}
4238- ` , orgName , hyokEnabled )
4191+ ` , orgName )
42394192}
0 commit comments