terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

grants on snow pipes requires pipes to be in paused state

Open astanfel opened this issue 4 years ago • 2 comments
trafficstars

Provider Version

v0.25.17

Terraform Version

v1.0.2

Describe the bug

When attempting to deploy a snowflake_pipe_grant to an existing pipe. There is a deployment error stating that the pipe is not in a paused state.

Expected behavior

During the deployment of the grants, the pipe is paused and after the grants are created/modified the pipe is resumed.

Code samples and commands


resource "snowflake_pipe" "pipe" {

  provider = my-provider

  database       = upper(var.my_database)
  schema         = upper(var.my_schema)
  name           = upper(var.pipe_name)
  comment        = var.pipe_comment
  copy_statement = var.copy_statement
  auto_ingest    = var.auto_ingest
}

resource "snowflake_pipe_grant" "operate_grant" {

  database_name = upper(var.my_database)
  schema_name   = upper(var.my_schema)
  pipe_name     = upper(var.pipe_name)

  privilege = "OPERATE"
  roles = [
    upper("${var.role1}"),
    upper("${var.role2}")
  ]

  on_future         = false
  with_grant_option = false
}

Additional context

When I run


ALTER PIPE my_database.my_schema.my_pipe SET PIPE_EXECUTION_PAUSED=true;

Then run the terraform deployment the resources are created. I also had to run a system command to resume the pipe:

select SYSTEM$PIPE_FORCE_RESUME('my_database.my_schema.my_pipe');

I was also able to see that my pipe was in a running state with this system command:

select SYSTEM$PIPE_STATUS('my_database.my_schema.my_pipe');

astanfel avatar Aug 23 '21 20:08 astanfel

Any updates on this one? I have the same issue.

1kazuki1 avatar Jul 07 '22 23:07 1kazuki1

I also am running into this issue as well.

There's no way to change ownership of a pipe without first manually pausing it (outside of terraform)

breathe avatar Jul 28 '22 15:07 breathe

Still a problem. Any chance of an update?

jbcom avatar Feb 21 '23 18:02 jbcom

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

sfc-gh-asawicki avatar Apr 30 '24 16:04 sfc-gh-asawicki