-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicating Deployments using Datasource #329
Comments
Thanks for reaching out @phergoualch. I created a manifest based on your setup and was able to duplicate the deployment. I used version 2.12.0 of the provider, which is what I saw in your output gist. Could you provide your full (relevant) configuration here so I can try again to replicate the problem? As a reference, here's what I used: resource "prefect_flow" "example" {
name = "example-flow"
tags = ["example"]
}
resource "prefect_deployment" "example" {
name = "example-deployment"
description = "Example deployment"
flow_id = prefect_flow.example.id
enforce_parameter_schema = true
entrypoint = "flow.py:hello_world"
job_variables = jsonencode({
"env" : { "some-key" : "some-value" }
})
parameter_openapi_schema = jsonencode({
"type" : "object",
"properties" : {
"some-parameter" : { "type" : "string" }
"some-parameter2" : { "type" : "string" }
}
})
path = "./foo/bar"
tags = ["example"]
work_pool_name = "mitch-testing-pool"
work_queue_name = "default"
}
data "prefect_deployment" "existing" {
id = prefect_deployment.example.id
}
resource "prefect_deployment" "copy" {
name = "copy"
description = "A copy of an existing deployment"
enforce_parameter_schema = data.prefect_deployment.existing.enforce_parameter_schema
entrypoint = data.prefect_deployment.existing.entrypoint
flow_id = data.prefect_deployment.existing.flow_id
job_variables = data.prefect_deployment.existing.job_variables
parameter_openapi_schema = data.prefect_deployment.existing.parameter_openapi_schema
path = data.prefect_deployment.existing.path
tags = data.prefect_deployment.existing.tags
work_pool_name = data.prefect_deployment.existing.work_pool_name
work_queue_name = data.prefect_deployment.existing.work_queue_name
} |
Hey @mitchnielsen, thanks for your answer. It is the same as my answer in #330 as both my issues are linked The deployment output when datasourcing with id
Note that the exisiting deployment was not created using Terraform but Python and it's maybe the cause. Maybe one of the parameters that the Terraform provider is not linking ? |
Thanks, I was able to duplicate a deployment using a datasource so I'm not quite sure how to replicate your issue yet. Some things we can try:
|
@phergoualch - give 2.13.4 a try when you have a chance, we pushed a fix for datasourcing Deployments. |
Community Note
Terraform Version
1.9.8
Affected Resource(s)
data.prefect_deployment
resource.prefect_deployment
Terraform Configuration Files
Debug Output
Panic Output
https://gist.github.com/phergoualch/a0837a64b6f5246cd75be8b233c5512e
Expected Behavior
I would like to be able to datasource a deployment to create a copy with another name and parameters. I was able to do it using a Python script without issues but would like to have it using Terraform
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: