From 91e8608291cf32d11bc7a95eb3d450e2f12dd410 Mon Sep 17 00:00:00 2001 From: Toni Kangas Date: Tue, 21 May 2024 14:09:09 +0300 Subject: [PATCH] test: raise errors on data consistency errors --- internal/service/cloud/data_sources.go | 16 ++++-- .../data_source_opensearch_indices.go | 10 +++- .../service/database/data_source_sessions.go | 30 +++++++--- internal/service/database/database_common.go | 6 ++ internal/service/database/logical_database.go | 10 ++-- internal/service/database/mysql.go | 16 ++++-- internal/service/database/opensearch.go | 16 ++++-- internal/service/database/postgresql.go | 16 ++++-- .../service/database/properties/schema.go | 6 +- internal/service/database/redis.go | 16 ++++-- internal/service/database/user.go | 26 ++++++--- internal/service/firewall/firewall.go | 4 ++ internal/service/gateway/connection.go | 12 ++-- internal/service/gateway/gateway.go | 18 ++++-- internal/service/gateway/tunnel.go | 14 +++-- internal/service/ip/data_sources.go | 8 ++- internal/service/ip/floating_ip_address.go | 12 ++-- internal/service/kubernetes/data_sources.go | 6 +- internal/service/kubernetes/kubernetes.go | 12 ++-- internal/service/kubernetes/node_group.go | 16 ++++-- internal/service/loadbalancer/backend.go | 16 ++++-- .../service/loadbalancer/backend_member.go | 24 ++++---- .../loadbalancer/backend_tls_config.go | 12 ++-- .../dynamic_certificate_bundle.go | 12 ++-- internal/service/loadbalancer/frontend.go | 18 ++++-- .../service/loadbalancer/frontend_rule.go | 20 ++++--- .../loadbalancer/frontend_rule_actions.go | 10 ++++ .../loadbalancer/frontend_rule_matchers.go | 56 ++++++++++++++----- .../loadbalancer/frontend_tls_config.go | 12 ++-- internal/service/loadbalancer/loadbalancer.go | 26 ++++++--- .../loadbalancer/manual_certificate_bundle.go | 12 ++-- internal/service/loadbalancer/resolver.go | 12 ++-- .../managed_object_storage.go | 20 ++++--- .../policies_data_source.go | 10 +++- .../service/managedobjectstorage/policy.go | 10 ++-- internal/service/managedobjectstorage/user.go | 10 ++-- .../managedobjectstorage/user_access_key.go | 12 ++-- .../managedobjectstorage/user_policy.go | 10 ++-- internal/service/network/data_sources.go | 12 +++- .../service/objectstorage/objectstorage.go | 4 ++ internal/service/router/router.go | 4 ++ internal/service/server/server.go | 24 ++++++-- internal/service/servergroup/servergroup.go | 10 ++-- internal/service/storage/backup_rule.go | 2 + internal/service/storage/data_sources.go | 2 + internal/service/storage/storage.go | 16 ++++-- internal/service/tag/data_sources.go | 8 ++- internal/service/tag/tag.go | 12 ++-- 48 files changed, 455 insertions(+), 211 deletions(-) diff --git a/internal/service/cloud/data_sources.go b/internal/service/cloud/data_sources.go index 228953fc..744cd3a2 100644 --- a/internal/service/cloud/data_sources.go +++ b/internal/service/cloud/data_sources.go @@ -21,6 +21,8 @@ const ( func DataSourceHosts() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Description: `Returns a list of available UpCloud hosts. A host identifies the host server that virtual machines are run on. Only hosts on private cloud to which the calling account has access to are available through this resource.`, @@ -30,6 +32,8 @@ func DataSourceHosts() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "host_id": { Type: schema.TypeInt, @@ -86,8 +90,10 @@ func dataSourceHostsRead(ctx context.Context, d *schema.ResourceData, meta inter func DataSourceZone() *schema.Resource { return &schema.Resource{ - Description: "Data-source is deprecated.", - ReadContext: resourceZoneRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Data-source is deprecated.", + ReadContext: resourceZoneRead, Schema: map[string]*schema.Schema{ "name": { Description: "Unique lablel for the zone", @@ -148,8 +154,10 @@ func resourceZoneRead(ctx context.Context, d *schema.ResourceData, meta interfac func DataSourceZones() *schema.Resource { return &schema.Resource{ - Description: "Data-source is deprecated.", - ReadContext: dataSourceZonesRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Data-source is deprecated.", + ReadContext: dataSourceZonesRead, Schema: map[string]*schema.Schema{ "zone_ids": { Type: schema.TypeSet, diff --git a/internal/service/database/data_source_opensearch_indices.go b/internal/service/database/data_source_opensearch_indices.go index 5d06e3e5..bc880634 100644 --- a/internal/service/database/data_source_opensearch_indices.go +++ b/internal/service/database/data_source_opensearch_indices.go @@ -13,8 +13,10 @@ import ( func DataSourceOpenSearchIndices() *schema.Resource { return &schema.Resource{ - Description: "OpenSearch indices", - ReadContext: dataSourceOpenSearchIndicesRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "OpenSearch indices", + ReadContext: dataSourceOpenSearchIndicesRead, Schema: map[string]*schema.Schema{ "indices": { Description: "Available indices for OpenSearch", @@ -35,7 +37,9 @@ func DataSourceOpenSearchIndices() *schema.Resource { func schemaOpenSearchIndex() *schema.Resource { return &schema.Resource{ - Description: "OpenSearch index", + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "OpenSearch index", Schema: map[string]*schema.Schema{ "create_time": { Description: "Timestamp indicating the creation time of the index.", diff --git a/internal/service/database/data_source_sessions.go b/internal/service/database/data_source_sessions.go index e8d6644f..08aabf9d 100644 --- a/internal/service/database/data_source_sessions.go +++ b/internal/service/database/data_source_sessions.go @@ -15,8 +15,10 @@ import ( func DataSourceSessionsMySQL() *schema.Resource { return &schema.Resource{ - Description: "Current sessions of a MySQL managed database", - ReadContext: dataSourceSessionsMySQLRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Current sessions of a MySQL managed database", + ReadContext: dataSourceSessionsMySQLRead, Schema: utils.JoinSchemas( schemaDataSourceSessionsCommon(), schemaDataSourceSessionsMySQL(), @@ -26,8 +28,10 @@ func DataSourceSessionsMySQL() *schema.Resource { func DataSourceSessionsPostgreSQL() *schema.Resource { return &schema.Resource{ - Description: "Current sessions of a PostgreSQL managed database", - ReadContext: dataSourceSessionsPostgreSQLRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Current sessions of a PostgreSQL managed database", + ReadContext: dataSourceSessionsPostgreSQLRead, Schema: utils.JoinSchemas( schemaDataSourceSessionsCommon(), schemaDataSourceSessionsPostgreSQL(), @@ -37,8 +41,10 @@ func DataSourceSessionsPostgreSQL() *schema.Resource { func DataSourceSessionsRedis() *schema.Resource { return &schema.Resource{ - Description: "Current sessions of a Redis managed database", - ReadContext: dataSourceSessionsRedisRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Current sessions of a Redis managed database", + ReadContext: dataSourceSessionsRedisRead, Schema: utils.JoinSchemas( schemaDataSourceSessionsCommon(), schemaDataSourceSessionsRedis(), @@ -113,7 +119,9 @@ func schemaDataSourceSessionsRedis() map[string]*schema.Schema { func schemaDatabaseSessionMySQL() *schema.Resource { return &schema.Resource{ - Description: "MySQL session", + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "MySQL session", Schema: map[string]*schema.Schema{ "application_name": { Description: "Name of the application that is connected to this service.", @@ -161,7 +169,9 @@ func schemaDatabaseSessionMySQL() *schema.Resource { func schemaDatabaseSessionPostgreSQL() *schema.Resource { return &schema.Resource{ - Description: "PostgreSQL session", + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "PostgreSQL session", Schema: map[string]*schema.Schema{ "application_name": { Description: "Name of the application that is connected to this service.", @@ -278,7 +288,9 @@ func schemaDatabaseSessionPostgreSQL() *schema.Resource { func schemaDatabaseSessionRedis() *schema.Resource { return &schema.Resource{ - Description: "Redis session", + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Redis session", Schema: map[string]*schema.Schema{ "active_channel_subscriptions": { Description: "Number of active channel subscriptions", diff --git a/internal/service/database/database_common.go b/internal/service/database/database_common.go index 4cf6afe3..3e738fc2 100644 --- a/internal/service/database/database_common.go +++ b/internal/service/database/database_common.go @@ -118,6 +118,8 @@ func schemaDatabaseComponents() *schema.Schema { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "component": { Description: "Type of the component", @@ -157,6 +159,8 @@ func schemaDatabaseNetwork() *schema.Schema { MaxItems: 8, MinItems: 1, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "name": { Description: "The name of the network. Must be unique within the service.", @@ -223,6 +227,8 @@ func schemaDatabaseNodeStates() *schema.Schema { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "name": { Description: "Name plus a node iteration", diff --git a/internal/service/database/logical_database.go b/internal/service/database/logical_database.go index b7bf8673..8a995016 100644 --- a/internal/service/database/logical_database.go +++ b/internal/service/database/logical_database.go @@ -18,10 +18,12 @@ import ( func ResourceLogicalDatabase() *schema.Resource { return &schema.Resource{ - Description: "This resource represents a logical database in managed database", - CreateContext: resourceLogicalDatabaseCreate, - ReadContext: resourceLogicalDatabaseRead, - DeleteContext: resourceLogicalDatabaseDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents a logical database in managed database", + CreateContext: resourceLogicalDatabaseCreate, + ReadContext: resourceLogicalDatabaseRead, + DeleteContext: resourceLogicalDatabaseDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/database/mysql.go b/internal/service/database/mysql.go index a1b7c811..4d49e4be 100644 --- a/internal/service/database/mysql.go +++ b/internal/service/database/mysql.go @@ -12,11 +12,13 @@ import ( func ResourceMySQL() *schema.Resource { return &schema.Resource{ - Description: serviceDescription("MySQL"), - CreateContext: resourceMySQLCreate, - ReadContext: resourceMySQLRead, - UpdateContext: resourceMySQLUpdate, - DeleteContext: resourceDatabaseDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: serviceDescription("MySQL"), + CreateContext: resourceMySQLCreate, + ReadContext: resourceMySQLRead, + UpdateContext: resourceMySQLUpdate, + DeleteContext: resourceDatabaseDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -63,7 +65,9 @@ func schemaMySQLEngine() map[string]*schema.Schema { Computed: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypeMySQL), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypeMySQL), }, }, } diff --git a/internal/service/database/opensearch.go b/internal/service/database/opensearch.go index 9e1da666..88e59bf0 100644 --- a/internal/service/database/opensearch.go +++ b/internal/service/database/opensearch.go @@ -14,11 +14,13 @@ import ( func ResourceOpenSearch() *schema.Resource { return &schema.Resource{ - Description: serviceDescription("OpenSearch"), - CreateContext: resourceOpenSearchCreate, - ReadContext: resourceOpenSearchRead, - UpdateContext: resourceOpenSearchUpdate, - DeleteContext: resourceDatabaseDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: serviceDescription("OpenSearch"), + CreateContext: resourceOpenSearchCreate, + ReadContext: resourceOpenSearchRead, + UpdateContext: resourceOpenSearchUpdate, + DeleteContext: resourceDatabaseDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -110,7 +112,9 @@ func schemaOpenSearchEngine() map[string]*schema.Schema { Computed: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypeOpenSearch), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypeOpenSearch), }, }, } diff --git a/internal/service/database/postgresql.go b/internal/service/database/postgresql.go index 1353c75f..2eb10960 100644 --- a/internal/service/database/postgresql.go +++ b/internal/service/database/postgresql.go @@ -13,11 +13,13 @@ import ( func ResourcePostgreSQL() *schema.Resource { return &schema.Resource{ - Description: serviceDescription("PostgreSQL"), - CreateContext: resourcePostgreSQLCreate, - ReadContext: resourcePostgreSQLRead, - UpdateContext: resourcePostgreSQLUpdate, - DeleteContext: resourceDatabaseDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: serviceDescription("PostgreSQL"), + CreateContext: resourcePostgreSQLCreate, + ReadContext: resourcePostgreSQLRead, + UpdateContext: resourcePostgreSQLUpdate, + DeleteContext: resourceDatabaseDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -107,7 +109,9 @@ func schemaPostgreSQLEngine() map[string]*schema.Schema { Computed: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypePostgreSQL), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypePostgreSQL), }, }, } diff --git a/internal/service/database/properties/schema.go b/internal/service/database/properties/schema.go index 3ef1ed79..90eee611 100644 --- a/internal/service/database/properties/schema.go +++ b/internal/service/database/properties/schema.go @@ -181,7 +181,11 @@ func getSchema(key string, prop upcloud.ManagedDatabaseServiceProperty) (*schema s.Type = schema.TypeList s.MaxItems = 1 - s.Elem = &schema.Resource{Schema: nested} + s.Elem = &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: nested, + } default: return nil, fmt.Errorf(`unknown property value type "%s"`, prop.Type) } diff --git a/internal/service/database/redis.go b/internal/service/database/redis.go index b9df8404..cf730902 100644 --- a/internal/service/database/redis.go +++ b/internal/service/database/redis.go @@ -12,11 +12,13 @@ import ( func ResourceRedis() *schema.Resource { return &schema.Resource{ - Description: serviceDescription("Redis"), - CreateContext: resourceRedisCreate, - ReadContext: resourceRedisRead, - UpdateContext: resourceRedisUpdate, - DeleteContext: resourceDatabaseDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: serviceDescription("Redis"), + CreateContext: resourceRedisCreate, + ReadContext: resourceRedisRead, + UpdateContext: resourceRedisUpdate, + DeleteContext: resourceDatabaseDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -63,7 +65,9 @@ func schemaRedisEngine() map[string]*schema.Schema { Computed: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypeRedis), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: properties.GetSchemaMap(upcloud.ManagedDatabaseServiceTypeRedis), }, }, } diff --git a/internal/service/database/user.go b/internal/service/database/user.go index 1e702bfb..7410f85f 100644 --- a/internal/service/database/user.go +++ b/internal/service/database/user.go @@ -16,11 +16,13 @@ import ( func ResourceUser() *schema.Resource { return &schema.Resource{ - Description: "This resource represents a user in managed database", - CreateContext: resourceUserCreate, - ReadContext: resourceUserRead, - UpdateContext: resourceUserUpdate, - DeleteContext: resourceUserDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents a user in managed database", + CreateContext: resourceUserCreate, + ReadContext: resourceUserRead, + UpdateContext: resourceUserUpdate, + DeleteContext: resourceUserDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -72,7 +74,9 @@ func schemaUser() map[string]*schema.Schema { Optional: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: schemaPostgreSQLUserAccessControl(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: schemaPostgreSQLUserAccessControl(), }, }, "redis_access_control": { @@ -81,7 +85,9 @@ func schemaUser() map[string]*schema.Schema { Optional: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: schemaRedisUserAccessControl(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: schemaRedisUserAccessControl(), }, }, "opensearch_access_control": { @@ -90,7 +96,9 @@ func schemaUser() map[string]*schema.Schema { Optional: true, MaxItems: 1, Elem: &schema.Resource{ - Schema: schemaOpenSearchUserAccessControl(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: schemaOpenSearchUserAccessControl(), }, }, } @@ -155,6 +163,8 @@ func schemaOpenSearchUserAccessControl() map[string]*schema.Schema { Type: schema.TypeList, Required: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "index": { Description: "Set index name, pattern or top level API.", diff --git a/internal/service/firewall/firewall.go b/internal/service/firewall/firewall.go index 3200ed6c..80f98754 100644 --- a/internal/service/firewall/firewall.go +++ b/internal/service/firewall/firewall.go @@ -17,6 +17,8 @@ import ( func ResourceFirewallRules() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Description: `This resource represents a generated list of UpCloud firewall rules. Firewall rules are used in conjunction with UpCloud servers. Each server has its own firewall rules. @@ -47,6 +49,8 @@ func ResourceFirewallRules() *schema.Resource { MaxItems: 1000, Required: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "direction": { Type: schema.TypeString, diff --git a/internal/service/gateway/connection.go b/internal/service/gateway/connection.go index a921ad5a..a7318214 100644 --- a/internal/service/gateway/connection.go +++ b/internal/service/gateway/connection.go @@ -15,10 +15,12 @@ import ( func ResourceConnection() *schema.Resource { return &schema.Resource{ - CreateContext: resourceConnectionCreate, - ReadContext: resourceConnectionRead, - UpdateContext: resourceConnectionUpdate, - DeleteContext: resourceConnectionDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + CreateContext: resourceConnectionCreate, + ReadContext: resourceConnectionRead, + UpdateContext: resourceConnectionUpdate, + DeleteContext: resourceConnectionDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -179,6 +181,8 @@ func resourceConnectionDelete(ctx context.Context, d *schema.ResourceData, meta func gatewayRouteSchema() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "type": { Description: "Type of route; currently the only supported type is 'static'", diff --git a/internal/service/gateway/gateway.go b/internal/service/gateway/gateway.go index d68cfd28..b299d381 100644 --- a/internal/service/gateway/gateway.go +++ b/internal/service/gateway/gateway.go @@ -34,11 +34,13 @@ const ( func ResourceGateway() *schema.Resource { return &schema.Resource{ - Description: "Network gateways connect SDN Private Networks to external IP networks.", - CreateContext: resourceGatewayCreate, - ReadContext: resourceGatewayRead, - UpdateContext: resourceGatewayUpdate, - DeleteContext: resourceGatewayDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Network gateways connect SDN Private Networks to external IP networks.", + CreateContext: resourceGatewayCreate, + ReadContext: resourceGatewayRead, + UpdateContext: resourceGatewayUpdate, + DeleteContext: resourceGatewayDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -73,6 +75,8 @@ func ResourceGateway() *schema.Resource { MaxItems: 1, MinItems: 1, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "id": { Description: routerIDDescription, @@ -108,6 +112,8 @@ func ResourceGateway() *schema.Resource { Type: schema.TypeSet, MaxItems: 1, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "address": { Type: schema.TypeString, @@ -140,6 +146,8 @@ func ResourceGateway() *schema.Resource { Computed: true, Type: schema.TypeSet, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "address": { Type: schema.TypeString, diff --git a/internal/service/gateway/tunnel.go b/internal/service/gateway/tunnel.go index f0d5118e..00976c39 100644 --- a/internal/service/gateway/tunnel.go +++ b/internal/service/gateway/tunnel.go @@ -40,10 +40,12 @@ var allowedDHGroups = []int{2, 5, 14, 15, 16, 18, 19, 20, 21, 24} func ResourceTunnel() *schema.Resource { return &schema.Resource{ - CreateContext: resourceTunnelCreate, - ReadContext: resourceTunnelRead, - UpdateContext: resourceTunnelUpdate, - DeleteContext: resourceTunnelDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + CreateContext: resourceTunnelCreate, + ReadContext: resourceTunnelRead, + UpdateContext: resourceTunnelUpdate, + DeleteContext: resourceTunnelDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -372,6 +374,8 @@ func setTunnelResourceData(d *schema.ResourceData, tunnel *upcloud.GatewayTunnel func ipsecAuthPSKSchema() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "psk": { Description: "The pre-shared key. This value is only used during resource creation and is not returned in the state. It is not possible to update this value. If you need to update it, delete the connection and create a new one.", @@ -389,6 +393,8 @@ func ipsecAuthPSKSchema() *schema.Resource { func ipsecPropertiesSchema() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "child_rekey_time": { Description: "IKE child SA rekey time in seconds.", diff --git a/internal/service/ip/data_sources.go b/internal/service/ip/data_sources.go index d3c06411..a433b531 100644 --- a/internal/service/ip/data_sources.go +++ b/internal/service/ip/data_sources.go @@ -11,13 +11,17 @@ import ( func DataSourceIPAddresses() *schema.Resource { return &schema.Resource{ - Description: "Returns a set of IP Addresses that are associated with the UpCloud account.", - ReadContext: dataSourceIPAddressesRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Returns a set of IP Addresses that are associated with the UpCloud account.", + ReadContext: dataSourceIPAddressesRead, Schema: map[string]*schema.Schema{ "addresses": { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "access": { Type: schema.TypeString, diff --git a/internal/service/ip/floating_ip_address.go b/internal/service/ip/floating_ip_address.go index 778bad43..8379cdf8 100644 --- a/internal/service/ip/floating_ip_address.go +++ b/internal/service/ip/floating_ip_address.go @@ -14,11 +14,13 @@ import ( func ResourceFloatingIPAddress() *schema.Resource { return &schema.Resource{ - Description: "This resource represents a UpCloud floating IP address resource.", - CreateContext: resourceFloatingIPAddressCreate, - ReadContext: resourceFloatingIPAddressRead, - UpdateContext: resourceFloatingIPAddressUpdate, - DeleteContext: resourceFloatingIPAddressDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents a UpCloud floating IP address resource.", + CreateContext: resourceFloatingIPAddressCreate, + ReadContext: resourceFloatingIPAddressRead, + UpdateContext: resourceFloatingIPAddressUpdate, + DeleteContext: resourceFloatingIPAddressDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/kubernetes/data_sources.go b/internal/service/kubernetes/data_sources.go index da63a1f5..74b10e93 100644 --- a/internal/service/kubernetes/data_sources.go +++ b/internal/service/kubernetes/data_sources.go @@ -51,8 +51,10 @@ type kubeconfigUserData struct { func DataSourceCluster() *schema.Resource { return &schema.Resource{ - Description: "Managed Kubernetes cluster details. Please refer to https://www.terraform.io/language/state/sensitive-data to keep the credential data as safe as possible.", - ReadContext: dataSourceClusterRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Managed Kubernetes cluster details. Please refer to https://www.terraform.io/language/state/sensitive-data to keep the credential data as safe as possible.", + ReadContext: dataSourceClusterRead, Schema: map[string]*schema.Schema{ "client_certificate": { Description: clientCertificateDescription, diff --git a/internal/service/kubernetes/kubernetes.go b/internal/service/kubernetes/kubernetes.go index fa599c31..45d2f050 100644 --- a/internal/service/kubernetes/kubernetes.go +++ b/internal/service/kubernetes/kubernetes.go @@ -37,11 +37,13 @@ const ( func ResourceCluster() *schema.Resource { return &schema.Resource{ - Description: "This resource represents a [Managed Kubernetes](https://upcloud.com/products/managed-kubernetes) cluster.", - CreateContext: resourceClusterCreate, - ReadContext: resourceClusterRead, - UpdateContext: resourceClusterUpdate, - DeleteContext: resourceClusterDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents a [Managed Kubernetes](https://upcloud.com/products/managed-kubernetes) cluster.", + CreateContext: resourceClusterCreate, + ReadContext: resourceClusterRead, + UpdateContext: resourceClusterUpdate, + DeleteContext: resourceClusterDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/kubernetes/node_group.go b/internal/service/kubernetes/node_group.go index e5c490f0..e4f7aca7 100644 --- a/internal/service/kubernetes/node_group.go +++ b/internal/service/kubernetes/node_group.go @@ -16,11 +16,13 @@ import ( func ResourceNodeGroup() *schema.Resource { return &schema.Resource{ - Description: "This resource represents a node group in a Managed Kubernetes cluster.", - CreateContext: resourceNodeGroupCreate, - ReadContext: resourceNodeGroupRead, - DeleteContext: resourceNodeGroupDelete, - UpdateContext: resourceNodeGroupUpdate, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents a node group in a Managed Kubernetes cluster.", + CreateContext: resourceNodeGroupCreate, + ReadContext: resourceNodeGroupRead, + DeleteContext: resourceNodeGroupDelete, + UpdateContext: resourceNodeGroupUpdate, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -73,6 +75,8 @@ func ResourceNodeGroup() *schema.Resource { Optional: true, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "key": { Description: "Kubelet argument key.", @@ -97,6 +101,8 @@ func ResourceNodeGroup() *schema.Resource { Optional: true, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "effect": { Description: "Taint effect.", diff --git a/internal/service/loadbalancer/backend.go b/internal/service/loadbalancer/backend.go index 3744d36c..b4404ea0 100644 --- a/internal/service/loadbalancer/backend.go +++ b/internal/service/loadbalancer/backend.go @@ -15,11 +15,13 @@ import ( func ResourceBackend() *schema.Resource { return &schema.Resource{ - Description: "This resource represents load balancer backend service", - CreateContext: resourceBackendCreate, - ReadContext: resourceBackendRead, - UpdateContext: resourceBackendUpdate, - DeleteContext: resourceBackendDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents load balancer backend service", + CreateContext: resourceBackendCreate, + ReadContext: resourceBackendRead, + UpdateContext: resourceBackendUpdate, + DeleteContext: resourceBackendDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -57,7 +59,9 @@ func ResourceBackend() *schema.Resource { MaxItems: 1, Computed: true, Elem: &schema.Resource{ - Schema: schemaBackendProperties(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: schemaBackendProperties(), }, }, "tls_configs": { diff --git a/internal/service/loadbalancer/backend_member.go b/internal/service/loadbalancer/backend_member.go index 65d2f14b..23fcef31 100644 --- a/internal/service/loadbalancer/backend_member.go +++ b/internal/service/loadbalancer/backend_member.go @@ -16,11 +16,13 @@ import ( func ResourceStaticBackendMember() *schema.Resource { return &schema.Resource{ - Description: "This resource represents load balancer's static backend member", - CreateContext: resourceBackendMemberCreateFunc(upcloud.LoadBalancerBackendMemberTypeStatic), - ReadContext: resourceBackendMemberRead, - UpdateContext: resourceBackendMemberUpdate, - DeleteContext: resourceBackendMemberDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents load balancer's static backend member", + CreateContext: resourceBackendMemberCreateFunc(upcloud.LoadBalancerBackendMemberTypeStatic), + ReadContext: resourceBackendMemberRead, + UpdateContext: resourceBackendMemberUpdate, + DeleteContext: resourceBackendMemberDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -75,11 +77,13 @@ func ResourceStaticBackendMember() *schema.Resource { func ResourceDynamicBackendMember() *schema.Resource { return &schema.Resource{ - Description: "This resource represents load balancer's dynamic backend member", - CreateContext: resourceBackendMemberCreateFunc(upcloud.LoadBalancerBackendMemberTypeDynamic), - ReadContext: resourceBackendMemberRead, - UpdateContext: resourceBackendMemberUpdate, - DeleteContext: resourceBackendMemberDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents load balancer's dynamic backend member", + CreateContext: resourceBackendMemberCreateFunc(upcloud.LoadBalancerBackendMemberTypeDynamic), + ReadContext: resourceBackendMemberRead, + UpdateContext: resourceBackendMemberUpdate, + DeleteContext: resourceBackendMemberDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/loadbalancer/backend_tls_config.go b/internal/service/loadbalancer/backend_tls_config.go index e0d3feb3..16b1c501 100644 --- a/internal/service/loadbalancer/backend_tls_config.go +++ b/internal/service/loadbalancer/backend_tls_config.go @@ -14,11 +14,13 @@ import ( func ResourceBackendTLSConfig() *schema.Resource { return &schema.Resource{ - Description: "This resource represents backend TLS config", - CreateContext: resourceBackendTLSConfigCreate, - ReadContext: resourceBackendTLSConfigRead, - UpdateContext: resourceBackendTLSConfigUpdate, - DeleteContext: resourceBackendTLSConfigDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents backend TLS config", + CreateContext: resourceBackendTLSConfigCreate, + ReadContext: resourceBackendTLSConfigRead, + UpdateContext: resourceBackendTLSConfigUpdate, + DeleteContext: resourceBackendTLSConfigDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/loadbalancer/dynamic_certificate_bundle.go b/internal/service/loadbalancer/dynamic_certificate_bundle.go index 8a3f73c7..55ec754d 100644 --- a/internal/service/loadbalancer/dynamic_certificate_bundle.go +++ b/internal/service/loadbalancer/dynamic_certificate_bundle.go @@ -16,11 +16,13 @@ import ( func ResourceDynamicCertificateBundle() *schema.Resource { return &schema.Resource{ - Description: "This resource represents dynamic certificate bundle", - CreateContext: resourceDynamicCertificateBundleCreate, - ReadContext: resourceDynamicCertificateBundleRead, - UpdateContext: resourceDynamicCertificateBundleUpdate, - DeleteContext: resourceCertificateBundleDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents dynamic certificate bundle", + CreateContext: resourceDynamicCertificateBundleCreate, + ReadContext: resourceDynamicCertificateBundleRead, + UpdateContext: resourceDynamicCertificateBundleUpdate, + DeleteContext: resourceCertificateBundleDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/loadbalancer/frontend.go b/internal/service/loadbalancer/frontend.go index cccad206..eea68fb6 100644 --- a/internal/service/loadbalancer/frontend.go +++ b/internal/service/loadbalancer/frontend.go @@ -15,11 +15,13 @@ import ( func ResourceFrontend() *schema.Resource { return &schema.Resource{ - Description: "This resource represents load balancer frontend service", - CreateContext: resourceFrontendCreate, - ReadContext: resourceFrontendRead, - UpdateContext: resourceFrontendUpdate, - DeleteContext: resourceFrontendDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents load balancer frontend service", + CreateContext: resourceFrontendCreate, + ReadContext: resourceFrontendRead, + UpdateContext: resourceFrontendUpdate, + DeleteContext: resourceFrontendDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -83,7 +85,9 @@ func ResourceFrontend() *schema.Resource { MaxItems: 1, Computed: true, Elem: &schema.Resource{ - Schema: schemaFrontendProperties(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: schemaFrontendProperties(), }, }, "networks": { @@ -92,6 +96,8 @@ func ResourceFrontend() *schema.Resource { Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "name": { Description: "Name of the load balancer network", diff --git a/internal/service/loadbalancer/frontend_rule.go b/internal/service/loadbalancer/frontend_rule.go index 368a38b0..0b80cbbb 100644 --- a/internal/service/loadbalancer/frontend_rule.go +++ b/internal/service/loadbalancer/frontend_rule.go @@ -16,11 +16,13 @@ import ( func ResourceFrontendRule() *schema.Resource { return &schema.Resource{ - Description: "This resource represents load balancer frontend rule", - CreateContext: resourceFrontendRuleCreate, - ReadContext: resourceFrontendRuleRead, - UpdateContext: resourceFrontendRuleUpdate, - DeleteContext: resourceFrontendRuleDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents load balancer frontend rule", + CreateContext: resourceFrontendRuleCreate, + ReadContext: resourceFrontendRuleRead, + UpdateContext: resourceFrontendRuleUpdate, + DeleteContext: resourceFrontendRuleDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -55,7 +57,9 @@ func ResourceFrontendRule() *schema.Resource { MaxItems: 1, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatchersSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatchersSchema(), }, }, "actions": { @@ -65,7 +69,9 @@ func ResourceFrontendRule() *schema.Resource { MaxItems: 1, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleActionsSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleActionsSchema(), }, }, }, diff --git a/internal/service/loadbalancer/frontend_rule_actions.go b/internal/service/loadbalancer/frontend_rule_actions.go index e3d89859..91f60c8b 100644 --- a/internal/service/loadbalancer/frontend_rule_actions.go +++ b/internal/service/loadbalancer/frontend_rule_actions.go @@ -20,6 +20,8 @@ func frontendRuleActionsSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "backend_name": { Description: "The name of the backend where traffic will be routed.", @@ -37,6 +39,8 @@ func frontendRuleActionsSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "location": { Description: "Target location.", @@ -65,6 +69,8 @@ func frontendRuleActionsSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "content_type": { Description: "Content type.", @@ -96,6 +102,8 @@ func frontendRuleActionsSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "active": { Type: schema.TypeBool, @@ -113,6 +121,8 @@ func frontendRuleActionsSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "active": { Type: schema.TypeBool, diff --git a/internal/service/loadbalancer/frontend_rule_matchers.go b/internal/service/loadbalancer/frontend_rule_matchers.go index abb87da9..a65a5fdd 100644 --- a/internal/service/loadbalancer/frontend_rule_matchers.go +++ b/internal/service/loadbalancer/frontend_rule_matchers.go @@ -24,7 +24,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherIntegerSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherIntegerSchema(), }, }, "src_port_range": { @@ -34,7 +36,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherRangeSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherRangeSchema(), }, }, "src_ip": { @@ -44,7 +48,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherIPSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherIPSchema(), }, }, "body_size": { @@ -54,7 +60,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherIntegerSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherIntegerSchema(), }, }, "body_size_range": { @@ -64,7 +72,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherRangeSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherRangeSchema(), }, }, "path": { @@ -74,7 +84,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherStringSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherStringSchema(), }, }, "url": { @@ -84,7 +96,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherStringSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherStringSchema(), }, }, "url_query": { @@ -94,7 +108,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherStringSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherStringSchema(), }, }, "host": { @@ -104,7 +120,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherHostSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherHostSchema(), }, }, "http_method": { @@ -114,7 +132,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherHTTPMethodSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherHTTPMethodSchema(), }, }, "cookie": { @@ -124,7 +144,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherStringWithArgumentSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherStringWithArgumentSchema(), }, }, "header": { @@ -134,7 +156,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherStringWithArgumentSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherStringWithArgumentSchema(), }, }, "url_param": { @@ -144,7 +168,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherStringWithArgumentSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherStringWithArgumentSchema(), }, }, "num_members_up": { @@ -154,7 +180,9 @@ func frontendRuleMatchersSchema() map[string]*schema.Schema { MaxItems: 100, ForceNew: true, Elem: &schema.Resource{ - Schema: frontendRuleMatcherBackendSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: frontendRuleMatcherBackendSchema(), }, }, } diff --git a/internal/service/loadbalancer/frontend_tls_config.go b/internal/service/loadbalancer/frontend_tls_config.go index b1dbe39b..3a2186d3 100644 --- a/internal/service/loadbalancer/frontend_tls_config.go +++ b/internal/service/loadbalancer/frontend_tls_config.go @@ -14,11 +14,13 @@ import ( func ResourceFrontendTLSConfig() *schema.Resource { return &schema.Resource{ - Description: "This resource represents frontend TLS config", - CreateContext: resourceFrontendTLSConfigCreate, - ReadContext: resourceFrontendTLSConfigRead, - UpdateContext: resourceFrontendTLSConfigUpdate, - DeleteContext: resourceFrontendTLSConfigDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents frontend TLS config", + CreateContext: resourceFrontendTLSConfigCreate, + ReadContext: resourceFrontendTLSConfigRead, + UpdateContext: resourceFrontendTLSConfigUpdate, + DeleteContext: resourceFrontendTLSConfigDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/loadbalancer/loadbalancer.go b/internal/service/loadbalancer/loadbalancer.go index 402212b3..088685ec 100644 --- a/internal/service/loadbalancer/loadbalancer.go +++ b/internal/service/loadbalancer/loadbalancer.go @@ -21,11 +21,13 @@ import ( func ResourceLoadBalancer() *schema.Resource { return &schema.Resource{ - Description: "This resource represents [Managed Load Balancer](https://upcloud.com/products/managed-load-balancer) service.", - CreateContext: resourceLoadBalancerCreate, - ReadContext: resourceLoadBalancerRead, - UpdateContext: resourceLoadBalancerUpdate, - DeleteContext: resourceLoadBalancerDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents [Managed Load Balancer](https://upcloud.com/products/managed-load-balancer) service.", + CreateContext: resourceLoadBalancerCreate, + ReadContext: resourceLoadBalancerRead, + UpdateContext: resourceLoadBalancerUpdate, + DeleteContext: resourceLoadBalancerDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -54,7 +56,9 @@ func ResourceLoadBalancer() *schema.Resource { MaxItems: 8, MinItems: 2, Elem: &schema.Resource{ - Schema: loadBalancerNetworkSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: loadBalancerNetworkSchema(), }, }, "configured_status": { @@ -103,7 +107,9 @@ func ResourceLoadBalancer() *schema.Resource { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ - Schema: loadBalancerNodeSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: loadBalancerNodeSchema(), }, }, "network": { @@ -201,7 +207,9 @@ func loadBalancerNodeSchema() map[string]*schema.Schema { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ - Schema: loadBalancerNodeNetworkSchema(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: loadBalancerNodeNetworkSchema(), }, }, } @@ -223,6 +231,8 @@ func loadBalancerNodeNetworkSchema() map[string]*schema.Schema { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "address": { Description: "Node's IP address.", diff --git a/internal/service/loadbalancer/manual_certificate_bundle.go b/internal/service/loadbalancer/manual_certificate_bundle.go index b0f6b49f..013aaabf 100644 --- a/internal/service/loadbalancer/manual_certificate_bundle.go +++ b/internal/service/loadbalancer/manual_certificate_bundle.go @@ -15,11 +15,13 @@ import ( func ResourceManualCertificateBundle() *schema.Resource { return &schema.Resource{ - Description: "This resource represents manual certificate bundle", - CreateContext: resourceManualCertificateBundleCreate, - ReadContext: resourceManualCertificateBundleRead, - UpdateContext: resourceManualCertificateBundleUpdate, - DeleteContext: resourceCertificateBundleDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents manual certificate bundle", + CreateContext: resourceManualCertificateBundleCreate, + ReadContext: resourceManualCertificateBundleRead, + UpdateContext: resourceManualCertificateBundleUpdate, + DeleteContext: resourceCertificateBundleDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/loadbalancer/resolver.go b/internal/service/loadbalancer/resolver.go index 0f7f7419..e218884b 100644 --- a/internal/service/loadbalancer/resolver.go +++ b/internal/service/loadbalancer/resolver.go @@ -15,11 +15,13 @@ import ( func ResourceResolver() *schema.Resource { return &schema.Resource{ - Description: "This resource represents service's domain name resolver", - CreateContext: resourceResolverCreate, - ReadContext: resourceResolverRead, - UpdateContext: resourceResolverUpdate, - DeleteContext: resourceResolverDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents service's domain name resolver", + CreateContext: resourceResolverCreate, + ReadContext: resourceResolverRead, + UpdateContext: resourceResolverUpdate, + DeleteContext: resourceResolverDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/managedobjectstorage/managed_object_storage.go b/internal/service/managedobjectstorage/managed_object_storage.go index 55d8c560..1ca8ddf8 100644 --- a/internal/service/managedobjectstorage/managed_object_storage.go +++ b/internal/service/managedobjectstorage/managed_object_storage.go @@ -17,11 +17,13 @@ import ( func ResourceManagedObjectStorage() *schema.Resource { return &schema.Resource{ - Description: "This resource represents an UpCloud Managed Object Storage instance, which provides S3 compatible storage.", - CreateContext: resourceManagedObjectStorageCreate, - ReadContext: resourceManagedObjectStorageRead, - UpdateContext: resourceManagedObjectStorageUpdate, - DeleteContext: resourceManagedObjectStorageDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents an UpCloud Managed Object Storage instance, which provides S3 compatible storage.", + CreateContext: resourceManagedObjectStorageCreate, + ReadContext: resourceManagedObjectStorageRead, + UpdateContext: resourceManagedObjectStorageUpdate, + DeleteContext: resourceManagedObjectStorageDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -82,7 +84,9 @@ func ResourceManagedObjectStorage() *schema.Resource { func schemaEndpoint() *schema.Resource { return &schema.Resource{ - Description: "Endpoint", + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Endpoint", Schema: map[string]*schema.Schema{ "domain_name": { Description: "Domain name of the endpoint.", @@ -110,7 +114,9 @@ func schemaEndpoint() *schema.Resource { func schemaNetwork() *schema.Resource { return &schema.Resource{ - Description: "Network", + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Network", Schema: map[string]*schema.Schema{ "family": { Description: "Network family. IPv6 currently not supported.", diff --git a/internal/service/managedobjectstorage/policies_data_source.go b/internal/service/managedobjectstorage/policies_data_source.go index 1a240101..d1d57b76 100644 --- a/internal/service/managedobjectstorage/policies_data_source.go +++ b/internal/service/managedobjectstorage/policies_data_source.go @@ -12,15 +12,19 @@ import ( func DataSourceManagedObjectStoragePolicies() *schema.Resource { return &schema.Resource{ - Description: "Policies available for a Managed Object Storage resource. See `managed_object_storage_user_policy` for attaching to a user.", - ReadContext: dataSourcePoliciesRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Policies available for a Managed Object Storage resource. See `managed_object_storage_user_policy` for attaching to a user.", + ReadContext: dataSourcePoliciesRead, Schema: map[string]*schema.Schema{ "policies": { Description: "Policies.", Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ - Schema: schemaPolicy(), + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Schema: schemaPolicy(), }, }, "service_uuid": { diff --git a/internal/service/managedobjectstorage/policy.go b/internal/service/managedobjectstorage/policy.go index 1f5c34a4..edf2f2f9 100644 --- a/internal/service/managedobjectstorage/policy.go +++ b/internal/service/managedobjectstorage/policy.go @@ -14,10 +14,12 @@ import ( func ResourceManagedObjectStoragePolicy() *schema.Resource { return &schema.Resource{ - Description: "This resource represents an UpCloud Managed Object Storage policy.", - CreateContext: resourceManagedObjectStoragePolicyCreate, - ReadContext: resourceManagedObjectStoragePolicyRead, - DeleteContext: resourceManagedObjectStoragePolicyDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents an UpCloud Managed Object Storage policy.", + CreateContext: resourceManagedObjectStoragePolicyCreate, + ReadContext: resourceManagedObjectStoragePolicyRead, + DeleteContext: resourceManagedObjectStoragePolicyDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/managedobjectstorage/user.go b/internal/service/managedobjectstorage/user.go index a6249163..5c14226c 100644 --- a/internal/service/managedobjectstorage/user.go +++ b/internal/service/managedobjectstorage/user.go @@ -14,10 +14,12 @@ import ( func ResourceManagedObjectStorageUser() *schema.Resource { return &schema.Resource{ - Description: "This resource represents an UpCloud Managed Object Storage user. No relation to UpCloud API accounts.", - CreateContext: resourceManagedObjectStorageUserCreate, - ReadContext: resourceManagedObjectStorageUserRead, - DeleteContext: resourceManagedObjectStorageUserDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents an UpCloud Managed Object Storage user. No relation to UpCloud API accounts.", + CreateContext: resourceManagedObjectStorageUserCreate, + ReadContext: resourceManagedObjectStorageUserRead, + DeleteContext: resourceManagedObjectStorageUserDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/managedobjectstorage/user_access_key.go b/internal/service/managedobjectstorage/user_access_key.go index 9b9317ea..e8042182 100644 --- a/internal/service/managedobjectstorage/user_access_key.go +++ b/internal/service/managedobjectstorage/user_access_key.go @@ -15,11 +15,13 @@ import ( func ResourceManagedObjectStorageUserAccessKey() *schema.Resource { return &schema.Resource{ - Description: "This resource represents an UpCloud Managed Object Storage user access key.", - CreateContext: resourceManagedObjectStorageUserAccessKeyCreate, - ReadContext: resourceManagedObjectStorageUserAccessKeyRead, - UpdateContext: resourceManagedObjectStorageUserAccessKeyUpdate, - DeleteContext: resourceManagedObjectStorageUserAccessKeyDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents an UpCloud Managed Object Storage user access key.", + CreateContext: resourceManagedObjectStorageUserAccessKeyCreate, + ReadContext: resourceManagedObjectStorageUserAccessKeyRead, + UpdateContext: resourceManagedObjectStorageUserAccessKeyUpdate, + DeleteContext: resourceManagedObjectStorageUserAccessKeyDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/managedobjectstorage/user_policy.go b/internal/service/managedobjectstorage/user_policy.go index e2cfbc66..3c8771cf 100644 --- a/internal/service/managedobjectstorage/user_policy.go +++ b/internal/service/managedobjectstorage/user_policy.go @@ -15,10 +15,12 @@ import ( func ResourceManagedObjectStorageUserPolicy() *schema.Resource { return &schema.Resource{ - Description: "This resource represents an UpCloud Managed Object Storage user policy attachment.", - CreateContext: resourceManagedObjectStorageUserPolicyCreate, - ReadContext: resourceManagedObjectStorageUserPolicyRead, - DeleteContext: resourceManagedObjectStorageUserPolicyDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource represents an UpCloud Managed Object Storage user policy attachment.", + CreateContext: resourceManagedObjectStorageUserPolicyCreate, + ReadContext: resourceManagedObjectStorageUserPolicyRead, + DeleteContext: resourceManagedObjectStorageUserPolicyDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/network/data_sources.go b/internal/service/network/data_sources.go index feee4208..39e5d6b1 100644 --- a/internal/service/network/data_sources.go +++ b/internal/service/network/data_sources.go @@ -17,8 +17,10 @@ import ( func DataSourceNetworks() *schema.Resource { return &schema.Resource{ - Description: "Use this data source to get the available UpCloud networks.", - ReadContext: dataSourceNetworksRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Use this data source to get the available UpCloud networks.", + ReadContext: dataSourceNetworksRead, Schema: map[string]*schema.Schema{ "zone": { Type: schema.TypeString, @@ -34,12 +36,16 @@ func DataSourceNetworks() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "ip_network": { Type: schema.TypeSet, Computed: true, Description: "A list of IP subnets within the network", Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "address": { Type: schema.TypeString, @@ -112,6 +118,8 @@ func DataSourceNetworks() *schema.Resource { Description: "A list of attached servers", Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "id": { Type: schema.TypeString, diff --git a/internal/service/objectstorage/objectstorage.go b/internal/service/objectstorage/objectstorage.go index 31394adb..6dee79a5 100644 --- a/internal/service/objectstorage/objectstorage.go +++ b/internal/service/objectstorage/objectstorage.go @@ -34,6 +34,8 @@ type objectStorageKeyType string func ResourceObjectStorage() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Description: fmt.Sprintf(`~> %s This resource represents an UpCloud Object Storage instance, which provides S3 compatible storage.`, deprecationMessage), @@ -112,6 +114,8 @@ This resource represents an UpCloud Object Storage instance, which provides S3 c Type: schema.TypeSet, Optional: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/service/router/router.go b/internal/service/router/router.go index 3f70f1a0..8b35e8aa 100644 --- a/internal/service/router/router.go +++ b/internal/service/router/router.go @@ -16,6 +16,8 @@ import ( func ResourceRouter() *schema.Resource { return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Description: `This resource represents a generated UpCloud router resource. Routers can be used to connect multiple Private Networks. UpCloud Servers on any attached network can communicate directly with each other.`, @@ -50,6 +52,8 @@ func ResourceRouter() *schema.Resource { Optional: true, Type: schema.TypeSet, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "name": { Description: "Name or description of the route.", diff --git a/internal/service/server/server.go b/internal/service/server/server.go index d3e9ebfb..dd1374c4 100644 --- a/internal/service/server/server.go +++ b/internal/service/server/server.go @@ -26,11 +26,13 @@ const serverTitleLength int = 255 func ResourceServer() *schema.Resource { return &schema.Resource{ - Description: "The UpCloud server resource allows the creation, update and deletion of a [cloud server](https://upcloud.com/products/cloud-servers).", - CreateContext: resourceServerCreate, - ReadContext: resourceServerRead, - UpdateContext: resourceServerUpdate, - DeleteContext: resourceServerDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "The UpCloud server resource allows the creation, update and deletion of a [cloud server](https://upcloud.com/products/cloud-servers).", + CreateContext: resourceServerCreate, + ReadContext: resourceServerRead, + UpdateContext: resourceServerUpdate, + DeleteContext: resourceServerDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -151,6 +153,8 @@ func ResourceServer() *schema.Resource { Required: true, MinItems: 1, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "ip_address_family": schemaIPAddressFamily("The type of the primary IP address of this interface (one of `IPv4` or `IPv6`)."), "ip_address": schemaIPAddress("The assigned primary IP address."), @@ -161,6 +165,8 @@ func ResourceServer() *schema.Resource { Optional: true, MaxItems: 4, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "ip_address_family": schemaIPAddressFamily("The type of this additional IP address of this interface (one of `IPv4` or `IPv6`)."), "ip_address": schemaIPAddress("The assigned additional IP address."), @@ -233,6 +239,8 @@ func ResourceServer() *schema.Resource { Type: schema.TypeSet, Optional: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "address": { Description: "The device address the storage will be attached to (`scsi`|`virtio`|`ide`). Leave `address_position` field empty to auto-select next available address from that bus.", @@ -276,6 +284,8 @@ func ResourceServer() *schema.Resource { MaxItems: 1, AtLeastOneOf: []string{"storage_devices", "template"}, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "id": { Description: "The unique identifier for the storage", @@ -352,6 +362,8 @@ func ResourceServer() *schema.Resource { MaxItems: 1, Optional: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "user": { Description: "Username to be create to access the server", @@ -395,6 +407,8 @@ func ResourceServer() *schema.Resource { Optional: true, ConflictsWith: []string{"template.0.backup_rule"}, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "plan": { Description: "Simple backup plan. Accepted values: daily, dailies, weeklies, monthlies.", diff --git a/internal/service/servergroup/servergroup.go b/internal/service/servergroup/servergroup.go index 86cf8480..a424a66c 100644 --- a/internal/service/servergroup/servergroup.go +++ b/internal/service/servergroup/servergroup.go @@ -36,10 +36,12 @@ const ( func ResourceServerGroup() *schema.Resource { return &schema.Resource{ - CreateContext: resourceServerGroupCreate, - ReadContext: resourceServerGroupRead, - UpdateContext: resourceServerGroupUpdate, - DeleteContext: resourceServerGroupDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + CreateContext: resourceServerGroupCreate, + ReadContext: resourceServerGroupRead, + UpdateContext: resourceServerGroupUpdate, + DeleteContext: resourceServerGroupDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/internal/service/storage/backup_rule.go b/internal/service/storage/backup_rule.go index 7458d153..7a43ca1e 100644 --- a/internal/service/storage/backup_rule.go +++ b/internal/service/storage/backup_rule.go @@ -19,6 +19,8 @@ func BackupRuleSchema() *schema.Schema { MaxItems: 1, Optional: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "interval": { Description: "The weekday when the backup is created", diff --git a/internal/service/storage/data_sources.go b/internal/service/storage/data_sources.go index 48cb8c1b..e9d7907d 100644 --- a/internal/service/storage/data_sources.go +++ b/internal/service/storage/data_sources.go @@ -28,6 +28,8 @@ func DataSourceStorage() *schema.Resource { } return &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Description: fmt.Sprintf(` Returns storage resource information based on defined arguments. diff --git a/internal/service/storage/storage.go b/internal/service/storage/storage.go index 14c257f6..a7fbad9b 100644 --- a/internal/service/storage/storage.go +++ b/internal/service/storage/storage.go @@ -21,11 +21,13 @@ import ( func ResourceStorage() *schema.Resource { return &schema.Resource{ - Description: "Manages UpCloud [Block Storage](https://upcloud.com/products/block-storage) devices.", - CreateContext: resourceStorageCreate, - ReadContext: resourceStorageRead, - UpdateContext: resourceStorageUpdate, - DeleteContext: resourceStorageDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Manages UpCloud [Block Storage](https://upcloud.com/products/block-storage) devices.", + CreateContext: resourceStorageCreate, + ReadContext: resourceStorageRead, + UpdateContext: resourceStorageUpdate, + DeleteContext: resourceStorageDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -71,6 +73,8 @@ func ResourceStorage() *schema.Resource { Optional: true, ConflictsWith: []string{"import"}, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "id": { Description: "The unique identifier of the storage/template to clone", @@ -89,6 +93,8 @@ func ResourceStorage() *schema.Resource { Optional: true, ConflictsWith: []string{"clone"}, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "source": { Description: "The mode of the import task. One of `http_import` or `direct_upload`.", diff --git a/internal/service/tag/data_sources.go b/internal/service/tag/data_sources.go index b3666fa5..eb37cc6f 100644 --- a/internal/service/tag/data_sources.go +++ b/internal/service/tag/data_sources.go @@ -12,13 +12,17 @@ import ( func DataSourceTags() *schema.Resource { return &schema.Resource{ - Description: "Data-source is deprecated.", - ReadContext: dataSourceTagsRead, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "Data-source is deprecated.", + ReadContext: dataSourceTagsRead, Schema: map[string]*schema.Schema{ "tags": { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, Schema: map[string]*schema.Schema{ "description": { Description: "Free form text representing the meaning of the tag", diff --git a/internal/service/tag/tag.go b/internal/service/tag/tag.go index 040b0adc..698eb016 100644 --- a/internal/service/tag/tag.go +++ b/internal/service/tag/tag.go @@ -14,11 +14,13 @@ import ( func ResourceTag() *schema.Resource { return &schema.Resource{ - Description: "This resource is deprecated, use tags schema in server resource", - CreateContext: resourceTagCreate, - ReadContext: resourceTagRead, - UpdateContext: resourceTagUpdate, - DeleteContext: resourceTagDelete, + EnableLegacyTypeSystemApplyErrors: true, + EnableLegacyTypeSystemPlanErrors: true, + Description: "This resource is deprecated, use tags schema in server resource", + CreateContext: resourceTagCreate, + ReadContext: resourceTagRead, + UpdateContext: resourceTagUpdate, + DeleteContext: resourceTagDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, },