GoogleCloudPlatform / GoogleCloudPlatform/knowledge-catalog-labs
Terraform Plan error in dataplex-quickstart-labs
- Dominant language
- Python
- Stars
- 101
- Forks
- 47
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 4
Description
**Steps to Reproduce**
1. Create a new GCP project
2. Set the env vars on your cloud shell as per Step 2. Declare variables
```
PROJECT_ID=`gcloud config list --format "value(core.project)" 2>/dev/null`
PROJECT_NBR=`gcloud projects describe $PROJECT_ID | grep projectNumber | cut -d':' -f2 | tr -d "'" | xargs`
GCP_ACCOUNT_NAME=`gcloud auth list --filter=status:ACTIVE --format="value(account)"`
ORG_ID=`gcloud organizations list --format="value(name)"`
CLOUD_COMPOSER_IMG_VERSION="composer-2.6.6-airflow-2.5.3"
YOUR_GCP_REGION="us-central1"
YOUR_GCP_ZONE="us-central1-a"
YOUR_GCP_MULTI_REGION="US"
BQ_CONNECTOR_JAR_GCS_URI="gs://spark-lib/bigquery/spark-bigquery-with-dependencies_2.12-0.22.2.jar"
```
3. Run Terraform init
4. Run Terraform Plan `terraform plan \
-var="project_id=${PROJECT_ID}" \
-var="project_number=${PROJECT_NBR}" \
-var="gcp_account_name=${GCP_ACCOUNT_NAME}" \
-var="org_id=${ORG_ID}" \
-var="cloud_composer_image_version=${CLOUD_COMPOSER_IMG_VERSION}" \
-var="gcp_region=${YOUR_GCP_REGION}" \
-var="gcp_zone=${YOUR_GCP_ZONE}" \
-var="gcp_multi_region=${YOUR_GCP_MULTI_REGION}" \
-var="bq_connector_jar_gcs_uri=${BQ_CONNECTOR_JAR_GCS_URI}" `
Expected : Plan is successful without errors
Actual : Error below
Plan: 112 to add, 0 to change, 0 to destroy.
╷
│ Error: Failed to retrieve project, pid: , err: project: required field is not set
│
│ with google_composer_environment.create_cloud_composer_env,
│ on main.tf line 735, in resource "google_composer_environment" "create_cloud_composer_env":
│ 735: resource "google_composer_environment" "create_cloud_composer_env" {
Contributor guide
Research direction
Start by inspecting main.tf at line 735, where the google_composer_environment resource reports the missing project. Reproduce the issue by running Terraform init and the provided Terraform plan command with the listed variables. Done means the plan completes without the project retrieval error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, terraform
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100