Skip to content

Commit

Permalink
Rename the provider variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Svetlin Ralchev committed Apr 9, 2020
1 parent 80d1cea commit adc16c7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# terraform-provider-prana

A Terraform Provider for Prana

# Getting Started

```hcl
provider "prana" {
sql_driver = "cloudsqlpostgres"
sql_connection = local.prana_sql_connection
}
resource "prana_migration" "publication_api" {
script_dir = "${path.module}/../../database/migration"
}
```
12 changes: 6 additions & 6 deletions prana/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
func NewProvider() *schema.Provider {
configure := func(d *schema.ResourceData) (interface{}, error) {
var (
driver = d.Get("database_driver").(string)
conn = d.Get("database_connection").(string)
driver = d.Get("sql_driver").(string)
conn = d.Get("sql_connection").(string)
)

return sqlx.Open(driver, conn)
Expand All @@ -19,14 +19,14 @@ func NewProvider() *schema.Provider {
return &schema.Provider{
ConfigureFunc: configure,
Schema: map[string]*schema.Schema{
"database_driver": {
"sql_driver": {
Type: schema.TypeString,
Description: "Database Driver",
Description: "SQL Database Driver",
Required: true,
},
"database_connection": {
"sql_connection": {
Type: schema.TypeString,
Description: "Database Connection",
Description: "SQL Database Connection",
Required: true,
},
},
Expand Down

0 comments on commit adc16c7

Please sign in to comment.