initial commit
This commit is contained in:
parent
b004058d1a
commit
11ba6b863c
5 changed files with 276 additions and 0 deletions
44
provider.go
Executable file
44
provider.go
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
package provider
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
|
||||
|
||||
"amarth.cloud/app_resource"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Context string
|
||||
}
|
||||
|
||||
func NewProvider() *schema.Provider {
|
||||
p := &schema.Provider{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"context": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "default"
|
||||
},
|
||||
},
|
||||
ResourcesMap: map[strig]*schema.Resource{
|
||||
"App": AppResource(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func AppResource() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
Create: app.AppResource_Create,
|
||||
Read: app.AppResource_Read,
|
||||
Update: app.AppResource_Update,
|
||||
Delete: app.AppResource_Delete,
|
||||
|
||||
Schema: map[string]*schema.Resource{
|
||||
"api_version": { Type: schema.TypeString, Required: true, },
|
||||
"kind": { Type: schema.TypeString, Required: true, },
|
||||
"metadata": { Type: schema.TypeString, Required: true, },
|
||||
"spec": { Type: schema.TypeString, Required: true, },
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue