Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/tftemplate/resource.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

func Resource{{ .Resource }}() *schema.Resource {
return &schema.Resource{
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: Resource{{ .Resource }}Create,
ReadContext: Resource{{ .Resource }}Read,
UpdateContext: Resource{{ .Resource }}Update,
Expand Down
2 changes: 1 addition & 1 deletion internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewTestTools(t *testing.T) *TestTools {
T: t,
Meta: m,
ProviderFactories: map[string]func() (*schema.Provider, error){
"scaleway": func() (*schema.Provider, error) {
"registry.terraform.io/scaleway/scaleway": func() (*schema.Provider, error) {
return provider.Provider(&provider.Config{Meta: m})(), nil
},
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/account/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import (

func ResourceProject() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAccountProjectCreate,
ReadContext: resourceAccountProjectRead,
UpdateContext: resourceAccountProjectUpdate,
DeleteContext: resourceAccountProjectDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: resourceAccountProjectCreate,
ReadContext: resourceAccountProjectRead,
UpdateContext: resourceAccountProjectUpdate,
DeleteContext: resourceAccountProjectDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/applesilicon/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (

func ResourceServer() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceAppleSiliconServerCreate,
ReadContext: ResourceAppleSiliconServerRead,
UpdateContext: ResourceAppleSiliconServerUpdate,
DeleteContext: ResourceAppleSiliconServerDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceAppleSiliconServerCreate,
ReadContext: ResourceAppleSiliconServerRead,
UpdateContext: ResourceAppleSiliconServerUpdate,
DeleteContext: ResourceAppleSiliconServerDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(defaultAppleSiliconServerTimeout),
Default: schema.DefaultTimeout(defaultAppleSiliconServerTimeout),
Expand Down
4 changes: 3 additions & 1 deletion internal/services/az/availability_zones_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import (

func DataSourceAvailabilityZones() *schema.Resource {
return &schema.Resource{
ReadWithoutTimeout: dataSourceAvailabilityZonesRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadWithoutTimeout: dataSourceAvailabilityZonesRead,

Timeouts: &schema.ResourceTimeout{
Read: schema.DefaultTimeout(20 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const (

func DataEasyPartitioning() *schema.Resource {
return &schema.Resource{
ReadContext: dataEasyPartitioningRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: dataEasyPartitioningRead,
Schema: map[string]*schema.Schema{
"offer_id": {
Type: schema.TypeString,
Expand Down
4 changes: 3 additions & 1 deletion internal/services/baremetal/offer_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (

func DataSourceOffer() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceOfferRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: dataSourceOfferRead,

Schema: map[string]*schema.Schema{
"name": {
Expand Down
4 changes: 3 additions & 1 deletion internal/services/baremetal/option_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (

func DataSourceOption() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceOptionRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: dataSourceOptionRead,
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Expand Down
4 changes: 3 additions & 1 deletion internal/services/baremetal/os_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (

func DataSourceOS() *schema.Resource {
return &schema.Resource{
ReadContext: DataSourceOSRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: DataSourceOSRead,
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Expand Down
12 changes: 8 additions & 4 deletions internal/services/baremetal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ import (

func ResourceServer() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceServerCreate,
ReadContext: ResourceServerRead,
UpdateContext: ResourceServerUpdate,
DeleteContext: ResourceServerDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceServerCreate,
ReadContext: ResourceServerRead,
UpdateContext: ResourceServerUpdate,
DeleteContext: ResourceServerDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down Expand Up @@ -301,6 +303,8 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument

func ResourceServerIP() *schema.Resource {
return &schema.Resource{
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Expand Down
4 changes: 3 additions & 1 deletion internal/services/billing/consumption_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (

func DataSourceConsumptions() *schema.Resource {
return &schema.Resource{
ReadContext: DataSourceBillingConsumptionsRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: DataSourceBillingConsumptionsRead,
Schema: map[string]*schema.Schema{
"organization_id": account.OrganizationIDSchema(),
"project_id": account.ProjectIDSchema(),
Expand Down
4 changes: 3 additions & 1 deletion internal/services/billing/invoices_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import (

func DataSourceInvoices() *schema.Resource {
return &schema.Resource{
ReadContext: DataSourceBillingInvoicesRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: DataSourceBillingInvoicesRead,
Schema: map[string]*schema.Schema{
"started_after": {
Type: schema.TypeString,
Expand Down
10 changes: 6 additions & 4 deletions internal/services/block/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (

func ResourceSnapshot() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceBlockSnapshotCreate,
ReadContext: ResourceBlockSnapshotRead,
UpdateContext: ResourceBlockSnapshotUpdate,
DeleteContext: ResourceBlockSnapshotDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceBlockSnapshotCreate,
ReadContext: ResourceBlockSnapshotRead,
UpdateContext: ResourceBlockSnapshotUpdate,
DeleteContext: ResourceBlockSnapshotDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/block/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (

func ResourceVolume() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceBlockVolumeCreate,
ReadContext: ResourceBlockVolumeRead,
UpdateContext: ResourceBlockVolumeUpdate,
DeleteContext: ResourceBlockVolumeDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceBlockVolumeCreate,
ReadContext: ResourceBlockVolumeRead,
UpdateContext: ResourceBlockVolumeUpdate,
DeleteContext: ResourceBlockVolumeDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/cockpit/alert_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import (

func ResourceCockpitAlertManager() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceCockpitAlertManagerCreate,
ReadContext: ResourceCockpitAlertManagerRead,
UpdateContext: ResourceCockpitAlertManagerUpdate,
DeleteContext: ResourceCockpitAlertManagerDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceCockpitAlertManagerCreate,
ReadContext: ResourceCockpitAlertManagerRead,
UpdateContext: ResourceCockpitAlertManagerUpdate,
DeleteContext: ResourceCockpitAlertManagerDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/cockpit/cockpit.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import (

func ResourceCockpit() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceCockpitCreate,
ReadContext: ResourceCockpitRead,
UpdateContext: ResourceCockpitUpdate,
DeleteContext: ResourceCockpitDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceCockpitCreate,
ReadContext: ResourceCockpitRead,
UpdateContext: ResourceCockpitUpdate,
DeleteContext: ResourceCockpitDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
8 changes: 5 additions & 3 deletions internal/services/cockpit/grafana_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ import (

func ResourceCockpitGrafanaUser() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceCockpitGrafanaUserCreate,
ReadContext: ResourceCockpitGrafanaUserRead,
DeleteContext: ResourceCockpitGrafanaUserDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceCockpitGrafanaUserCreate,
ReadContext: ResourceCockpitGrafanaUserRead,
DeleteContext: ResourceCockpitGrafanaUserDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(DefaultCockpitTimeout),
Read: schema.DefaultTimeout(DefaultCockpitTimeout),
Expand Down
10 changes: 6 additions & 4 deletions internal/services/cockpit/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import (

func ResourceCockpitSource() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceCockpitSourceCreate,
ReadContext: ResourceCockpitSourceRead,
UpdateContext: ResourceCockpitSourceUpdate,
DeleteContext: ResourceCockpitSourceDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceCockpitSourceCreate,
ReadContext: ResourceCockpitSourceRead,
UpdateContext: ResourceCockpitSourceUpdate,
DeleteContext: ResourceCockpitSourceDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(DefaultCockpitTimeout),
Read: schema.DefaultTimeout(DefaultCockpitTimeout),
Expand Down
4 changes: 3 additions & 1 deletion internal/services/cockpit/source_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (

func DataSourceCockpitSource() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceCockpitSourceRead,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
ReadContext: dataSourceCockpitSourceRead,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Expand Down
10 changes: 7 additions & 3 deletions internal/services/cockpit/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import (

func ResourceToken() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceCockpitTokenCreate,
ReadContext: ResourceCockpitTokenRead,
DeleteContext: ResourceCockpitTokenDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceCockpitTokenCreate,
ReadContext: ResourceCockpitTokenRead,
DeleteContext: ResourceCockpitTokenDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(DefaultCockpitTimeout),
Read: schema.DefaultTimeout(DefaultCockpitTimeout),
Expand Down Expand Up @@ -72,6 +74,8 @@ func ResourceToken() *schema.Resource {

func resourceCockpitTokenScopes() *schema.Resource {
return &schema.Resource{
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
Schema: map[string]*schema.Schema{
"query_metrics": {
Type: schema.TypeBool,
Expand Down
10 changes: 6 additions & 4 deletions internal/services/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ const (

func ResourceContainer() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceContainerCreate,
ReadContext: ResourceContainerRead,
UpdateContext: ResourceContainerUpdate,
DeleteContext: ResourceContainerDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceContainerCreate,
ReadContext: ResourceContainerRead,
UpdateContext: ResourceContainerUpdate,
DeleteContext: ResourceContainerDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/container/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (

func ResourceCron() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceContainerCronCreate,
ReadContext: ResourceContainerCronRead,
UpdateContext: ResourceContainerCronUpdate,
DeleteContext: ResourceContainerCronDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceContainerCronCreate,
ReadContext: ResourceContainerCronRead,
UpdateContext: ResourceContainerCronUpdate,
DeleteContext: ResourceContainerCronDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
8 changes: 5 additions & 3 deletions internal/services/container/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ import (

func ResourceDomain() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceContainerDomainCreate,
ReadContext: ResourceContainerDomainRead,
DeleteContext: ResourceContainerDomainDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceContainerDomainCreate,
ReadContext: ResourceContainerDomainRead,
DeleteContext: ResourceContainerDomainDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/container/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (

func ResourceNamespace() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceContainerNamespaceCreate,
ReadContext: ResourceContainerNamespaceRead,
UpdateContext: ResourceContainerNamespaceUpdate,
DeleteContext: ResourceContainerNamespaceDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceContainerNamespaceCreate,
ReadContext: ResourceContainerNamespaceRead,
UpdateContext: ResourceContainerNamespaceUpdate,
DeleteContext: ResourceContainerNamespaceDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
8 changes: 5 additions & 3 deletions internal/services/container/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import (

func ResourceToken() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceContainerTokenCreate,
ReadContext: ResourceContainerTokenRead,
DeleteContext: ResourceContainerTokenDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceContainerTokenCreate,
ReadContext: ResourceContainerTokenRead,
DeleteContext: ResourceContainerTokenDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
10 changes: 6 additions & 4 deletions internal/services/container/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (

func ResourceTrigger() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceContainerTriggerCreate,
ReadContext: ResourceContainerTriggerRead,
UpdateContext: ResourceContainerTriggerUpdate,
DeleteContext: ResourceContainerTriggerDelete,
EnableLegacyTypeSystemApplyErrors: true,
EnableLegacyTypeSystemPlanErrors: true,
CreateContext: ResourceContainerTriggerCreate,
ReadContext: ResourceContainerTriggerRead,
UpdateContext: ResourceContainerTriggerUpdate,
DeleteContext: ResourceContainerTriggerDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
Loading
Loading