citrix / terraform-provider-citrix

Terraform provider for Citrix
Apache License 2.0
41 stars 5 forks source link

Create the StoreFront configuration using Terraform #83

Closed dimi4ik closed 1 week ago

dimi4ik commented 1 week ago

Hello

Terraform Core Version

Terraform 1.8.5 on linux_amd64 provider registry.terraform.io/citrix/citrix 0.6.1

Description

I want to create the StoreFront configuration using Terraform. When I run terraform plan, I see


Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # citrix_stf_deployment.example-stf-deployment will be created
  + resource "citrix_stf_deployment" "example-stf-deployment" {
      + host_base_url = "https://ctx-storefront.b001.cloud.com"
      + site_id       = "1"
    }

  # citrix_stf_store_service.example-stf-store-service will be created
  + resource "citrix_stf_store_service" "example-stf-store-service" {
      + friendly_name = "ctx-store"
      + site_id       = "1"
      + virtual_path  = "/Citrix/Store"
    }

When executing terraform apply, the following error occurs:

Citrix_stf_deployment.example-stf-deployment: Creating...
citrix_stf_store_service.example-stf-store-service: Creating...
╷
│ Error: Error creating StoreFront StoreService
│
│   with citrix_stf_store_service.example-stf-store-service,
│   on citrix_stf_store_service.tf line 1, in resource "citrix_stf_store_service" "example-stf-store-service":
│    1: resource "citrix_stf_store_service" "example-stf-store-service" {
│
│ TransactionId:
╵
╷
│ Error: Error creating StoreFront Deployment
│
│   with citrix_stf_deployment.example-stf-deployment,
│   on sf.tf line 1, in resource "citrix_stf_deployment" "example-stf-deployment":
│    1: resource "citrix_stf_deployment" "example-stf-deployment" {
│
│ TransactionId:

Could you please help me resolve this error?

Affected Resource(s)

Please list the affected resource(s) and/or data source(s). citrix_stf_deployment"

Terraform Configuration Files


resource "citrix_stf_deployment" "example-stf-deployment" {
    site_id      = "1"
    host_base_url = "https://ctx-storefront.b001.cloud.com"

}

Debug Output

_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_applyresourcechange.go:45 @module=sdk.framework timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.518Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Resource implements ResourceWithConfigure: tf_provider_addr=registry.terraform.io/citrix/citrix tf_resource_type=citrix_stf_deployment @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/ fwserver/server_createresource.go:47 tf_req_id=1ebb8782-83d0-766c-41c0-07e2efb1da74 tf_rpc=ApplyResourceChange @module=sdk.framework timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.513Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:12.573Z [INFO] Starting apply for citrix_stf_store_service.example-stf-store-service 2024-06-20T15:39:12.564Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Calling provider defined Resource Configure: tf_resource_type=citrix_stf_deployment tf_rpc=ApplyResourceChange @module=sdk.framework tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=1ebb8782-83 d0-766c-41c0-07e2efb1da74 @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_createresource.go:54 timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.581Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Called provider defined Resource Configure: tf_resource_type=citrix_stf_deployment tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_createres ource.go:56 tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=1ebb8782-83d0-766c-41c0-07e2efb1da74 @module=sdk.framework timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.579Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:12.583Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/local" is in the global cache 2024-06-20T15:39:12.583Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/azurerm" is in the global cache 2024-06-20T15:39:12.584Z [DEBUG] skipping FixUpBlockAttrs 2024-06-20T15:39:12.584Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:12.584Z [DEBUG] citrix_stf_store_service.example-stf-store-service: applying the planned Create change 2024-06-20T15:39:12.607Z [TRACE] GRPCProvider.v6: ApplyResourceChange 2024-06-20T15:39:12.583Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Calling provider defined Resource Create: @module=sdk.framework tf_provider_addr=registry.terraform.io/citrix/citrix tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/ internal/fwserver/server_createresource.go:100 tf_req_id=1ebb8782-83d0-766c-41c0-07e2efb1da74 tf_resource_type=citrix_stf_deployment timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.618Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Received downstream response: tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=a5059f25-5d73-4bcc-8416-c4ff282030cb tf_resource_type=citrix_stf_store_service tf_rpc=PlanResourceChange @caller=g ithub.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tf6serverlogging/downstream_request.go:42 @module=sdk.proto diagnostic_error_count=0 diagnostic_warning_count=0 tf_proto_version=6.6 tf_req_duration_ms=52 timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.618Z [TRACE] GRPCProvider.v6: returning cached schema: EXTRA_VALUE_AT_END=registry.terraform.io/citrix/citrix 2024-06-20T15:39:12.620Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Served request: tf_req_id=a5059f25-5d73-4bcc-8416-c4ff282030cb tf_rpc=PlanResourceChange @module=sdk.proto tf_provider_addr=registry.terraform.io/citrix/citrix tf_proto_version=6.6 tf_resource_type=citrix_st f_store_service @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:843 timestamp=2024-06-20T15:39:12.365Z 2024-06-20T15:39:12.625Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Received request: tf_proto_version=6.6 tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tfrpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:852 tf provider_addr=registry.terraform.io/citrix/citrix tf_resource_type=citrix_stf_store_service @module=sdk.proto timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.636Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Sending request downstream: @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tf6serverlogging/downstream_request.go:22 @module=sdk.proto tf_proto_version=6.6 tf_provider_addr=regis try.terraform.io/citrix/citrix tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tf_resource_type=citrix_stf_store_service tf_rpc=ApplyResourceChange timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.639Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Checking ResourceTypes lock: tf_rpc=ApplyResourceChange tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tf_resource_type=citrix_stf_store_service @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0 /internal/fwserver/server.go:510 @module=sdk.framework tf_provider_addr=registry.terraform.io/citrix/citrix timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.646Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: ApplyResourceChange received no PriorState, running CreateResource: tf_resource_type=citrix_stf_store_service tf_rpc=ApplyResourceChange tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=2789798 8-580a-6ca9-9b95-339f143a63dc @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_applyresourcechange.go:45 @module=sdk.framework timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.664Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Resource implements ResourceWithConfigure: tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_createresource.go:47 @module=sdk.framework tf_pro vider_addr=registry.terraform.io/citrix/citrix tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tf_resource_type=citrix_stf_store_service timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.666Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Calling provider defined Resource Configure: @module=sdk.framework tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tf_rpc=ApplyResourceChange @caller=githu b.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_createresource.go:54 tf_resource_type=citrix_stf_store_service timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.715Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Called provider defined Resource Configure: tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terrafo rm-plugin-framework@v1.9.0/internal/fwserver/server_createresource.go:56 @module=sdk.framework tf_resource_type=citrix_stf_store_service timestamp=2024-06-20T15:39:12.621Z 2024-06-20T15:39:12.727Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Calling provider defined Resource Create: tf_provider_addr=registry.terraform.io/citrix/citrix tf_resource_type=citrix_stf_store_service tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plug in-framework@v1.9.0/internal/fwserver/server_createresource.go:100 @module=sdk.framework tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc timestamp=2024-06-20T15:39:12.622Z 2024-06-20T15:39:14.181Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Called provider defined Resource Create: @module=sdk.framework tf_provider_addr=registry.terraform.io/citrix/citrix tf_resource_type=citrix_stf_store_service tf_rpc=ApplyResourceChange @caller=github.com/has hicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_createresource.go:102 tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc timestamp=2024-06-20T15:39:14.181Z 2024-06-20T15:39:14.182Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Received downstream response: @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tf6serverlogging/downstream_request.go:42 diagnostic_warning_count=0 tf_proto_version=6.6 tf_provider _addr=registry.terraform.io/citrix/citrix tf_resource_type=citrix_stf_store_service @module=sdk.proto diagnostic_error_count=1 tf_req_duration_ms=1559 tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc tf_rpc=ApplyResourceChange timestamp=2024-06-20T15:39:14.181Z 2024-06-20T15:39:14.181Z [TRACE] maybeTainted: citrix_stf_store_service.example-stf-store-service encountered an error during creation, so it is now marked as tainted 2024-06-20T15:39:14.183Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:14.183Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for citrix_stf_store_service.example-stf-store-service 2024-06-20T15:39:14.183Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for citrix_stf_store_service.example-stf-store-service 2024-06-20T15:39:14.183Z [TRACE] evalApplyProvisioners: citrix_stf_store_service.example-stf-store-service is tainted, so skipping provisioning 2024-06-20T15:39:14.184Z [TRACE] maybeTainted: citrix_stf_store_service.example-stf-store-service was already tainted, so nothing to do 2024-06-20T15:39:14.182Z [ERROR] provider.terraform-provider-citrix_v0.6.1.exe: Response contains error diagnostic: @module=sdk.proto tf_req_id=27897988-580a-6ca9-9b95-339f143a63dc @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/diag/diagnostics.go:58 diagnos tic_detail="TransactionId: " diagnostic_severity=ERROR diagnostic_summary="Error creating StoreFront StoreService" tf_proto_version=6.6 tf_provider_addr=registry.terraform.io/citrix/citrix tf_resource_type=citrix_stf_store_service tf_rpc=ApplyResourceChange timestamp=2024-06-20T15:39:14 .181Z 2024-06-20T15:39:14.184Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Served request: @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:878 @module=sdk.proto tf_proto_version=6.6 tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_i d=27897988-580a-6ca9-9b95-339f143a63dc tf_resource_type=citrix_stf_store_service tf_rpc=ApplyResourceChange timestamp=2024-06-20T15:39:14.181Z 2024-06-20T15:39:14.184Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:14.184Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for citrix_stf_store_service.example-stf-store-service 2024-06-20T15:39:14.185Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for citrix_stf_store_service.example-stf-store-service 2024-06-20T15:39:14.185Z [TRACE] statemgr.Filesystem: creating backup snapshot at terraform.tfstate.backup 2024-06-20T15:39:14.186Z [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 16 2024-06-20T15:39:14.192Z [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate 2024-06-20T15:39:14.204Z [DEBUG] State storage statemgr.Filesystem declined to persist a state snapshot 2024-06-20T15:39:14.212Z [ERROR] vertex "citrix_stf_store_service.example-stf-store-service" error: Error creating StoreFront StoreService 2024-06-20T15:39:14.218Z [TRACE] vertex "citrix_stf_store_service.example-stf-store-service": visit complete, with errors 2024-06-20T15:39:14.550Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Called provider defined Resource Create: @module=sdk.framework tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=1ebb8782-83d0-766c-41c0-07e2efb1da74 tf_resource_type=citrix_stf_deployment @call er=github.com/hashicorp/terraform-plugin-framework@v1.9.0/internal/fwserver/server_createresource.go:102 tf_rpc=ApplyResourceChange timestamp=2024-06-20T15:39:14.550Z 2024-06-20T15:39:14.550Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Received downstream response: tf_provider_addr=registry.terraform.io/citrix/citrix @module=sdk.proto tf_proto_version=6.6 diagnostic_error_count=1 diagnostic_warning_count=0 tf_req_duration_ms=2185 tf_req_id =1ebb8782-83d0-766c-41c0-07e2efb1da74 tf_resource_type=citrix_stf_deployment @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tf6serverlogging/downstream_request.go:42 tf_rpc=ApplyResourceChange timestamp=2024-06-20T15:39:14.550Z 2024-06-20T15:39:14.550Z [TRACE] maybeTainted: citrix_stf_deployment.example-stf-deployment encountered an error during creation, so it is now marked as tainted 2024-06-20T15:39:14.551Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:14.552Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for citrix_stf_deployment.example-stf-deployment 2024-06-20T15:39:14.552Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for citrix_stf_deployment.example-stf-deployment 2024-06-20T15:39:14.551Z [ERROR] provider.terraform-provider-citrix_v0.6.1.exe: Response contains error diagnostic: @module=sdk.proto diagnostic_detail="TransactionId: " diagnostic_summary="Error creating StoreFront Deployment" tf_proto_version=6.6 tf_provider_addr=registry.terraform.io /citrix/citrix diagnostic_severity=ERROR tf_req_id=1ebb8782-83d0-766c-41c0-07e2efb1da74 tf_resource_type=citrix_stf_deployment tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/diag/diagnostics.go:58 timestamp=2024-06-20T15:39:14.550Z 2024-06-20T15:39:14.556Z [TRACE] evalApplyProvisioners: citrix_stf_deployment.example-stf-deployment is tainted, so skipping provisioning 2024-06-20T15:39:14.556Z [TRACE] provider.terraform-provider-citrix_v0.6.1.exe: Served request: tf_resource_type=citrix_stf_deployment tf_provider_addr=registry.terraform.io/citrix/citrix tf_req_id=1ebb8782-83d0-766c-41c0-07e2efb1da74 tf_rpc=ApplyResourceChange @caller=github.com/hashic orp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:878 @module=sdk.proto tf_proto_version=6.6 timestamp=2024-06-20T15:39:14.550Z 2024-06-20T15:39:14.556Z [TRACE] maybeTainted: citrix_stf_deployment.example-stf-deployment was already tainted, so nothing to do 2024-06-20T15:39:14.556Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:14.556Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for citrix_stf_deployment.example-stf-deployment 2024-06-20T15:39:14.557Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for citrix_stf_deployment.example-stf-deployment 2024-06-20T15:39:14.557Z [TRACE] statemgr.Filesystem: have already backed up original terraform.tfstate to terraform.tfstate.backup on a previous write 2024-06-20T15:39:14.557Z [TRACE] statemgr.Filesystem: no state changes since last snapshot 2024-06-20T15:39:14.557Z [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate 2024-06-20T15:39:14.568Z [DEBUG] State storage statemgr.Filesystem declined to persist a state snapshot 2024-06-20T15:39:14.568Z [ERROR] vertex "citrix_stf_deployment.example-stf-deployment" error: Error creating StoreFront Deployment 2024-06-20T15:39:14.568Z [TRACE] vertex "citrix_stf_deployment.example-stf-deployment": visit complete, with errors 2024-06-20T15:39:14.569Z [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/citrix/citrix\"] (close)" errored, so skipping 2024-06-20T15:39:14.569Z [TRACE] dag/walk: upstream of "root" errored, so skipping 2024-06-20T15:39:14.569Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/azurerm" is in the global cache 2024-06-20T15:39:14.569Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/citrix/citrix" is in the global cache 2024-06-20T15:39:14.569Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/local" is in the global cache 2024-06-20T15:39:14.570Z [TRACE] statemgr.Filesystem: have already backed up original terraform.tfstate to terraform.tfstate.backup on a previous write 2024-06-20T15:39:14.570Z [TRACE] statemgr.Filesystem: no state changes since last snapshot 2024-06-20T15:39:14.570Z [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate ╷ │ Error: Error creating StoreFront StoreService │ │ with citrix_stf_store_service.example-stf-store-service, │ on citrix_stf_store_service.tf line 1, in resource "citrix_stf_store_service" "example-stf-store-service": │ 1: resource "citrix_stf_store_service" "example-stf-store-service" { │ │ TransactionId: ╵ ╷ │ Error: Error creating StoreFront Deployment │ │ with citrix_stf_deployment.example-stf-deployment, │ on sf.tf line 1, in resource "citrix_stf_deployment" "example-stf-deployment": │ 1: resource "citrix_stf_deployment" "example-stf-deployment" { │ │ TransactionId: ╵ 2024-06-20T15:39:14.578Z [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info 2024-06-20T15:39:14.578Z [TRACE] statemgr.Filesystem: unlocked by closing terraform.tfstate 2024-06-20T15:39:14.582Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2024-06-20T15:39:14.588Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/citrix/citrix/0.6.1/windows_amd64/terraform-provider-citrix_v0.6.1.exe pid=2652 2024-06-20T15:39:14.590Z [DEBUG] provider: plugin exited

Thanks Dima

dimi4ik commented 1 week ago

After I reset the storefront, it works. Thanks for the good work 👍

Open a PowerShell command prompt as an Administrator and type: asnp Citrix*
After the modules are imported type: Clear-STFDeployment -Confirm $False This will reset Storefront to its factory state.

xushengl commented 1 week ago

Hi @dimi4ik

Thanks for trying out the StoreFront resources! I notice the StoreFront Deployment and StoreService are being created simultaneously. However, they should have sequential order of StoreService being created after the Deployment. To achieve this, there are 2 methods you may use

  1. Use site_id attribute from citrix_stf_deployment resource to create an dependency chain
    
    resource "citrix_stf_deployment" "example-stf-deployment" {
    host_base_url = "https://ctx-storefront.b001.cloud.com"
    site_id       = "1"
    }

resource "citrix_stf_store_service" "example-stf-store-service" { friendly_name = "ctx-store" site_id = citrix_stf_deployment.example-stf-deployment.site_id virtual_path = "/Citrix/Store" }

2. Add `depends_on` meta-argument for `citrix_stf_store_service` resource

resource "citrix_stf_deployment" "example-stf-deployment" { host_base_url = "https://ctx-storefront.b001.cloud.com" site_id = "1" }

resource "citrix_stf_store_service" "example-stf-store-service" { friendly_name = "ctx-store" site_id = "1" virtual_path = "/Citrix/Store"

depends_on = [
    citrix_stf_deployment.example-stf-deployment
]

}