|
| 1 | +package provider |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + |
| 6 | + "github.com/hashicorp/terraform-plugin-framework/datasource" |
| 7 | + "github.com/hashicorp/terraform-plugin-framework/ephemeral" |
| 8 | + "github.com/hashicorp/terraform-plugin-framework/provider" |
| 9 | + "github.com/hashicorp/terraform-plugin-framework/provider/schema" |
| 10 | + "github.com/hashicorp/terraform-plugin-framework/resource" |
| 11 | +) |
| 12 | + |
| 13 | +var _ provider.Provider = &ScalewayProvider{} |
| 14 | + |
| 15 | +type ScalewayProvider struct{} |
| 16 | + |
| 17 | +func NewFrameworkProvider() func() provider.Provider { |
| 18 | + return func() provider.Provider { |
| 19 | + return &ScalewayProvider{} |
| 20 | + } |
| 21 | +} |
| 22 | + |
| 23 | +func (p *ScalewayProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) { |
| 24 | + resp.TypeName = "scaleway" |
| 25 | +} |
| 26 | + |
| 27 | +func (p *ScalewayProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { |
| 28 | + resp.Schema = schema.Schema{ |
| 29 | + Attributes: map[string]schema.Attribute{ |
| 30 | + "access_key": schema.StringAttribute{ |
| 31 | + Optional: true, |
| 32 | + Description: "The Scaleway access key.", |
| 33 | + }, |
| 34 | + "secret_key": schema.StringAttribute{ |
| 35 | + Optional: true, |
| 36 | + Description: "The Scaleway secret Key.", |
| 37 | + }, |
| 38 | + "profile": schema.StringAttribute{ |
| 39 | + Optional: true, |
| 40 | + Description: "The Scaleway profile to use.", |
| 41 | + }, |
| 42 | + "project_id": schema.StringAttribute{ |
| 43 | + Optional: true, |
| 44 | + Description: "The Scaleway project ID.", |
| 45 | + }, |
| 46 | + "organization_id": schema.StringAttribute{ |
| 47 | + Optional: true, |
| 48 | + Description: "The Scaleway organization ID.", |
| 49 | + }, |
| 50 | + "api_url": schema.StringAttribute{ |
| 51 | + Optional: true, |
| 52 | + Description: "The Scaleway API URL to use.", |
| 53 | + }, |
| 54 | + "region": schema.StringAttribute{ |
| 55 | + Optional: true, |
| 56 | + Description: "The region you want to attach the resource to", |
| 57 | + }, |
| 58 | + "zone": schema.StringAttribute{ |
| 59 | + Description: "The zone you want to attach the resource to", |
| 60 | + Optional: true, |
| 61 | + }, |
| 62 | + }, |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +func (p *ScalewayProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { |
| 67 | +} |
| 68 | + |
| 69 | +func (p *ScalewayProvider) Resources(ctx context.Context) []func() resource.Resource { |
| 70 | + return []func() resource.Resource{} |
| 71 | +} |
| 72 | + |
| 73 | +func (p *ScalewayProvider) EphemeralResources(_ context.Context) []func() ephemeral.EphemeralResource { |
| 74 | + return []func() ephemeral.EphemeralResource{} |
| 75 | +} |
| 76 | + |
| 77 | +func (p *ScalewayProvider) DataSources(_ context.Context) []func() datasource.DataSource { |
| 78 | + return []func() datasource.DataSource{} |
| 79 | +} |
0 commit comments