Robert Phamle
06/26/2024, 9:59 PMdata "prefect_worker_metadata" "d" {}
resource "prefect_work_pool" "worker_work_pool" {
name = local.work_pool_name
type = "vertex_ai"
paused = false
workspace_id = var.workspace_id
base_job_template = data.prefect_worker_metadata.d.base_job_configs.vertex_ai
}
│ Error: Unsupported attribute
│
│ on ../modules/prefect2_vertex_work_pool/main.tf line 10, in resource "prefect_work_pool" "worker_work_pool":
│ 10: base_job_template = data.prefect_worker_metadata.d.base_job_configs.vertex_ai
│
│ This value does not have any attributes.
Marvin
06/26/2024, 9:59 PMprefect_worker_metadata
is structured within Terraform configurations. The error indicates that base_job_configs
is not a valid attribute of data.prefect_worker_metadata.d
.
Here's a more refined approach:
1. Inspect prefect_worker_metadata
Output:
Use Terraform's output
method to inspect what attributes prefect_worker_metadata
provides. This will help you understand the available fields.
2. Confirm Documentation Details:
Based on Prefect documentation, attributes like base_job_template
should match the actual output or examples given in the guide.
3. Correct Configuration:
Double-check the attributes of data.prefect_worker_metadata
. If base_job_configs
isn’t an attribute, you might need to adapt your configuration based on what's available.
Here is an example process:
### Inspect Metadata Output
hcl
output "metadata" {
value = data.prefect_worker_metadata.d
}
### Adjust Configuration
Ensure you're accessing valid attributes, for example:
hcl
resource "prefect_work_pool" "worker_work_pool" {
name = local.work_pool_name
type = "vertex_ai"
paused = false
workspace_id = var.workspace_id
# Adjust according to the available attributes
base_job_template = data.prefect_worker_metadata.d.<valid_attribute>
}
### Documentation References
- Developing a New Worker Type
- GCP Worker Guide
Please ensure that your version of the Terraform Provider for Prefect and Prefect libraries are up-to-date with the documentation you are referencing.
Feel free to return if you encounter specific attributes or configurations, and I will assist you further.