Skip to content

Commit d64e7a3

Browse files
authored
docs: update deprecated server types (#317)
The CX Gen 2 and CPX Gen 1 types are deprecated and will be removed from the API at the end of the year. This replaces all usages in our docs, so users do not have to figure it out themselves.
1 parent 9b921a2 commit d64e7a3

File tree

9 files changed

+51
-51
lines changed

9 files changed

+51
-51
lines changed

.web-docs/components/builder/hcloud/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ access tokens:
163163
```hcl
164164
source "hcloud" "basic_example" {
165165
token = "YOUR API TOKEN"
166-
image = "ubuntu-22.04"
167-
location = "nbg1"
168-
server_type = "cx22"
166+
image = "ubuntu-24.04"
167+
location = "hel1"
168+
server_type = "cx23"
169169
ssh_username = "root"
170170
}
171171

builder/hcloud/artifact_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestArtifactState_hcpPackerRegistryMetadata(t *testing.T) {
7070
StateData: map[string]interface{}{
7171
"source_image": "ubuntu-24.04",
7272
"source_image_id": int64(161547269),
73-
"server_type": "cpx11",
73+
"server_type": "cpx22",
7474
},
7575
}
7676

@@ -88,7 +88,7 @@ func TestArtifactState_hcpPackerRegistryMetadata(t *testing.T) {
8888
SourceImageID: "161547269",
8989
Labels: map[string]string{
9090
"source_image": "ubuntu-24.04",
91-
"server_type": "cpx11",
91+
"server_type": "cpx22",
9292
},
9393
}, image)
9494
}

builder/hcloud/step_create_server_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestStepCreateServer(t *testing.T) {
2222
Step: &stepCreateServer{},
2323
SetupStateFunc: func(state multistep.StateBag) {
2424
state.Put(StateSSHKeyID, int64(1))
25-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
25+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
2626
},
2727
WantRequests: []mockutil.Request{
2828
{Method: "GET", Path: "/ssh_keys/1",
@@ -43,7 +43,7 @@ func TestStepCreateServer(t *testing.T) {
4343
assert.Equal(t, "dummy-server", payload.Name)
4444
assert.Equal(t, int64(114690387), payload.Image.ID)
4545
assert.Equal(t, "nbg1", payload.Location)
46-
assert.Equal(t, "cpx11", payload.ServerType.Name)
46+
assert.Equal(t, "cpx22", payload.ServerType.Name)
4747
assert.True(t, payload.PublicNet.EnableIPv4)
4848
assert.True(t, payload.PublicNet.EnableIPv6)
4949
assert.Nil(t, payload.Networks)
@@ -94,7 +94,7 @@ func TestStepCreateServer(t *testing.T) {
9494
},
9595
SetupStateFunc: func(state multistep.StateBag) {
9696
state.Put(StateSSHKeyID, int64(1))
97-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
97+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
9898
},
9999
WantRequests: []mockutil.Request{
100100
{Method: "GET", Path: "/ssh_keys/1",
@@ -121,7 +121,7 @@ func TestStepCreateServer(t *testing.T) {
121121
assert.Equal(t, "dummy-server", payload.Name)
122122
assert.Equal(t, int64(114690387), payload.Image.ID)
123123
assert.Equal(t, "nbg1", payload.Location)
124-
assert.Equal(t, "cpx11", payload.ServerType.Name)
124+
assert.Equal(t, "cpx22", payload.ServerType.Name)
125125
assert.Equal(t, int64(986532), payload.Firewalls[0].Firewall)
126126
},
127127
Status: 201,
@@ -170,7 +170,7 @@ func TestStepCreateServer(t *testing.T) {
170170
},
171171
SetupStateFunc: func(state multistep.StateBag) {
172172
state.Put(StateSSHKeyID, int64(1))
173-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
173+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
174174
},
175175
WantRequests: []mockutil.Request{
176176
{Method: "GET", Path: "/ssh_keys/1",
@@ -191,7 +191,7 @@ func TestStepCreateServer(t *testing.T) {
191191
assert.Equal(t, "dummy-server", payload.Name)
192192
assert.Equal(t, int64(114690387), payload.Image.ID)
193193
assert.Equal(t, "nbg1", payload.Location)
194-
assert.Equal(t, "cpx11", payload.ServerType.Name)
194+
assert.Equal(t, "cpx22", payload.ServerType.Name)
195195
assert.Equal(t, []int64{12}, payload.Networks)
196196
},
197197
Status: 201,
@@ -242,7 +242,7 @@ func TestStepCreateServer(t *testing.T) {
242242
},
243243
SetupStateFunc: func(state multistep.StateBag) {
244244
state.Put(StateSSHKeyID, int64(1))
245-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
245+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
246246
},
247247
WantRequests: []mockutil.Request{
248248
{Method: "GET", Path: "/ssh_keys/1",
@@ -289,7 +289,7 @@ func TestStepCreateServer(t *testing.T) {
289289
assert.Equal(t, "dummy-server", payload.Name)
290290
assert.Equal(t, int64(114690387), payload.Image.ID)
291291
assert.Equal(t, "nbg1", payload.Location)
292-
assert.Equal(t, "cpx11", payload.ServerType.Name)
292+
assert.Equal(t, "cpx22", payload.ServerType.Name)
293293
assert.Nil(t, payload.Networks)
294294
assert.NotNil(t, payload.PublicNet)
295295
assert.Equal(t, int64(1), payload.PublicNet.IPv4ID)
@@ -342,7 +342,7 @@ func TestStepCreateServer(t *testing.T) {
342342
},
343343
SetupStateFunc: func(state multistep.StateBag) {
344344
state.Put(StateSSHKeyID, int64(1))
345-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
345+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
346346
},
347347
WantRequests: []mockutil.Request{
348348
{Method: "GET", Path: "/ssh_keys/1",
@@ -395,7 +395,7 @@ func TestStepCreateServer(t *testing.T) {
395395
assert.Equal(t, "dummy-server", payload.Name)
396396
assert.Equal(t, int64(114690387), payload.Image.ID)
397397
assert.Equal(t, "nbg1", payload.Location)
398-
assert.Equal(t, "cpx11", payload.ServerType.Name)
398+
assert.Equal(t, "cpx22", payload.ServerType.Name)
399399
assert.Nil(t, payload.Networks)
400400
assert.NotNil(t, payload.PublicNet)
401401
assert.Equal(t, int64(1), payload.PublicNet.IPv4ID)
@@ -447,7 +447,7 @@ func TestStepCreateServer(t *testing.T) {
447447
},
448448
SetupStateFunc: func(state multistep.StateBag) {
449449
state.Put(StateSSHKeyID, int64(1))
450-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
450+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
451451
},
452452
WantRequests: []mockutil.Request{
453453
{Method: "GET", Path: "/ssh_keys/1",
@@ -487,7 +487,7 @@ func TestStepCreateServer(t *testing.T) {
487487
},
488488
SetupStateFunc: func(state multistep.StateBag) {
489489
state.Put(StateSSHKeyID, int64(1))
490-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
490+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
491491
},
492492
WantRequests: []mockutil.Request{
493493
{Method: "GET", Path: "/ssh_keys/1",
@@ -526,7 +526,7 @@ func TestStepCreateServer(t *testing.T) {
526526
},
527527
SetupStateFunc: func(state multistep.StateBag) {
528528
state.Put(StateSSHKeyID, int64(1))
529-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
529+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
530530
},
531531
WantRequests: []mockutil.Request{
532532
{Method: "GET", Path: "/ssh_keys/1",
@@ -566,7 +566,7 @@ func TestStepCreateServer(t *testing.T) {
566566
},
567567
SetupStateFunc: func(state multistep.StateBag) {
568568
state.Put(StateSSHKeyID, int64(1))
569-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
569+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
570570
},
571571
WantRequests: []mockutil.Request{
572572
{Method: "GET", Path: "/ssh_keys/1",
@@ -603,7 +603,7 @@ func TestStepCreateServer(t *testing.T) {
603603
SetupConfigFunc: func(c *Config) {},
604604
SetupStateFunc: func(state multistep.StateBag) {
605605
state.Put(StateSSHKeyID, int64(1))
606-
state.Put(StateServerType, &hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"})
606+
state.Put(StateServerType, &hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"})
607607
},
608608
WantRequests: []mockutil.Request{
609609
{Method: "GET", Path: "/ssh_keys/1",

builder/hcloud/step_pre_validate_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ func TestStepPreValidate(t *testing.T) {
2222
Force: false,
2323
},
2424
SetupConfigFunc: func(c *Config) {
25-
c.UpgradeServerType = "cpx21"
25+
c.UpgradeServerType = "cpx32"
2626
},
2727
WantRequests: []mockutil.Request{
2828
{
29-
Method: "GET", Path: "/server_types?name=cpx11",
29+
Method: "GET", Path: "/server_types?name=cpx22",
3030
Status: 200,
3131
JSONRaw: `{
32-
"server_types": [{ "id": 9, "name": "cpx11", "architecture": "x86"}]
32+
"server_types": [{ "id": 109, "name": "cpx22", "architecture": "x86"}]
3333
}`,
3434
},
3535
{
36-
Method: "GET", Path: "/server_types?name=cpx21",
36+
Method: "GET", Path: "/server_types?name=cpx32",
3737
Status: 200,
3838
JSONRaw: `{
39-
"server_types": [{ "id": 10, "name": "cpx21", "architecture": "x86"}]
39+
"server_types": [{ "id": 110, "name": "cpx32", "architecture": "x86"}]
4040
}`,
4141
},
4242
{
@@ -51,7 +51,7 @@ func TestStepPreValidate(t *testing.T) {
5151
WantStateFunc: func(t *testing.T, state multistep.StateBag) {
5252
serverType, ok := state.Get(StateServerType).(*hcloud.ServerType)
5353
assert.True(t, ok)
54-
assert.Equal(t, hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"}, *serverType)
54+
assert.Equal(t, hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"}, *serverType)
5555

5656
_, ok = state.Get(StateSnapshotIDOld).(int64)
5757
assert.False(t, ok)
@@ -64,21 +64,21 @@ func TestStepPreValidate(t *testing.T) {
6464
Force: false,
6565
},
6666
SetupConfigFunc: func(c *Config) {
67-
c.UpgradeServerType = "cpx21"
67+
c.UpgradeServerType = "cpx32"
6868
},
6969
WantRequests: []mockutil.Request{
7070
{
71-
Method: "GET", Path: "/server_types?name=cpx11",
71+
Method: "GET", Path: "/server_types?name=cpx22",
7272
Status: 200,
7373
JSONRaw: `{
74-
"server_types": [{ "id": 9, "name": "cpx11", "architecture": "x86"}]
74+
"server_types": [{ "id": 109, "name": "cpx22", "architecture": "x86"}]
7575
}`,
7676
},
7777
{
78-
Method: "GET", Path: "/server_types?name=cpx21",
78+
Method: "GET", Path: "/server_types?name=cpx32",
7979
Status: 200,
8080
JSONRaw: `{
81-
"server_types": [{ "id": 10, "name": "cpx21", "architecture": "x86"}]
81+
"server_types": [{ "id": 110, "name": "cpx32", "architecture": "x86"}]
8282
}`,
8383
},
8484
{
@@ -93,7 +93,7 @@ func TestStepPreValidate(t *testing.T) {
9393
WantStateFunc: func(t *testing.T, state multistep.StateBag) {
9494
serverType, ok := state.Get(StateServerType).(*hcloud.ServerType)
9595
assert.True(t, ok)
96-
assert.Equal(t, hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"}, *serverType)
96+
assert.Equal(t, hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"}, *serverType)
9797

9898
_, ok = state.Get(StateSnapshotIDOld).(int64)
9999
assert.False(t, ok)
@@ -111,21 +111,21 @@ func TestStepPreValidate(t *testing.T) {
111111
Force: true,
112112
},
113113
SetupConfigFunc: func(c *Config) {
114-
c.UpgradeServerType = "cpx21"
114+
c.UpgradeServerType = "cpx32"
115115
},
116116
WantRequests: []mockutil.Request{
117117
{
118-
Method: "GET", Path: "/server_types?name=cpx11",
118+
Method: "GET", Path: "/server_types?name=cpx22",
119119
Status: 200,
120120
JSONRaw: `{
121-
"server_types": [{ "id": 9, "name": "cpx11", "architecture": "x86"}]
121+
"server_types": [{ "id": 109, "name": "cpx22", "architecture": "x86"}]
122122
}`,
123123
},
124124
{
125-
Method: "GET", Path: "/server_types?name=cpx21",
125+
Method: "GET", Path: "/server_types?name=cpx32",
126126
Status: 200,
127127
JSONRaw: `{
128-
"server_types": [{ "id": 10, "name": "cpx21", "architecture": "x86"}]
128+
"server_types": [{ "id": 110, "name": "cpx32", "architecture": "x86"}]
129129
}`,
130130
},
131131
{
@@ -140,7 +140,7 @@ func TestStepPreValidate(t *testing.T) {
140140
WantStateFunc: func(t *testing.T, state multistep.StateBag) {
141141
serverType, ok := state.Get(StateServerType).(*hcloud.ServerType)
142142
assert.True(t, ok)
143-
assert.Equal(t, hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"}, *serverType)
143+
assert.Equal(t, hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"}, *serverType)
144144

145145
snapshotIDOld, ok := state.Get(StateSnapshotIDOld).(int64)
146146
assert.True(t, ok)
@@ -153,30 +153,30 @@ func TestStepPreValidate(t *testing.T) {
153153
SnapshotName: "dummy-snapshot",
154154
},
155155
SetupConfigFunc: func(c *Config) {
156-
c.UpgradeServerType = "cpx21"
156+
c.UpgradeServerType = "cpx32"
157157
c.SkipCreateSnapshot = true
158158
},
159159
WantRequests: []mockutil.Request{
160160
{
161-
Method: "GET", Path: "/server_types?name=cpx11",
161+
Method: "GET", Path: "/server_types?name=cpx22",
162162
Status: 200,
163163
JSONRaw: `{
164-
"server_types": [{ "id": 9, "name": "cpx11", "architecture": "x86"}]
164+
"server_types": [{ "id": 109, "name": "cpx22", "architecture": "x86"}]
165165
}`,
166166
},
167167
{
168-
Method: "GET", Path: "/server_types?name=cpx21",
168+
Method: "GET", Path: "/server_types?name=cpx32",
169169
Status: 200,
170170
JSONRaw: `{
171-
"server_types": [{ "id": 10, "name": "cpx21", "architecture": "x86"}]
171+
"server_types": [{ "id": 110, "name": "cpx32", "architecture": "x86"}]
172172
}`,
173173
},
174174
},
175175
WantStepAction: multistep.ActionContinue,
176176
WantStateFunc: func(t *testing.T, state multistep.StateBag) {
177177
serverType, ok := state.Get(StateServerType).(*hcloud.ServerType)
178178
assert.True(t, ok)
179-
assert.Equal(t, hcloud.ServerType{ID: 9, Name: "cpx11", Architecture: "x86"}, *serverType)
179+
assert.Equal(t, hcloud.ServerType{ID: 109, Name: "cpx22", Architecture: "x86"}, *serverType)
180180
},
181181
},
182182
})

builder/hcloud/step_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func RunStepTestCases(t *testing.T, testCases []StepTestCase) {
3838
ServerName: "dummy-server",
3939
Image: "debian-12",
4040
SnapshotName: "dummy-snapshot",
41-
ServerType: "cpx11",
41+
ServerType: "cpx22",
4242
Location: "nbg1",
4343
SSHKeys: []string{"1"},
4444
}

docs/builders/hcloud.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ access tokens:
153153
```hcl
154154
source "hcloud" "basic_example" {
155155
token = "YOUR API TOKEN"
156-
image = "ubuntu-22.04"
157-
location = "nbg1"
158-
server_type = "cx22"
156+
image = "ubuntu-24.04"
157+
location = "hel1"
158+
server_type = "cx23"
159159
ssh_username = "root"
160160
}
161161

example/basic/build.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source "hcloud" "example" {
2121

2222
location = "hel1"
2323
image = "ubuntu-24.04"
24-
server_type = "cpx11"
24+
server_type = "cpx22"
2525
server_name = "example-{{ timestamp }}"
2626

2727
ssh_username = "root"

example/docker/build.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source "hcloud" "docker" {
2121

2222
location = "hel1"
2323
image = "ubuntu-24.04"
24-
server_type = "cpx11"
24+
server_type = "cpx22"
2525
server_name = "docker-{{ timestamp }}"
2626

2727
user_data = <<-EOF

example/hcp/build.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source "hcloud" "example" {
2121

2222
location = "hel1"
2323
image = "ubuntu-24.04"
24-
server_type = "cpx11"
24+
server_type = "cpx22"
2525
server_name = "example-{{ timestamp }}"
2626

2727
ssh_username = "root"

0 commit comments

Comments
 (0)