aidanmelen / terraform-provider-snowsql

Terraform SnowSQL provider
https://registry.terraform.io/providers/aidanmelen/snowsql/latest
Other
22 stars 10 forks source link

feat: warn user that update statements are ignored during creation #85

Closed aidanmelen closed 1 year ago

aidanmelen commented 1 year ago

We should warn the user that update statements are ignored when creating a resource while specifying the update block. Only the create and read statements are run during resource creation.

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "snowsql_exec" "role" {
  create {
    statements = "CREATE ROLE IF NOT EXISTS my_role"
  }

  # these will be ignored on creation
  update {
    statements = "ALTER ROLE IF EXISTS my_role SET COMMENT = 'updated with terraform'"
  }

  delete {
    statements = "DROP ROLE IF EXISTS my_role"
  }
}

Expected Behavior

A warning message that says the statements are ignored during creation and until the statements are changed or tainted.

Actual Behavior

The resource silently ignores the update statements.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply