Hi
While running the migration tool i got the following error
╷
│ Error: Invalid object key
│
│ on parse_projects.tf line 8, in locals:
│ 7: project_ids_to_names = {
│ 8: for id in local.project_ids : id =>
│ 9: contains(keys(local.projects_response_as_map), id) ? local.projects_response_as_map[id] : id
│ 10: }
│
│ Key expression in 'for' expression must not produce a null value.
It seems its looking for a project id.
Our organization does not have any project configured in terraform cloud so project id returns a null response and fails the migration.
To resolve this we made 2 changes
parse_projects.tf line 2 - 3
we changed to projects_url_response_json = jsondecode(data.http.projects.response_body)["data"] projects_url_response = local.projects_url_response_json == null ? [{id="my-org",attributes={name="default"}}] : local.projects_url_response_json
line 7 to project_ids = toset([for workspace in data.tfe_workspace.all : coalesce(workspace.project_id,"my-org")])
parse_workspaces.tf line 19 project_name = local.project_ids_to_names[coalesce(data.tfe_workspace.all[name].project_id, "zoominfo")]
Also in env0-resources-generator -> terraform_templates -> environments.tftpl it always assumes in repository that you are using https://www.github.com.... but if you use an enterprise git you might have a different url
Hi While running the migration tool i got the following error
It seems its looking for a project id. Our organization does not have any project configured in terraform cloud so project id returns a
null
response and fails the migration. To resolve this we made 2 changesparse_projects.tf
line 2 - 3 we changed toprojects_url_response_json = jsondecode(data.http.projects.response_body)["data"] projects_url_response = local.projects_url_response_json == null ? [{id="my-org",attributes={name="default"}}] : local.projects_url_response_json
project_ids = toset([for workspace in data.tfe_workspace.all : coalesce(workspace.project_id,"my-org")])
parse_workspaces.tf
line 19project_name = local.project_ids_to_names[coalesce(data.tfe_workspace.all[name].project_id, "zoominfo")]
Also in
env0-resources-generator
->terraform_templates
->environments.tftpl
it always assumes inrepository
that you are using https://www.github.com.... but if you use an enterprise git you might have a different url