aws-service-catalog-engine-for-tfc
aws-service-catalog-engine-for-tfc copied to clipboard
TFC local execution for deploying TRE module
For customer using TFC to deploy this module, they normally create a new TFC workspace using remote
execution mode.
Deploying this module using its default tfe
provider configuration will fail:
│ Error: Error creating team aws-service-catalog for organization wellsiau-org: resource not found
│
│ with tfe_team.provisioning_team,
│ on tfc_auth.tf line 1, in resource "tfe_team" "provisioning_team":
│ 1: resource "tfe_team" "provisioning_team" {
couple potential workaround:
-
Use
local
execution mode and store the credential token fortfe
locally -
Set the
TFE_TOKEN
environment var on the TFC workspace for authentication -
Use secret manager (or Vault) to retrieve the token, probably using an example as shown below.
# Configure the Terraform Cloud / Enterprise provider
provider "tfe" {
hostname = var.tfc_hostname
token = data.aws_secretsmanager_secret_version.tfe_token_secret.secret_string
}
Thanks for this!
I am having the issue you describe - could you please be explicit about how you are storing, and sourcing, the credential token for tfe locally?
In my case, I generated it in the UI, and have tribe both;
- Entering it in my CLI config file as such
`terraform { cloud { organization = "example"
workspaces {
name = "example-engine"
}
} } credentials "app.terraform.io" { token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }`
- Setting a local environment variable as;
export TFE_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Additionally I have changed the TFC workspace setting to local and set the TFE_TOKEN variable there but the "resource not found" error persists
Thanks
@deloitte-lza-test
if you want to test this locally (I still highly recommend to store the token externally , i.e. Secrets Manager)
using the token inside tfe provider block
provider "tfe" {
hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io`
token = var.token
version = "~> 0.48.0"
}
also worth checking if you are using the token with the right permissions to create team in TFC