This repository notes an example of leveraging a project ID output to address the challenge discussed in the below repository-
https://github.com/omeeomi/tfc-project-mgmt/
To reference the certain project from the output the below format can be used-
data.tfe_outputs.projects.nonsensitive_values.< Name of Output>["< Project Name >"]
Example from the main.tf file-
data.tfe_outputs.projects.nonsensitive_values.project_list["ProjectX"]
Name | Version |
---|---|
tfe | n/a |
Name | Type |
---|---|
tfe_workspace.TFC-Test-Workspace | resource |
tfe_outputs.projects | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
hostname | Optional- defaults to Terraform Cloud app.terraform.io . Normally this is only set for self-managed TFE enviroments. |
string |
"app.terraform.io" |
no |
org_name | Name of TFC Organization. | string |
n/a | yes |
token | Token for TFC Organization. | string |
n/a | yes |