Skip to content

Commit 8994127

Browse files
authored
Merge branch 'master' into instance_eos_filter_by_offer_id
2 parents 8c3349b + 4ae66ec commit 8994127

22 files changed

+4484
-1383
lines changed

docs/resources/apple_silicon_server.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ resource "scaleway_apple_silicon_server" "server" {
1919
}
2020
```
2121

22+
### Enable VPC and attach private network
23+
24+
```terraform
25+
resource "scaleway_vpc" "vpc-apple-silicon" {
26+
name = "vpc-apple-silicon"
27+
}
28+
29+
resource "scaleway_vpc_private_network" "pn-apple-silicon" {
30+
name = "pn-apple-silicon"
31+
vpc_id = scaleway_vpc.vpc-apple-silicon.id
32+
}
33+
34+
resource "scaleway_apple_silicon_server" "my-server" {
35+
name = "TestAccServerEnableVPC"
36+
type = "M2-M"
37+
enable_vpc = true
38+
private_network {
39+
id = scaleway_vpc_private_network.pn-apple-silicon.id
40+
}
41+
}
42+
```
43+
2244
## Argument Reference
2345

2446
The following arguments are supported:
@@ -36,6 +58,10 @@ The following arguments are supported:
3658
associated with.
3759
- `enable_vpc` - (Optional, Default: false): Enables the VPC option when set to true.
3860

61+
- `private_network` - (Optional) The private networks to attach to the server
62+
- `id` - The private network ID
63+
- `ipam_ip_ids` - A list of IPAM IP IDs to attach to the server.
64+
3965
- `commitment_type` (Optional, Default: duration_24h): Activate commitment for this server
4066

4167
- `public_bandwidth` (Optional) Configure the available public bandwidth for your server in bits per second. This option may not be available for all offers.
@@ -59,6 +85,11 @@ In addition to all arguments above, the following attributes are exported:
5985
- `deleted_at` - The minimal date and time on which you can delete this server due to Apple licence.
6086
- `organization_id` - The organization ID the server is associated with.
6187
- `vpc_status` - The current status of the VPC option.
88+
- `private_network` - The private networks to attach to the server
89+
- `vlan` - The VLAN ID associated with the private network.
90+
- `status` - The current status of the private network.
91+
- `created_at` - The date and time the private network was created.
92+
- `updated_at` - The date and time the private network was last updated.
6293

6394
## Import
6495

docs/resources/domain_record.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ The following arguments are supported:
207207

208208
- `dns_zone` - (Required) The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
209209

210-
- `keep_empty_zone` - (Optional, defaults to `false`) When destroying a resource, if only NS records remain and this is set to `false`, the zone will be deleted. Note that each zone not deleted will [be billed](https://www.scaleway.com/en/dns/).
211-
212210
- `name` - (Optional) The name of the record (can be an empty string for a root record).
213211

214212
- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `DNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).

docs/resources/key_manager_key.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
subcategory: "Key Manager"
3+
page_title: "Scaleway: scaleway_key_manager_key"
4+
---
5+
# Resource: scaleway_key_manager_key
6+
7+
Provides a Scaleway Key Manager Key resource.
8+
This resource allows you to create and manage cryptographic keys in Scaleway Key Manager (KMS).
9+
10+
## Example Usage
11+
12+
```terraform
13+
resource "scaleway_key_manager_key" "main" {
14+
name = "my-kms-key"
15+
region = "fr-par"
16+
project_id = "your-project-id" # optional, will use provider default if omitted
17+
usage = "symmetric_encryption"
18+
description = "Key for encrypting secrets"
19+
tags = ["env:prod", "kms"]
20+
unprotected = true
21+
22+
rotation_policy {
23+
rotation_period = "720h" # 30 days
24+
}
25+
}
26+
```
27+
28+
## Argument Reference
29+
30+
The following arguments are supported:
31+
32+
- `name` (String) – The name of the key.
33+
- `region` (String) – The region in which to create the key (e.g., `fr-par`).
34+
- `project_id` (String, Optional) – The ID of the project the key belongs to.
35+
- `usage` (String, **Required**) – The usage of the key. Valid values are:
36+
- `symmetric_encryption`
37+
- `asymmetric_encryption`
38+
- `asymmetric_signing`
39+
- `description` (String, Optional) – A description for the key.
40+
- `tags` (List of String, Optional) – A list of tags to assign to the key.
41+
- `unprotected` (Boolean, Optional) – If `true`, the key can be deleted. Defaults to `false` (protected).
42+
- `origin` (String, Optional) – The origin of the key. Valid values are:
43+
- `scaleway_kms` (default)
44+
- `external`
45+
- `rotation_policy` (Block, Optional) – Rotation policy for the key:
46+
- `rotation_period` (String, Optional) – The period between key rotations (e.g., `"720h"` for 30 days).
47+
48+
## Attributes Reference
49+
50+
In addition to all arguments above, the following attributes are exported:
51+
52+
- `id` – The ID of the key.
53+
- `state` – The state of the key (e.g., `enabled`).
54+
- `created_at` – The date and time when the key was created.
55+
- `updated_at` – The date and time when the key was last updated.
56+
- `rotation_count` – The number of times the key has been rotated.
57+
- `protected` – Whether the key is protected from deletion.
58+
- `locked` – Whether the key is locked.
59+
- `rotated_at` – The date and time when the key was last rotated.
60+
- `origin_read` – The origin of the key as returned by the API.
61+
- `region_read` – The region of the key as returned by the API.
62+
- `rotation_policy` (Block)
63+
- `rotation_period` – The period between key rotations.
64+
- `next_rotation_at` – The date and time of the next scheduled rotation.
65+
66+
## Import
67+
68+
You can import a key using its ID and region:
69+
70+
```shell
71+
terraform import scaleway_key_manager_key.main fr-par/11111111-2222-3333-4444-555555555555
72+
```
73+
74+
## Notes
75+
76+
- **Protection**: By default, keys are protected and cannot be deleted. To allow deletion, set `unprotected = true` when creating the key.
77+
- **Rotation Policy**: The `rotation_policy` block allows you to set automatic rotation for your key.
78+
- **Origin**: The `origin` argument is optional and defaults to `scaleway_kms`. Use `external` if you want to import an external key (see Scaleway documentation for details).
79+
- **Project and Region**: If not specified, `project_id` and `region` will default to the provider configuration.
80+
81+
## Example: Asymmetric Key
82+
83+
```terraform
84+
resource "scaleway_key_manager_key" "asym" {
85+
name = "asymmetric-key"
86+
region = "fr-par"
87+
usage = "asymmetric_signing"
88+
description = "Key for signing documents"
89+
unprotected = true
90+
}
91+
```

