@maxb thanks for your suggestions.
I use “export TF_LOG=TRACE” to trigger the logger to render messages.
$ terraform apply -auto-approve
2023-05-03T13:12:26.001-0400 [INFO] Terraform version: 1.4.6
2023-05-03T13:12:26.002-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.21.0
2023-05-03T13:12:26.002-0400 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-05-03T13:12:26.002-0400 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2023-05-03T13:12:26.002-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-05-03T13:12:26.002-0400 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2023-05-03T13:12:26.002-0400 [INFO] Go runtime version: go1.19.6
2023-05-03T13:12:26.002-0400 [INFO] CLI args: []string{"terraform", "apply", "-auto-approve"}
2023-05-03T13:12:26.002-0400 [TRACE] Stdout is a terminal of width 129
2023-05-03T13:12:26.002-0400 [TRACE] Stderr is a terminal of width 129
2023-05-03T13:12:26.002-0400 [TRACE] Stdin is a terminal
2023-05-03T13:12:26.002-0400 [DEBUG] Attempting to open CLI config file: /Users/thunt/.terraformrc
2023-05-03T13:12:26.002-0400 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-05-03T13:12:26.002-0400 [INFO] Loading CLI configuration from /Users/thunt/.terraform.d/credentials.tfrc.json
2023-05-03T13:12:26.003-0400 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-05-03T13:12:26.003-0400 [DEBUG] ignoring non-existing provider search directory /Users/thunt/.terraform.d/plugins
2023-05-03T13:12:26.003-0400 [DEBUG] ignoring non-existing provider search directory /Users/thunt/Library/Application Support/io.terraform/plugins
2023-05-03T13:12:26.003-0400 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2023-05-03T13:12:26.003-0400 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2023-05-03T13:12:26.007-0400 [TRACE] Meta.Backend: built configuration for "cloud" backend with hash value 4043148377
2023-05-03T13:12:26.007-0400 [TRACE] Preserving existing state lineage "d7defe5a-7c88-32b0-43b8-9b1c83d19657"
2023-05-03T13:12:26.007-0400 [TRACE] Preserving existing state lineage "d7defe5a-7c88-32b0-43b8-9b1c83d19657"
2023-05-03T13:12:26.008-0400 [TRACE] Meta.Backend: working directory was previously initialized for "cloud" backend
2023-05-03T13:12:26.008-0400 [TRACE] Meta.Backend: using already-initialized, unchanged "cloud" backend configuration
2023-05-03T13:12:26.008-0400 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023-05-03T13:12:26.008-0400 [TRACE] HTTP client GET request to https://app.terraform.io/.well-known/terraform.json
2023-05-03T13:12:26.340-0400 [DEBUG] Service discovery for app.terraform.io aliased as localterraform.com
2023-05-03T13:12:26.782-0400 [TRACE] Meta.Backend: instantiated backend of type *cloud.Cloud
2023-05-03T13:12:26.783-0400 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers
2023-05-03T13:12:26.785-0400 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/null v3.2.1 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/null/3.2.1/darwin_amd64
2023-05-03T13:12:26.786-0400 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/tfe v0.42.0 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/tfe/0.42.0/darwin_amd64
2023-05-03T13:12:26.786-0400 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/null/3.2.1/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/null 3.2.1
2023-05-03T13:12:26.786-0400 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/tfe/0.42.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/tfe 0.42.0
2023-05-03T13:12:26.841-0400 [DEBUG] checking for provisioner in "."
2023-05-03T13:12:26.842-0400 [DEBUG] checking for provisioner in "/Users/thunt/bin"
2023-05-03T13:12:26.842-0400 [TRACE] Meta.Backend: backend *cloud.Cloud supports operations
2023-05-03T13:12:26.976-0400 [INFO] cloud: starting Apply operation
Running apply in Terraform Cloud. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.
Preparing the remote apply...
To view this run in a browser, visit:
https://app.terraform.io/app/citrusoft/infrastructure/runs/run-YZmU86GzVhoKSK3X
Waiting for the plan to start...
Terraform v1.4.6
on linux_amd64
Initializing plugins and modules...
data.tfe_organization.citrusoft: Refreshing...
data.tfe_organization.citrusoft: Refresh complete after 0s [id=org-CKkoi5HWu7uqB8Pc]
╷
│ Warning: Value for undeclared variable
│
│ The root module does not declare a variable named "AWS_ACCESS_KEY_ID" but a
│ value was found in file
│ "/home/tfc-agent/.tfc-agent/component/terraform/runs/run-YZmU86GzVhoKSK3X/terraform.tfvars".
│ If you meant to use this value, add a "variable" block to the
│ configuration.
...
**Plan:** 2 to add, 0 to change, 0 to destroy.
**module.workspaces["930856341568"].tfe_workspace.this: Creating...**
**module.workspaces["123133550781"].tfe_workspace.this: Creating...**
╷
│ **Error:** **Error creating workspace 123133550781 for organization citrusoft: resource not found**
│
│ with module.workspaces["123133550781"].tfe_workspace.this,
│ on modules/workspaces/main.tf line 25, in resource "tfe_workspace" "this":
│ 25: resource "tfe_workspace" "this" {
│
╵
╷
│ **Error:** **Error creating workspace 930856341568 for organization citrusoft: resource not found**
│
│ with module.workspaces["930856341568"].tfe_workspace.this,
│ on modules/workspaces/main.tf line 25, in resource "tfe_workspace" "this":
│ 25: resource "tfe_workspace" "this" {
╵
Operation failed: failed running terraform apply (exit 1)
I am beginning to think that THE ORGANIZATION NOTHING TO DO WITH THE ERROR MESSAGES.
Why is it looking for a variable, AWS_ACCESS_KEY_ID, ? Nothing in here has anything to do with AWS provider.
Could there be something wrong with my submodule specification?
here is my terraform init…
$ terraform init
2023-05-03T13:40:25.062-0400 [INFO] Terraform version: 1.4.6
2023-05-03T13:40:25.063-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.21.0
2023-05-03T13:40:25.063-0400 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-05-03T13:40:25.063-0400 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2023-05-03T13:40:25.063-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-05-03T13:40:25.063-0400 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2023-05-03T13:40:25.063-0400 [INFO] Go runtime version: go1.19.6
2023-05-03T13:40:25.063-0400 [INFO] CLI args: []string{"terraform", "init"}
2023-05-03T13:40:25.063-0400 [TRACE] Stdout is a terminal of width 129
2023-05-03T13:40:25.063-0400 [TRACE] Stderr is a terminal of width 129
2023-05-03T13:40:25.063-0400 [TRACE] Stdin is a terminal
2023-05-03T13:40:25.063-0400 [DEBUG] Attempting to open CLI config file: /Users/thunt/.terraformrc
2023-05-03T13:40:25.063-0400 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-05-03T13:40:25.063-0400 [INFO] Loading CLI configuration from /Users/thunt/.terraform.d/credentials.tfrc.json
2023-05-03T13:40:25.063-0400 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-05-03T13:40:25.063-0400 [DEBUG] ignoring non-existing provider search directory /Users/thunt/.terraform.d/plugins
2023-05-03T13:40:25.064-0400 [DEBUG] ignoring non-existing provider search directory /Users/thunt/Library/Application Support/io.terraform/plugins
2023-05-03T13:40:25.064-0400 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2023-05-03T13:40:25.064-0400 [INFO] CLI command args: []string{"init"}
Initializing Terraform Cloud...
2023-05-03T13:40:25.067-0400 [TRACE] Meta.Backend: built configuration for "cloud" backend with hash value 4043148377
2023-05-03T13:40:25.067-0400 [TRACE] Preserving existing state lineage "d7defe5a-7c88-32b0-43b8-9b1c83d19657"
2023-05-03T13:40:25.067-0400 [TRACE] Preserving existing state lineage "d7defe5a-7c88-32b0-43b8-9b1c83d19657"
2023-05-03T13:40:25.068-0400 [TRACE] Meta.Backend: working directory was previously initialized for "cloud" backend
2023-05-03T13:40:25.068-0400 [TRACE] Meta.Backend: using already-initialized, unchanged "cloud" backend configuration
2023-05-03T13:40:25.068-0400 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023-05-03T13:40:25.068-0400 [TRACE] HTTP client GET request to https://app.terraform.io/.well-known/terraform.json
2023-05-03T13:40:25.442-0400 [DEBUG] Service discovery for app.terraform.io aliased as localterraform.com
2023-05-03T13:40:26.080-0400 [TRACE] Meta.selectWorkspace: the currently selected workspace is present in the configured backend (infrastructure)
2023-05-03T13:40:26.080-0400 [TRACE] Meta.Backend: instantiated backend of type *cloud.Cloud
2023-05-03T13:40:26.082-0400 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers
2023-05-03T13:40:26.083-0400 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/null v3.2.1 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/null/3.2.1/darwin_amd64
2023-05-03T13:40:26.083-0400 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/tfe v0.42.0 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/tfe/0.42.0/darwin_amd64
2023-05-03T13:40:26.083-0400 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/null/3.2.1/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/null 3.2.1
2023-05-03T13:40:26.083-0400 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/tfe/0.42.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/tfe 0.42.0
2023-05-03T13:40:26.143-0400 [DEBUG] checking for provisioner in "."
2023-05-03T13:40:26.143-0400 [DEBUG] checking for provisioner in "/Users/thunt/bin"
2023-05-03T13:40:26.143-0400 [TRACE] Meta.Backend: backend *cloud.Cloud supports operations
Initializing modules...
2023-05-03T13:40:26.950-0400 [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules
2023-05-03T13:40:26.952-0400 [DEBUG] Module installer: begin workspaces
2023-05-03T13:40:26.956-0400 [TRACE] ModuleInstaller: Module installer: workspaces <nil> already installed in modules/workspaces
2023-05-03T13:40:26.956-0400 [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json
Initializing provider plugins...
- Reusing previous version of hashicorp/tfe from the dependency lock file
2023-05-03T13:40:26.961-0400 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2023-05-03T13:40:26.961-0400 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
2023-05-03T13:40:27.089-0400 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/tfe/versions
2023-05-03T13:40:27.089-0400 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/hashicorp/tfe/versions
2023-05-03T13:40:27.191-0400 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers
2023-05-03T13:40:27.192-0400 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/null v3.2.1 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/null/3.2.1/darwin_amd64
2023-05-03T13:40:27.193-0400 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/tfe v0.42.0 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/tfe/0.42.0/darwin_amd64
2023-05-03T13:40:27.193-0400 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/null/3.2.1/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/null 3.2.1
2023-05-03T13:40:27.193-0400 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/tfe/0.42.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/tfe 0.42.0
- Using previously-installed hashicorp/tfe v0.42.0
Terraform Cloud has been successfully initialized!
You may now begin working with Terraform Cloud. Try running "terraform plan" to
see any changes that are required for your infrastructure.
If you ever set or change modules or Terraform Settings, run "terraform init"
again to reinitialize your working directory.
Here is my submodule…
# Create the workspace, line number 24
resource "tfe_workspace" "this" {
name = var.name
organization = var.organization
tag_names = [for tag in var.tag_names : lower(tag)]
}
Hmm… what does this error message mean?
Plan: 2 to add, 0 to change, 0 to destroy.
module.workspaces["123133550781"].tfe_workspace.this: Creating...
module.workspaces["930856341568"].tfe_workspace.this: Creating...
╷
│ Error: Error creating workspace 123133550781 for organization citrusoft: resource not found
│
│ with module.workspaces["123133550781"].tfe_workspace.this,
│ on modules/workspaces/main.tf line 25, in resource "tfe_workspace" "this":
│ 25: resource "tfe_workspace" "this" {
│
╵
╷
│ Error: Error creating workspace 930856341568 for organization citrusoft: resource not found
│
│ with module.workspaces["930856341568"].tfe_workspace.this,
│ on modules/workspaces/main.tf line 25, in resource "tfe_workspace" "this":
│ 25: resource "tfe_workspace" "this" {
│
╵
Operation failed: failed running terraform apply (exit 1)