Skip to content

Commit dfddc5b

Browse files
committed
update cassette
1 parent e7aa2d1 commit dfddc5b

File tree

9 files changed

+6751
-2464
lines changed

9 files changed

+6751
-2464
lines changed

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ require (
3030
github.com/nats-io/jwt/v2 v2.8.0
3131
github.com/nats-io/nats.go v1.46.1
3232
github.com/robfig/cron/v3 v3.0.1
33-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250929150437-c65b49480cff
33+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251007144523-6d62825f6389
3434
github.com/stretchr/testify v1.11.1
3535
golang.org/x/crypto v0.42.0
3636
golang.org/x/sync v0.17.0
3737
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
3838
)
3939

40-
41-
4240
require (
4341
dario.cat/mergo v1.0.2 // indirect
4442
github.com/BurntSushi/toml v1.5.0 // indirect

go.sum

Lines changed: 240 additions & 159 deletions
Large diffs are not rendered by default.

internal/services/datawarehouse/deployment.go

Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -74,78 +74,80 @@ func ResourceDeployment() *schema.Resource {
7474
Optional: true,
7575
Description: "Password for the first user of the deployment",
7676
},
77-
"private_network": {
78-
Type: schema.TypeList,
79-
Optional: true,
80-
Computed: true,
81-
MaxItems: 1,
82-
Description: "If set, creates a private endpoint. Provide pn_id.",
83-
Elem: &schema.Resource{
84-
Schema: map[string]*schema.Schema{
85-
// Input: private network ID
86-
"pn_id": {
87-
Type: schema.TypeString,
88-
Optional: true,
89-
Description: "UUID of the private network for the endpoint",
90-
},
91-
// Computed fields returned from API:
92-
"id": {
93-
Type: schema.TypeString,
94-
Computed: true,
95-
Description: "ID of the private endpoint (computed)",
96-
},
97-
"dns_record": {
98-
Type: schema.TypeString,
99-
Computed: true,
100-
Description: "DNS record assigned to the private endpoint (computed)",
101-
},
102-
"protocol": {
103-
Type: schema.TypeString,
104-
Computed: true,
105-
Description: "Service protocol (e.g. \"tcp\", \"https\", \"mysql\") for the private endpoint",
106-
},
107-
"port": {
108-
Type: schema.TypeInt,
109-
Computed: true,
110-
Description: "TCP port number for the private endpoint",
111-
},
77+
"private_network": {
78+
Type: schema.TypeList,
79+
Optional: true,
80+
Computed: true,
81+
MaxItems: 1,
82+
Description: "If set, creates a private endpoint. Provide pn_id.",
83+
AtLeastOneOf: []string{"private_network", "public_network"},
84+
Elem: &schema.Resource{
85+
Schema: map[string]*schema.Schema{
86+
// Input: private network ID
87+
"pn_id": {
88+
Type: schema.TypeString,
89+
Optional: true,
90+
Description: "UUID of the private network for the endpoint",
91+
},
92+
// Computed fields returned from API:
93+
"id": {
94+
Type: schema.TypeString,
95+
Computed: true,
96+
Description: "ID of the private endpoint (computed)",
97+
},
98+
"dns_record": {
99+
Type: schema.TypeString,
100+
Computed: true,
101+
Description: "DNS record assigned to the private endpoint (computed)",
102+
},
103+
"protocol": {
104+
Type: schema.TypeString,
105+
Computed: true,
106+
Description: "Service protocol (e.g. \"tcp\", \"https\", \"mysql\") for the private endpoint",
107+
},
108+
"port": {
109+
Type: schema.TypeInt,
110+
Computed: true,
111+
Description: "TCP port number for the private endpoint",
112112
},
113113
},
114114
},
115+
},
115116

116-
// Computed block: public_network (max 1). Only returned if a public endpoint exists.
117-
"public_network": {
118-
Type: schema.TypeList,
119-
Optional: true,
120-
Computed: true,
121-
MaxItems: 1,
122-
Description: "Details of the public endpoint (computed). ",
123-
Elem: &schema.Resource{
124-
Schema: map[string]*schema.Schema{
125-
"id": {
126-
Type: schema.TypeString,
127-
Computed: true,
128-
Description: "ID of the public endpoint (computed)",
129-
},
130-
"dns_record": {
131-
Type: schema.TypeString,
132-
Computed: true,
133-
Description: "DNS record for the public endpoint (computed)",
134-
},
135-
"protocol": {
136-
Type: schema.TypeString,
137-
Computed: true,
138-
Description: "Service protocol (e.g. \"tcp\", \"https\", \"mysql\") for the public endpoint",
139-
},
140-
"port": {
141-
Type: schema.TypeInt,
142-
Computed: true,
143-
Description: "TCP port number for the public endpoint",
144-
},
117+
// Computed block: public_network (max 1). Only returned if a public endpoint exists.
118+
"public_network": {
119+
Type: schema.TypeList,
120+
Optional: true,
121+
Computed: true,
122+
MaxItems: 1,
123+
Description: "Details of the public endpoint (computed). At least one of private_network or public_network must be specified.",
124+
AtLeastOneOf: []string{"private_network", "public_network"},
125+
Elem: &schema.Resource{
126+
Schema: map[string]*schema.Schema{
127+
"id": {
128+
Type: schema.TypeString,
129+
Computed: true,
130+
Description: "ID of the public endpoint (computed)",
131+
},
132+
"dns_record": {
133+
Type: schema.TypeString,
134+
Computed: true,
135+
Description: "DNS record for the public endpoint (computed)",
136+
},
137+
"protocol": {
138+
Type: schema.TypeString,
139+
Computed: true,
140+
Description: "Service protocol (e.g. \"tcp\", \"https\", \"mysql\") for the public endpoint",
141+
},
142+
"port": {
143+
Type: schema.TypeInt,
144+
Computed: true,
145+
Description: "TCP port number for the public endpoint",
145146
},
146147
},
147148
},
148149
},
150+
},
149151
}
150152
}
151153

internal/services/datawarehouse/deployment_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ resource "scaleway_datawarehouse_deployment" "main" {
4444
ram_per_cpu = 4
4545
password = "password@1234567"
4646
47-
# No endpoint blocks - test deployment creation only
47+
# Public endpoint is required
48+
public_network {}
4849
}
4950
`, latestVersion),
5051
Check: resource.ComposeTestCheckFunc(
@@ -56,8 +57,8 @@ resource "scaleway_datawarehouse_deployment" "main" {
5657
resource.TestCheckResourceAttr("scaleway_datawarehouse_deployment.main", "cpu_max", "4"),
5758
resource.TestCheckResourceAttr("scaleway_datawarehouse_deployment.main", "ram_per_cpu", "4"),
5859

59-
// No endpoints - verify both are absent
60-
resource.TestCheckResourceAttr("scaleway_datawarehouse_deployment.main", "public_network.#", "0"),
60+
// Public endpoint is present
61+
resource.TestCheckResourceAttr("scaleway_datawarehouse_deployment.main", "public_network.#", "1"),
6162
resource.TestCheckResourceAttr("scaleway_datawarehouse_deployment.main", "private_network.#", "0"),
6263
),
6364
},

0 commit comments

Comments
 (0)