I need to create Bigquery user defined function/procedure in Terraform
resource "routine" "sproc" {
dataset_id = "cssp"
routine_id = "tf_test_routine_id"
type = "TABLE_VALUED_FUNCTION"
language = "SQL"
definition_body = <<-EOS
SELECT 1 + value AS value
EOS
arguments {
name = "value"
argument_kind = "FIXED_TYPE"
data_type = jsonencode({ "typeKind" : "INT64" })
}
return_table_type = jsonencode({"columns" : [
{ "name" : "value", "type" : { "typeKind" : "INT64" } },
] })
}
