How can I fill out all the TFE workspaces with respective AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY information? I’ve tried the below, but data.tfe_workspace_ids.all.*.id returns the ORG/workspaceID rather then ORG/workspace name that is needed by tfe_variable/workspace_id. Do I need to use a different datasource to grab all names instead of IDs?
I’ve tried your suggestion, but the code doesn’t appear to work on TFE cloud, the user is an owner and the plan succeeds, only apply fails. Any suggestions how to populate 2 env vars on all existing workspaces in TFE cloud?
My advice would be to try creating a new user token, and double-check that this user is an organization owner. If you still have see the same error, you might find it easier to debug using the Terraform Cloud API directly, and eventually contact Terraform Cloud support.
Hope you get it working—if you do, please post back here!
Hi alisdair,
I don’t think it’s a permission/token issue, the user is the only user and also an owner in CloudTFE. If the user token was not good I wouldn’t be able to make a successful terraform plan on the CLI. When I’m manually queuing a plan in cloudTFE theterraform plan succeeds, only the apply fails.
Do I need to specify other TFE env vars to make this simple var population script work?Currently the TFE vars are empty on the workspace that populates the AWS vars.
I just had to use the TFE_TOKEN environment variable on the workspace, that’s all I needed to know, the user_token was intact.
I think we can mark this resolved. However I’d still like to implement this without the for_each, using length(data.tfe_workspace_ids.all.ids) and element(data.tfe_workspace_ids.all.ids, count.index)- the one my other thread.