aidanmelen / terraform-provider-snowsql

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

feat: `snowsql_exec` name argument should be optional #81

Closed aidanmelen closed 1 year ago

aidanmelen commented 1 year ago

It would be conviently if the name argument for the snowsql_exec resource was optional and defaulted to a random ID when not provided.

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "snowsql_exec" "role" {
  # name = "my_role"

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

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

Expected Behavior

The resource will be assigned a random ID in terraform state.

Actual Behavior

╷
│ Error: Missing required argument
│ 
│   on main.tf line 1, in resource "snowsql_exec" "role":
│    1: resource "snowsql_exec" "role" {
│ 
│ The argument "name" is required, but no definition was found.
╵

Steps to Reproduce

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

  1. terraform apply

Important Factoids

This is how the snowsql_query data source was implemented.

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: