Any thoughts on why this may be an issue with the ...
# ask-community
d
Any thoughts on why this may be an issue with the terraform provider?
Copy code
resource "prefect_flow" "base_flow" {
  name         = "my-example-flow"
  workspace_id = local.prefect_workspace_id
  tags         = []
  account_id   = local.prefect_account_id
}


resource "prefect_deployment" "base_deployment" {
  name         = "stg--pipeline-testing"
  flow_id      = prefect_flow.base_flow.id
  entrypoint   = "pipeline-testing/main.py:root"
  workspace_id = local.prefect_workspace_id
  account_id   = local.prefect_account_id

  paused = false
  pull_steps = [
    {
      type      = "set_working_directory",
      directory = "/opt/prefect/pre",
    }
  ]

  job_variables = jsonencode({
    "image" : "{mask}.<http://dkr.ecr.us-east-1.amazonaws.com/ml-mono/test/prefect:v1.2.3|dkr.ecr.us-east-1.amazonaws.com/ml-mono/test/prefect:v1.2.3>"
  })

  work_pool_name  = prefect_work_pool.pipeline_work_pool.name
  work_queue_name = "default"

  depends_on = [
    prefect_work_pool.pipeline_work_pool
  ]
}
running terraform apply
Copy code
Plan: 1 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

prefect_flow.base_flow: Modifying... [id=2e70432a-5b85-440a-80f6-d2b5833312d1]
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to prefect_flow.base_flow, provider "provider[\"<http://registry.terraform.io/prefecthq/prefect\|registry.terraform.io/prefecthq/prefect\>"]"
│ produced an unexpected new value: .account_id: inconsistent values for sensitive attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
mac:stg destefano$
1
j
can you share what version of the provider you are using?
👍 1
d
Copy code
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
    prefect = {
      source  = "prefecthq/prefect"
      version = "2.17.1"
    }
  }
}
m
what's in your
provider
section for prefect?
I just tried your config with 2.17.1 and it worked 🤔
d
additional context. • ran apply, flow created but deployment failed. both were missing the account id and workspace id. ◦ deployment failed because of missing ids • added • ran apply, deployment failed with above error
@Mitch Nielsen - provider.tf
Copy code
provider "aws" {
  region = local.aws_region
}

provider "prefect" {
  account_id = local.prefect_account_id
  api_key    = local.prefect_api_key
}
m
are you open to trying
terraform destroy
to start from a fresh state?
d
yea i can do that. but would ideally not have to in the future if similar issues come up
m
also, you can set
account_id
and
workspace_id
on the
provider
section so you don't need to specify them for every resource 👍
👍 1
d
okay that's good to know, ty
m
agreed, that's not ideal and happy to debug with you if you don't want to destroy - just sounds like you got into a weird state from not providing all the required configs
there aren't any sensitive attributes on the
flow
resource, so the error is pretty odd
d
cool that seemed to work after destroying
m
sweet, thanks for confirming
d
ignore the version stuff?
m
sorry, what do you mean?
d
sorry i thought i saw a message saying to attempt using the last minor version release
m
ah I believe that was just to rule out if this was a recently introduced bug. the root cause instead seems to have been the inconsistent state we got into
👍 1
d
gotcha - well thanks for the help!
m
any time 👌