diff --git a/docs/data-sources/routing_table.md b/docs/data-sources/routing_table.md index 680445693..611f93113 100644 --- a/docs/data-sources/routing_table.md +++ b/docs/data-sources/routing_table.md @@ -41,6 +41,7 @@ data "stackit_routing_table" "example" { - `created_at` (String) Date-time when the routing table was created - `default` (Boolean) When true this is the default routing table for this network area. It can't be deleted and is used if the user does not specify it otherwise. - `description` (String) Description of the routing table. +- `dynamic_routes` (Boolean) This controls whether dynamic routes are propagated to this routing table - `id` (String) Terraform's internal datasource ID. It is structured as "`organization_id`,`region`,`network_area_id`,`routing_table_id`". - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container - `name` (String) The name of the routing table. diff --git a/docs/data-sources/routing_tables.md b/docs/data-sources/routing_tables.md index 26eac9c34..338bb4cb6 100644 --- a/docs/data-sources/routing_tables.md +++ b/docs/data-sources/routing_tables.md @@ -47,6 +47,7 @@ Read-Only: - `created_at` (String) Date-time when the routing table was created - `default` (Boolean) When true this is the default routing table for this network area. It can't be deleted and is used if the user does not specify it otherwise. - `description` (String) Description of the routing table. +- `dynamic_routes` (Boolean) This controls whether dynamic routes are propagated to this routing table - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container - `name` (String) The name of the routing table. - `routing_table_id` (String) The routing tables ID. diff --git a/docs/resources/routing_table.md b/docs/resources/routing_table.md index ff6e00e35..c0503705a 100644 --- a/docs/resources/routing_table.md +++ b/docs/resources/routing_table.md @@ -44,6 +44,7 @@ import { ### Optional - `description` (String) Description of the routing table. +- `dynamic_routes` (Boolean) This controls whether dynamic routes are propagated to this routing table - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container - `region` (String) The resource region. If not defined, the provider region is used. - `system_routes` (Boolean) This controls whether the routes for project-to-project communication are created automatically or not. diff --git a/go.mod b/go.mod index 072dddba7..513115d1e 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.3 github.com/stackitcloud/stackit-sdk-go/services/git v0.10.1 github.com/stackitcloud/stackit-sdk-go/services/iaas v1.3.0 - github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.21-alpha + github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.23-alpha github.com/stackitcloud/stackit-sdk-go/services/kms v1.2.0 github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.6.2 github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.3 diff --git a/go.sum b/go.sum index 3ff9059cd..858332f7c 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,8 @@ github.com/stackitcloud/stackit-sdk-go/services/git v0.10.1 h1:3JKXfI5hdcXcRVBjU github.com/stackitcloud/stackit-sdk-go/services/git v0.10.1/go.mod h1:3nTaj8IGjNNGYUD2CpuXkXwc5c4giTUmoPggFhjVFxo= github.com/stackitcloud/stackit-sdk-go/services/iaas v1.3.0 h1:U/x0tc487X9msMS5yZYjrBAAKrCx87Trmt0kh8JiARA= github.com/stackitcloud/stackit-sdk-go/services/iaas v1.3.0/go.mod h1:6+5+RCDfU7eQN3+/SGdOtx7Bq9dEa2FrHz/jflgY1M4= -github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.21-alpha h1:m1jq6a8dbUe+suFuUNdHmM/cSehpGLUtDbK1CqLqydg= -github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.21-alpha/go.mod h1:Nu1b5Phsv8plgZ51+fkxPVsU91ZJ5Ayz+cthilxdmQ8= +github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.23-alpha h1:ugpMOMUZGB0yXsWcfe97F7GCdjlexbjFuGD8ZeyMSts= +github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.23-alpha/go.mod h1:v5VGvTxLcCdJJmblbhqYalt/MFHcElDfYoy15CMhaWs= github.com/stackitcloud/stackit-sdk-go/services/kms v1.2.0 h1:Ar2n9GKmrTN80G/Ta1R+fL5aX5nEoxL6ODVJl3emzho= github.com/stackitcloud/stackit-sdk-go/services/kms v1.2.0/go.mod h1:sHMFoYvVrkRZcH13DkLvp48nW+ssRVVVuwqJHDGpa5M= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.6.2 h1:DwwRMzvnKWTbfmLvq2xe+mYhv5fA1AwWdQGznI05sGc= diff --git a/stackit/internal/services/iaas/iaas_acc_test.go b/stackit/internal/services/iaas/iaas_acc_test.go index a44aa75a3..382737361 100644 --- a/stackit/internal/services/iaas/iaas_acc_test.go +++ b/stackit/internal/services/iaas/iaas_acc_test.go @@ -717,6 +717,7 @@ func TestAccNetworkMax(t *testing.T) { resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "region", testutil.Region), resource.TestCheckNoResourceAttr("stackit_routing_table.routing_table", "description"), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "system_routes", "true"), + resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "dynamic_routes", "true"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "updated_at"), ), @@ -801,6 +802,7 @@ func TestAccNetworkMax(t *testing.T) { resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "region", testutil.Region), resource.TestCheckNoResourceAttr("data.stackit_routing_table.routing_table", "description"), resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "system_routes", "true"), + resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "dynamic_routes", "true"), resource.TestCheckResourceAttrSet("data.stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("data.stackit_routing_table.routing_table", "updated_at"), ), @@ -950,6 +952,7 @@ func TestAccNetworkMax(t *testing.T) { resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "region", testutil.Region), resource.TestCheckNoResourceAttr("stackit_routing_table.routing_table", "description"), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "system_routes", "true"), + resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "dynamic_routes", "true"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "updated_at"), ), diff --git a/stackit/internal/services/iaasalpha/iaasalpha_acc_test.go b/stackit/internal/services/iaasalpha/iaasalpha_acc_test.go index dd0e06541..a8c21ff4b 100644 --- a/stackit/internal/services/iaasalpha/iaasalpha_acc_test.go +++ b/stackit/internal/services/iaasalpha/iaasalpha_acc_test.go @@ -62,6 +62,7 @@ var testConfigRoutingTableMax = config.Variables{ "description": config.StringVariable("This is the description of the routing table."), "label": config.StringVariable("routing-table-label-01"), "system_routes": config.BoolVariable(false), + "dynamic_routes": config.BoolVariable(false), "region": config.StringVariable(testutil.Region), } @@ -73,6 +74,7 @@ var testConfigRoutingTableMaxUpdated = func() config.Variables { updatedConfig["name"] = config.StringVariable(fmt.Sprintf("acc-test-%s", acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum))) updatedConfig["description"] = config.StringVariable("This is the updated description of the routing table.") updatedConfig["label"] = config.StringVariable("routing-table-updated-label-01") + updatedConfig["dynamic_routes"] = config.BoolVariable(true) return updatedConfig }() @@ -133,6 +135,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "region", testutil.Region), resource.TestCheckNoResourceAttr("stackit_routing_table.routing_table", "description"), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "system_routes", "true"), + resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "dynamic_routes", "true"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "updated_at"), ), @@ -172,6 +175,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "region", testutil.Region), resource.TestCheckNoResourceAttr("data.stackit_routing_table.routing_table", "description"), resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "system_routes", "true"), + resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "dynamic_routes", "true"), resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "default", "false"), resource.TestCheckResourceAttrSet("data.stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("data.stackit_routing_table.routing_table", "updated_at"), @@ -197,6 +201,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.labels.%", "0"), resource.TestCheckNoResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.description"), resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.system_routes", "true"), + resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.dynamic_routes", "true"), resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.default", "false"), resource.TestCheckResourceAttrSet("data.stackit_routing_tables.routing_tables", "items.1.created_at"), resource.TestCheckResourceAttrSet("data.stackit_routing_tables.routing_tables", "items.1.updated_at"), @@ -242,6 +247,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "region", testutil.Region), resource.TestCheckNoResourceAttr("stackit_routing_table.routing_table", "description"), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "system_routes", "true"), + resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "dynamic_routes", "true"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "updated_at"), ), @@ -272,6 +278,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "region", testutil.ConvertConfigVariable(testConfigRoutingTableMax["region"])), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "description", testutil.ConvertConfigVariable(testConfigRoutingTableMax["description"])), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "system_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMax["system_routes"])), + resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "dynamic_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMax["dynamic_routes"])), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "updated_at"), ), @@ -312,6 +319,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "region", testutil.ConvertConfigVariable(testConfigRoutingTableMax["region"])), resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "description", testutil.ConvertConfigVariable(testConfigRoutingTableMax["description"])), resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "system_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMax["system_routes"])), + resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "dynamic_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMax["dynamic_routes"])), resource.TestCheckResourceAttr("data.stackit_routing_table.routing_table", "default", "false"), resource.TestCheckResourceAttrSet("data.stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("data.stackit_routing_table.routing_table", "updated_at"), @@ -338,6 +346,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.labels.acc-test", testutil.ConvertConfigVariable(testConfigRoutingTableMax["label"])), resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.description", testutil.ConvertConfigVariable(testConfigRoutingTableMax["description"])), resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.system_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMax["system_routes"])), + resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.dynamic_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMax["dynamic_routes"])), resource.TestCheckResourceAttr("data.stackit_routing_tables.routing_tables", "items.1.default", "false"), resource.TestCheckResourceAttrSet("data.stackit_routing_tables.routing_tables", "items.1.created_at"), resource.TestCheckResourceAttrSet("data.stackit_routing_tables.routing_tables", "items.1.updated_at"), @@ -384,6 +393,7 @@ func TestAccRoutingTable(t *testing.T) { resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "region", testutil.ConvertConfigVariable(testConfigRoutingTableMaxUpdated["region"])), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "description", testutil.ConvertConfigVariable(testConfigRoutingTableMaxUpdated["description"])), resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "system_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMaxUpdated["system_routes"])), + resource.TestCheckResourceAttr("stackit_routing_table.routing_table", "dynamic_routes", testutil.ConvertConfigVariable(testConfigRoutingTableMaxUpdated["dynamic_routes"])), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "created_at"), resource.TestCheckResourceAttrSet("stackit_routing_table.routing_table", "updated_at"), ), diff --git a/stackit/internal/services/iaasalpha/routingtable/shared/shared.go b/stackit/internal/services/iaasalpha/routingtable/shared/shared.go index 04382ad3e..dc3886ade 100644 --- a/stackit/internal/services/iaasalpha/routingtable/shared/shared.go +++ b/stackit/internal/services/iaasalpha/routingtable/shared/shared.go @@ -26,6 +26,7 @@ type RoutingTableReadModel struct { UpdatedAt types.String `tfsdk:"updated_at"` Default types.Bool `tfsdk:"default"` SystemRoutes types.Bool `tfsdk:"system_routes"` + DynamicRoutes types.Bool `tfsdk:"dynamic_routes"` } func RoutingTableReadModelTypes() map[string]attr.Type { @@ -38,6 +39,7 @@ func RoutingTableReadModelTypes() map[string]attr.Type { "updated_at": types.StringType, "default": types.BoolType, "system_routes": types.BoolType, + "dynamic_routes": types.BoolType, } } @@ -208,6 +210,10 @@ func RoutingTableResponseAttributes() map[string]schema.Attribute { Description: "This controls whether the routes for project-to-project communication are created automatically or not.", Computed: true, }, + "dynamic_routes": schema.BoolAttribute{ + Description: "This controls whether dynamic routes are propagated to this routing table", + Computed: true, + }, "created_at": schema.StringAttribute{ Description: "Date-time when the routing table was created", Computed: true, @@ -257,6 +263,7 @@ func MapRoutingTableReadModel(ctx context.Context, routingTable *iaasalpha.Routi model.Description = types.StringPointerValue(routingTable.Description) model.Default = types.BoolPointerValue(routingTable.Default) model.SystemRoutes = types.BoolPointerValue(routingTable.SystemRoutes) + model.DynamicRoutes = types.BoolPointerValue(routingTable.DynamicRoutes) model.Labels = labels model.CreatedAt = createdAtTF model.UpdatedAt = updatedAtTF diff --git a/stackit/internal/services/iaasalpha/routingtable/table/resource.go b/stackit/internal/services/iaasalpha/routingtable/table/resource.go index 4b9fb1b06..b0b980a61 100644 --- a/stackit/internal/services/iaasalpha/routingtable/table/resource.go +++ b/stackit/internal/services/iaasalpha/routingtable/table/resource.go @@ -48,6 +48,7 @@ type Model struct { Labels types.Map `tfsdk:"labels"` Region types.String `tfsdk:"region"` SystemRoutes types.Bool `tfsdk:"system_routes"` + DynamicRoutes types.Bool `tfsdk:"dynamic_routes"` CreatedAt types.String `tfsdk:"created_at"` UpdatedAt types.String `tfsdk:"updated_at"` } @@ -206,6 +207,12 @@ func (r *routingTableResource) Schema(_ context.Context, _ resource.SchemaReques boolplanmodifier.RequiresReplace(), }, }, + "dynamic_routes": schema.BoolAttribute{ + Description: "This controls whether dynamic routes are propagated to this routing table", + Optional: true, + Computed: true, + Default: booldefault.StaticBool(true), + }, "created_at": schema.StringAttribute{ Description: "Date-time when the routing table was created", Computed: true, @@ -485,6 +492,7 @@ func mapFields(ctx context.Context, routingTable *iaasalpha.RoutingTable, model model.Labels = labels model.Region = types.StringValue(region) model.SystemRoutes = types.BoolPointerValue(routingTable.SystemRoutes) + model.DynamicRoutes = types.BoolPointerValue(routingTable.DynamicRoutes) model.CreatedAt = createdAtTF model.UpdatedAt = updatedAtTF return nil @@ -501,10 +509,11 @@ func toCreatePayload(ctx context.Context, model *Model) (*iaasalpha.AddRoutingTa } return &iaasalpha.AddRoutingTableToAreaPayload{ - Description: conversion.StringValueToPointer(model.Description), - Name: conversion.StringValueToPointer(model.Name), - Labels: &labels, - SystemRoutes: conversion.BoolValueToPointer(model.SystemRoutes), + Description: conversion.StringValueToPointer(model.Description), + Name: conversion.StringValueToPointer(model.Name), + Labels: &labels, + SystemRoutes: conversion.BoolValueToPointer(model.SystemRoutes), + DynamicRoutes: conversion.BoolValueToPointer(model.DynamicRoutes), }, nil } @@ -519,8 +528,9 @@ func toUpdatePayload(ctx context.Context, model *Model, currentLabels types.Map) } return &iaasalpha.UpdateRoutingTableOfAreaPayload{ - Description: conversion.StringValueToPointer(model.Description), - Name: conversion.StringValueToPointer(model.Name), - Labels: &labels, + Description: conversion.StringValueToPointer(model.Description), + Name: conversion.StringValueToPointer(model.Name), + Labels: &labels, + DynamicRoutes: conversion.BoolValueToPointer(model.DynamicRoutes), }, nil } diff --git a/stackit/internal/services/iaasalpha/routingtable/table/resource_test.go b/stackit/internal/services/iaasalpha/routingtable/table/resource_test.go index 24b1fef90..52db3c99b 100644 --- a/stackit/internal/services/iaasalpha/routingtable/table/resource_test.go +++ b/stackit/internal/services/iaasalpha/routingtable/table/resource_test.go @@ -132,7 +132,8 @@ func TestToCreatePayload(t *testing.T) { Labels: types.MapValueMust(types.StringType, map[string]attr.Value{ "key": types.StringValue("value"), }), - SystemRoutes: types.BoolValue(true), + SystemRoutes: types.BoolValue(true), + DynamicRoutes: types.BoolValue(true), }, expected: &iaasalpha.AddRoutingTableToAreaPayload{ Description: utils.Ptr("Description"), @@ -140,7 +141,8 @@ func TestToCreatePayload(t *testing.T) { Labels: &map[string]interface{}{ "key": "value", }, - SystemRoutes: utils.Ptr(true), + SystemRoutes: utils.Ptr(true), + DynamicRoutes: utils.Ptr(true), }, isValid: true, }, @@ -180,6 +182,7 @@ func TestToUpdatePayload(t *testing.T) { "key1": types.StringValue("value1"), "key2": types.StringValue("value2"), }), + DynamicRoutes: types.BoolValue(false), }, &iaasalpha.UpdateRoutingTableOfAreaPayload{ Description: utils.Ptr("Description"), @@ -188,6 +191,7 @@ func TestToUpdatePayload(t *testing.T) { "key1": "value1", "key2": "value2", }, + DynamicRoutes: utils.Ptr(false), }, true, }, diff --git a/stackit/internal/services/iaasalpha/routingtable/tables/datasource.go b/stackit/internal/services/iaasalpha/routingtable/tables/datasource.go index c6ef9268d..7ea6cbf25 100644 --- a/stackit/internal/services/iaasalpha/routingtable/tables/datasource.go +++ b/stackit/internal/services/iaasalpha/routingtable/tables/datasource.go @@ -196,6 +196,7 @@ func mapDataSourceRoutingTables(ctx context.Context, routingTables *iaasalpha.Ro "updated_at": routingTableModel.UpdatedAt, "default": routingTableModel.Default, "system_routes": routingTableModel.SystemRoutes, + "dynamic_routes": routingTableModel.DynamicRoutes, } routingTableTF, diags := types.ObjectValue(shared.RoutingTableReadModelTypes(), routingTableMap) diff --git a/stackit/internal/services/iaasalpha/routingtable/tables/datasource_test.go b/stackit/internal/services/iaasalpha/routingtable/tables/datasource_test.go index 2df93e796..9b6708e25 100644 --- a/stackit/internal/services/iaasalpha/routingtable/tables/datasource_test.go +++ b/stackit/internal/services/iaasalpha/routingtable/tables/datasource_test.go @@ -49,13 +49,14 @@ func TestMapDataFields(t *testing.T) { &iaasalpha.RoutingTableListResponse{ Items: &[]iaasalpha.RoutingTable{ { - Id: utils.Ptr(routingTableId.String()), - Name: utils.Ptr("test"), - Description: utils.Ptr("description"), - Default: utils.Ptr(true), - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, - SystemRoutes: utils.Ptr(false), + Id: utils.Ptr(routingTableId.String()), + Name: utils.Ptr("test"), + Description: utils.Ptr("description"), + Default: utils.Ptr(true), + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + SystemRoutes: utils.Ptr(false), + DynamicRoutes: utils.Ptr(false), }, }, }, @@ -71,6 +72,7 @@ func TestMapDataFields(t *testing.T) { "description": types.StringValue("description"), "default": types.BoolValue(true), "system_routes": types.BoolValue(false), + "dynamic_routes": types.BoolValue(false), "created_at": types.StringValue(createdAt.Format(time.RFC3339)), "updated_at": types.StringValue(updatedAt.Format(time.RFC3339)), "labels": types.MapNull(types.StringType), @@ -89,22 +91,24 @@ func TestMapDataFields(t *testing.T) { &iaasalpha.RoutingTableListResponse{ Items: &[]iaasalpha.RoutingTable{ { - Id: utils.Ptr(routingTableId.String()), - Name: utils.Ptr("test"), - Description: utils.Ptr("description"), - Default: utils.Ptr(true), - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, - SystemRoutes: utils.Ptr(false), + Id: utils.Ptr(routingTableId.String()), + Name: utils.Ptr("test"), + Description: utils.Ptr("description"), + Default: utils.Ptr(true), + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + SystemRoutes: utils.Ptr(false), + DynamicRoutes: utils.Ptr(false), }, { - Id: utils.Ptr(secondRoutingTableId.String()), - Name: utils.Ptr("test2"), - Description: utils.Ptr("description2"), - Default: utils.Ptr(false), - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, - SystemRoutes: utils.Ptr(false), + Id: utils.Ptr(secondRoutingTableId.String()), + Name: utils.Ptr("test2"), + Description: utils.Ptr("description2"), + Default: utils.Ptr(false), + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + SystemRoutes: utils.Ptr(false), + DynamicRoutes: utils.Ptr(false), }, }, }, @@ -120,6 +124,7 @@ func TestMapDataFields(t *testing.T) { "description": types.StringValue("description"), "default": types.BoolValue(true), "system_routes": types.BoolValue(false), + "dynamic_routes": types.BoolValue(false), "created_at": types.StringValue(createdAt.Format(time.RFC3339)), "updated_at": types.StringValue(updatedAt.Format(time.RFC3339)), "labels": types.MapNull(types.StringType), @@ -130,6 +135,7 @@ func TestMapDataFields(t *testing.T) { "description": types.StringValue("description2"), "default": types.BoolValue(false), "system_routes": types.BoolValue(false), + "dynamic_routes": types.BoolValue(false), "created_at": types.StringValue(createdAt.Format(time.RFC3339)), "updated_at": types.StringValue(updatedAt.Format(time.RFC3339)), "labels": types.MapNull(types.StringType), diff --git a/stackit/internal/services/iaasalpha/testdata/resource-routingtable-max.tf b/stackit/internal/services/iaasalpha/testdata/resource-routingtable-max.tf index 74c656d13..f5e221144 100644 --- a/stackit/internal/services/iaasalpha/testdata/resource-routingtable-max.tf +++ b/stackit/internal/services/iaasalpha/testdata/resource-routingtable-max.tf @@ -5,6 +5,7 @@ variable "description" {} variable "region" {} variable "label" {} variable "system_routes" {} +variable "dynamic_routes" {} resource "stackit_routing_table" "routing_table" { organization_id = var.organization_id @@ -15,5 +16,6 @@ resource "stackit_routing_table" "routing_table" { labels = { "acc-test" : var.label } - system_routes = var.system_routes + system_routes = var.system_routes + dynamic_routes = var.dynamic_routes }