docs/resources/vpc_acl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "scaleway_vpc_acl" "acl01" {
3939
The following arguments are supported:
4040

4141
- `vpc_id` - (Required) The VPC ID the ACL belongs to.
42-
- `default_policy` - (Required) The action to take for packets which do not match any rules.
42+
- `default_policy` - (Optional. Defaults to `accept`) The action to take for packets which do not match any rules.
4343
- `is_ipv6` - (Optional) Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
4444
- `rules` - (Optional) The list of Network ACL rules.
4545
- `protocol` - (Optional) The protocol to which this rule applies. Default value: ANY.

internal/provider/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/ipam"
3333
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/jobs"
3434
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/k8s"
35+
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/keymanager"
3536
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/lb"
3637
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/marketplace"
3738
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/mnq"
@@ -195,6 +196,7 @@ func Provider(config *Config) plugin.ProviderFunc {
195196
"scaleway_k8s_acl": k8s.ResourceACL(),
196197
"scaleway_k8s_cluster": k8s.ResourceCluster(),
197198
"scaleway_k8s_pool": k8s.ResourcePool(),
199+
"scaleway_key_manager_key": keymanager.ResourceKeyManagerKey(),
198200
"scaleway_lb": lb.ResourceLb(),
199201
"scaleway_lb_acl": lb.ResourceACL(),
200202
"scaleway_lb_backend": lb.ResourceBackend(),

internal/services/domain/record.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var changeKeys = []string{
2929
"weighted",
3030
"view",
3131
"dns_zone",
32-
"keep_empty_zone",
3332
}
3433

3534
func ResourceRecord() *schema.Resource {
@@ -56,12 +55,6 @@ func ResourceRecord() *schema.Resource {
5655
Required: true,
5756
ForceNew: true,
5857
},
59-
"keep_empty_zone": {
60-
Type: schema.TypeBool,
61-
Description: "When destroy a resource record, if a zone have only NS, delete the zone",
62-
Optional: true,
63-
Default: false,
64-
},
6558
"root_zone": {
6659
Type: schema.TypeBool,
6760
Description: "Does the DNS zone is the root zone or not",
@@ -503,7 +496,7 @@ func resourceDomainRecordDelete(ctx context.Context, d *schema.ResourceData, m a
503496
d.SetId("")
504497

505498
// for non-root zone, if the zone have only NS records, then delete the zone
506-
if d.Get("keep_empty_zone").(bool) || d.Get("root_zone").(bool) {
499+
if d.Get("root_zone").(bool) {
507500
return nil
508501
}
509502

internal/services/domain/record_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,6 @@ func TestAccDomainRecord_SRVZone(t *testing.T) {
675675
name = "%[2]s"
676676
type = "%[3]s"
677677
data = "%[4]s"
678-
keep_empty_zone = false
679678
}
680679
`, testDNSZone, name, recordType, data),
681680
Check: resource.ComposeTestCheckFunc(

0 commit comments

Comments
 (0)