Skip to content

Commit 169613d

Browse files
authored
Merge branch 'master' into fix_warning_golang
2 parents 8c154e2 + 59881e8 commit 169613d

File tree

56 files changed

+24909
-20898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+24909
-20898
lines changed

docs/resources/cockpit.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ page_title: "Scaleway: scaleway_cockpit"
55

66
# Resource: scaleway_cockpit
77

8+
~> **Important:** The resource `scaleway_cockpit` has been deprecated and will no longer be supported after January 1st, 2025. Instead, use the new specialized resources:
9+
10+
- `scaleway_cockpit_source` for managing data sources (metrics, logs, traces)
11+
- `scaleway_cockpit_alert_manager` for managing alert manager
12+
- `scaleway_cockpit_grafana_user` for managing Grafana users
13+
14+
For detailed migration instructions, see the [Cockpit Migration Guide](../guides/migration_guide_cockpit_plan.md).
15+
816
-> **Note:**
917
As of September 2024, Cockpit has introduced [regionalization](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#region) to offer more flexibility and resilience.
1018
If you have created customized dashboards with data for your Scaleway resources before April 2024, you will need to update your queries in Grafana, with the new regionalized [data sources](../resources/cockpit_source.md).
@@ -74,8 +82,12 @@ resource "grafana_folder" "test_folder" {
7482
- `plan` - (Deprecated) Name of the plan to use. Available plans are: free, premium, and custom.
7583
~> **Important:** The plan field is deprecated. Any modification or selection will have no effect.
7684

85+
~> **Warning:** This entire resource is deprecated and will be removed after January 1st, 2025. Please migrate to the new specialized resources as described in the [Cockpit Migration Guide](../guides/migration_guide_cockpit_plan.md).
86+
7787
## Attributes Reference
7888

89+
~> **Warning:** This entire resource is deprecated and will be removed after January 1st, 2025. All attributes below are deprecated and will no longer be available.
90+
7991
In addition to all arguments above, the following attributes are exported:
8092

8193
- `plan_id` - (Deprecated) The ID of the current pricing plan.
@@ -86,10 +98,20 @@ In addition to all arguments above, the following attributes are exported:
8698
- `grafana_url` - (Deprecated) URL for Grafana.
8799
- `traces_url` - (Deprecated) URL for [traces](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#traces) to retrieve in the [Data sources tab](https://console.scaleway.com/cockpit/dataSource) of the Scaleway console.
88100

101+
## Migration
102+
103+
This resource is deprecated and will be removed after January 1st, 2025. To migrate to the new infrastructure, please refer to the [Cockpit Migration Guide](../guides/migration_guide_cockpit_plan.md) which provides step-by-step instructions for transitioning to:
104+
105+
- `scaleway_cockpit_source` for managing data sources (metrics, logs, traces)
106+
- `scaleway_cockpit_alert_manager` for managing alert manager
107+
- `scaleway_cockpit_grafana_user` for managing Grafana users
108+
89109
## Import
90110

91111
This section explains how to import a Cockpit using its `{project_id}`.
92112

93113
```bash
94114
terraform import scaleway_cockpit.main 11111111-1111-1111-1111-111111111111
95115
```
116+
117+
~> **Note:** Import functionality will be removed when this resource is deprecated.

docs/resources/container_namespace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ The following arguments are supported:
4040

4141
- `secret_environment_variables` - (Optional) The secret environment variables of the namespace.
4242

43-
- `activate_vpc_integration` - (Optional) Activates VPC integration for the namespace. Containers of a namespace with VPC integration activated will be able to connect to a Private Network.
43+
- `activate_vpc_integration` - (Deprecated) Activates VPC integration for the namespace. Containers of a namespace with VPC integration activated will be able to connect to a Private Network.
4444

45-
~> **Important** Updates to `activate_vpc_integration` will recreate the namespace.
45+
~> **Important:** VPC integration is now available on all namespaces, so this field is not configurable anymore and its value will always be "true".
4646

4747
## Attributes Reference
4848

docs/resources/function_namespace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ The following arguments are supported:
4040

4141
- `secret_environment_variables` - (Optional) The secret environment variables of the namespace.
4242

43-
- `activate_vpc_integration` - (Optional) Activates VPC integration for the namespace. Functions of a namespace with VPC integration activated will be able to connect to a Private Network.
43+
- `activate_vpc_integration` - (Deprecated) Activates VPC integration for the namespace. Functions of a namespace with VPC integration activated will be able to connect to a Private Network.
4444

45-
~> **Important** Updates to `activate_vpc_integration` will recreate the namespace.
45+
~> **Important:** VPC integration is now available on all namespaces, so this field is not configurable anymore and its value will always be "true".
4646

4747
## Attributes Reference
4848

docs/resources/rdb_user.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,17 @@ resource "scaleway_rdb_instance" "main" {
2424
}
2525
2626
resource "random_password" "db_password" {
27-
length = 16
28-
special = true
27+
length = 20
28+
special = true
29+
upper = true
30+
lower = true
31+
numeric = true
32+
min_upper = 1
33+
min_lower = 1
34+
min_numeric = 1
35+
min_special = 1
36+
# Exclude characters that might cause issues in some contexts
37+
override_special = "!@#$%^&*()_+-=[]{}|;:,.<>?"
2938
}
3039
3140
resource "scaleway_rdb_user" "db_admin" {
@@ -48,7 +57,15 @@ The following arguments are supported:
4857

4958
~> **Important:** Updates to `name` will recreate the database user.
5059

51-
- `password` - (Required) database user password.
60+
- `password` - (Required) database user password. The password must meet the following requirements based on ISO27001 standards:
61+
- **Length**: 8-128 characters
62+
- **Character types required**:
63+
- At least 1 lowercase letter (a-z)
64+
- At least 1 uppercase letter (A-Z)
65+
- At least 1 digit (0-9)
66+
- At least 1 special character (!@#$%^&*()_+-=[]{}|;:,.<>?)
67+
68+
For secure password generation, consider using the `random_password` resource with appropriate parameters.
5269

5370
- `is_admin` - (Optional) Grant admin permissions to the database user.
5471

internal/services/cockpit/cockpit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func ResourceCockpit() *schema.Resource {
9090
},
9191
},
9292
},
93+
DeprecationMessage: "The scaleway_cockpit resource is deprecated and will be removed after January 1st, 2025. Use the new specialized resources instead: scaleway_cockpit_source, scaleway_cockpit_alert_manager, and scaleway_cockpit_grafana_user.",
9394
}
9495
}
9596

internal/services/container/namespace.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ func ResourceNamespace() *schema.Resource {
9797
},
9898
"activate_vpc_integration": {
9999
Type: schema.TypeBool,
100-
ForceNew: true,
100+
Deprecated: "VPC integration is now available on all namespaces, so this field is not configurable anymore and its value will always be \"true\".",
101101
Optional: true,
102-
Default: false,
102+
Default: true,
103103
Description: "Activate VPC integration for the namespace",
104104
},
105105
"region": regional.Schema(),
@@ -122,17 +122,14 @@ func ResourceContainerNamespaceCreate(ctx context.Context, d *schema.ResourceDat
122122
Name: types.ExpandOrGenerateString(d.Get("name").(string), "ns"),
123123
ProjectID: d.Get("project_id").(string),
124124
Region: region,
125+
ActivateVpcIntegration: true,
125126
}
126127

127128
rawTag, tagExist := d.GetOk("tags")
128129
if tagExist {
129130
createReq.Tags = types.ExpandStrings(rawTag)
130131
}
131132

132-
if activateVPC, ok := d.GetOk("activate_vpc_integration"); ok {
133-
createReq.ActivateVpcIntegration = activateVPC.(bool)
134-
}
135-
136133
ns, err := api.CreateNamespace(createReq, scw.WithContext(ctx))
137134
if err != nil {
138135
return diag.FromErr(err)

internal/services/container/namespace_test.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package container_test
22

33
import (
44
"fmt"
5-
"regexp"
65
"testing"
76

87
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -295,24 +294,10 @@ func TestAccNamespace_VPCIntegration(t *testing.T) {
295294
`,
296295
Check: resource.ComposeTestCheckFunc(
297296
isNamespacePresent(tt, "scaleway_container_namespace.main"),
298-
resource.TestCheckResourceAttr("scaleway_container_namespace.main", "activate_vpc_integration", "false"),
297+
resource.TestCheckResourceAttr("scaleway_container_namespace.main", "activate_vpc_integration", "true"),
299298
acctest.CheckResourceIDPersisted("scaleway_container_namespace.main", &namespaceID),
300299
),
301300
},
302-
{
303-
Config: `
304-
resource scaleway_vpc_private_network main {}
305-
306-
resource scaleway_container_namespace main {}
307-
308-
resource scaleway_container main {
309-
namespace_id = scaleway_container_namespace.main.id
310-
private_network_id = scaleway_vpc_private_network.main.id
311-
sandbox = "v1"
312-
}
313-
`,
314-
ExpectError: regexp.MustCompile("Application can't be attached to private network, vpc integration must be activated on its parent namespace"),
315-
},
316301
{
317302
Config: `
318303
resource scaleway_vpc_private_network main {}
@@ -332,7 +317,7 @@ func TestAccNamespace_VPCIntegration(t *testing.T) {
332317
isContainerPresent(tt, "scaleway_container.main"),
333318
resource.TestCheckResourceAttr("scaleway_container_namespace.main", "activate_vpc_integration", "true"),
334319
resource.TestCheckResourceAttrPair("scaleway_container.main", "private_network_id", "scaleway_vpc_private_network.main", "id"),
335-
acctest.CheckResourceIDChanged("scaleway_container_namespace.main", &namespaceID),
320+
acctest.CheckResourceIDPersisted("scaleway_container_namespace.main", &namespaceID),
336321
),
337322
},
338323
},

0 commit comments

Comments
 (0)