44 lines
No EOL
1 KiB
Go
Executable file
44 lines
No EOL
1 KiB
Go
Executable file
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, },
|
|
},
|
|
}
|
|
} |