Skip to content

chore: add support for terrafmt #3085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/terrafmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Run terrafmt
on:
pull_request:
push:
merge_group:

jobs:
terrafmt:
runs-on: ubuntu-latest
steps:
# Checkout should always be before setup-go to ensure caching is working
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.24.0
- name: Run terrafmt on documentation
run: go tool terrafmt fmt --verbose --check ./docs
2 changes: 1 addition & 1 deletion docs/data-sources/account_ssh_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following commands allow you to:
```hcl
# Get info by SSH key name
data "scaleway_account_ssh_key" "my_key" {
name = "my-key-name"
name = "my-key-name"
}

# Get info by SSH key id
Expand Down
50 changes: 25 additions & 25 deletions docs/data-sources/baremetal_easy_partitioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,47 @@ This data source simplifies the process of generating valid partitioning configu

```hcl
data "scaleway_easy_partitioning" "default" {
offer_id = "11111111-1111-1111-1111-111111111111"
os_id = "22222222-2222-2222-2222-222222222222"
swap = true
extra_partition = true
ext_4_mountpoint = "/data"
offer_id = "11111111-1111-1111-1111-111111111111"
os_id = "22222222-2222-2222-2222-222222222222"
swap = true
extra_partition = true
ext_4_mountpoint = "/data"
}
```

```hcl
data "scaleway_baremetal_offer" "my_offer" {
zone = "fr-par-1"
name = "EM-B220E-NVME"
zone = "fr-par-1"
name = "EM-B220E-NVME"
}

data "scaleway_baremetal_os" "my_os" {
zone = "fr-par-1"
name = "Ubuntu"
version = "22.04 LTS (Jammy Jellyfish)"
zone = "fr-par-1"
name = "Ubuntu"
version = "22.04 LTS (Jammy Jellyfish)"
}

resource "scaleway_iam_ssh_key" "main" {
name = "my-ssh-key"
public_key = "my-ssh-key-public"
name = "my-ssh-key"
public_key = "my-ssh-key-public"
}

data "scaleway_baremetal_easy_partitioning" "test" {
offer_id = data.scaleway_baremetal_offer.my_offer.offer_id
os_id = data.scaleway_baremetal_os.my_os.os_id
swap = false
ext_4_mountpoint = "/hello"
offer_id = data.scaleway_baremetal_offer.my_offer.offer_id
os_id = data.scaleway_baremetal_os.my_os.os_id
swap = false
ext_4_mountpoint = "/hello"
}

resource "scaleway_baremetal_server" "base" {
name = "my-baremetal-server"
zone = "fr-par-1"
description = "test a description"
offer = data.scaleway_baremetal_offer.my_offer.offer_id
os = data.scaleway_baremetal_os.my_os.os_id
partitioning = data.scaleway_baremetal_easy_partitioning.test.json_partition
tags = ["terraform-test", "scaleway_baremetal_server", "minimal", "edited"]
ssh_key_ids = [scaleway_iam_ssh_key.main.id]
name = "my-baremetal-server"
zone = "fr-par-1"
description = "test a description"
offer = data.scaleway_baremetal_offer.my_offer.offer_id
os = data.scaleway_baremetal_os.my_os.os_id
partitioning = data.scaleway_baremetal_easy_partitioning.test.json_partition
tags = ["terraform-test", "scaleway_baremetal_server", "minimal", "edited"]
ssh_key_ids = [scaleway_iam_ssh_key.main.id]
}
```

Expand All @@ -75,4 +75,4 @@ In addition to all above arguments, the following attributes are exported:

- `id` — A composite identifier derived from offer_id and os_id.

- `json_partition` — A validated partitioning schema in JSON format that can be directly used for BareMetal server deployment.
- `json_partition` — A validated partitioning schema in JSON format that can be directly used for BareMetal server deployment.
2 changes: 1 addition & 1 deletion docs/data-sources/baremetal_os.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can also use the [scaleway-cli](https://github.com/scaleway/scaleway-cli) wi
```hcl
# Get info by os name and version
data "scaleway_baremetal_os" "by_name" {
name = "Ubuntu"
name = "Ubuntu"
version = "20.04 LTS (Focal Fossa)"
}

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/billing_consumptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ In addition to all arguments above, the following attributes are exported:
- `unit` - The unit of consumed quantity.
- `billed_quantity` - The consumed quantity.
- `project_id` - The project ID of the consumption.
- `updated_at` - The last consumption update date.
- `updated_at` - The last consumption update date.
2 changes: 1 addition & 1 deletion docs/data-sources/block_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data "scaleway_block_snapshot" "my_snapshot" {

// Get info by snapshot name and volume id
data "scaleway_block_snapshot" "my_snapshot" {
name = "my-name"
name = "my-name"
volume_id = "11111111-1111-1111-1111-111111111111"
}

Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/cockpit_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following example retrieves a Cockpit data source by its unique ID.

```terraform
data "scaleway_cockpit_source" "example" {
id = "fr-par/11111111-1111-1111-1111-111111111111"
id = "fr-par/11111111-1111-1111-1111-111111111111"
}
```

Expand All @@ -27,9 +27,9 @@ You can also retrieve a data source by specifying filtering criteria such as `na

```terraform
data "scaleway_cockpit_source" "filtered" {
project_id = "11111111-1111-1111-1111-111111111111"
region = "fr-par"
name = "my-data-source"
project_id = "11111111-1111-1111-1111-111111111111"
region = "fr-par"
name = "my-data-source"
}
```

Expand Down
12 changes: 6 additions & 6 deletions docs/data-sources/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ resource scaleway_container_namespace main {
}

resource scaleway_container main {
name = "test-container-data"
namespace_id = scaleway_container_namespace.main.id
name = "test-container-data"
namespace_id = scaleway_container_namespace.main.id
}

// Get info by container name
data "scaleway_container" "by_name" {
namespace_id = scaleway_container_namespace.main.id
name = scaleway_container.main.name
namespace_id = scaleway_container_namespace.main.id
name = scaleway_container.main.name
}

// Get info by container ID
data "scaleway_container" "by_id" {
namespace_id = scaleway_container_namespace.main.id
container_id = scaleway_container.main.id
namespace_id = scaleway_container_namespace.main.id
container_id = scaleway_container.main.id
}
```

Expand Down
12 changes: 6 additions & 6 deletions docs/data-sources/flexible_ips.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about multiple Flexible IPs.
```hcl
# Find ips that share the same tags
data "scaleway_flexible_ips" "fips_by_tags" {
tags = [ "a tag" ]
tags = ["a tag"]
}

# Find ips that share the same Server ID
Expand All @@ -21,19 +21,19 @@ data "scaleway_baremetal_offer" "my_offer" {
}

resource "scaleway_baremetal_server" "base" {
name = "MyServer"
offer = data.scaleway_baremetal_offer.my_offer.offer_id
install_config_afterward = true
name = "MyServer"
offer = data.scaleway_baremetal_offer.my_offer.offer_id
install_config_afterward = true
}

resource "scaleway_flexible_ip" "first" {
server_id = scaleway_baremetal_server.base.id
tags = [ "foo", "first" ]
tags = ["foo", "first"]
}

resource "scaleway_flexible_ip" "second" {
server_id = scaleway_baremetal_server.base.id
tags = [ "foo", "second" ]
tags = ["foo", "second"]
}

data "scaleway_flexible_ips" "fips_by_server_id" {
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ The following commands allow you to:
```terraform
// Get info by function name
data "scaleway_function" "my_function" {
name = "my-namespace-name"
name = "my-namespace-name"
namespace_id = "11111111-1111-1111-1111-111111111111"
}

// Get info by function ID
data "scaleway_function" "my_function" {
function_id = "11111111-1111-1111-1111-111111111111"
function_id = "11111111-1111-1111-1111-111111111111"
namespace_id = "11111111-1111-1111-1111-111111111111"
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/iam_ssh_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Use this data source to get SSH key information based on its ID or name.
```hcl
# Get info by SSH key name
data "scaleway_iam_ssh_key" "my_key" {
name = "my-key-name"
name = "my-key-name"
}

# Get info by SSH key id
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/instance_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about an instance image.
```hcl
# Get info by image name
data "scaleway_instance_image" "my_image" {
name = "my-image-name"
name = "my-image-name"
}

# Get info by image id
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/instance_placement_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about a Security Group.
```hcl
# Get info by placement group name
data "scaleway_instance_placement_group" "my_key" {
name = "my-placement-group-name"
name = "my-placement-group-name"
}

# Get info by placement group id
Expand Down Expand Up @@ -41,4 +41,4 @@ In addition to all above arguments, the following attributes are exported:
- `policy_mode` -The [policy mode](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) of the placement group.
- `tags` - A list of tags to apply to the placement group.
- `policy_respected` - Is true when the policy is respected.
- `organization_id` - The organization ID the placement group is associated with.
- `organization_id` - The organization ID the placement group is associated with.
6 changes: 3 additions & 3 deletions docs/data-sources/instance_private_nic.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Gets information about an instance private NIC.

```hcl
data "scaleway_instance_private_nic" "by_nic_id" {
server_id = "11111111-1111-1111-1111-111111111111"
server_id = "11111111-1111-1111-1111-111111111111"
private_nic_id = "11111111-1111-1111-1111-111111111111"
}

data "scaleway_instance_private_nic" "by_pn_id" {
server_id = "11111111-1111-1111-1111-111111111111"
server_id = "11111111-1111-1111-1111-111111111111"
private_network_id = "11111111-1111-1111-1111-111111111111"
}

data "scaleway_instance_private_nic" "by_tags" {
server_id = "11111111-1111-1111-1111-111111111111"
tags = ["mytag"]
tags = ["mytag"]
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/instance_security_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about a Security Group.
```hcl
# Get info by security group name
data "scaleway_instance_security_group" "my_key" {
name = "my-security-group-name"
name = "my-security-group-name"
}

# Get info by security group id
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/instance_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about an instance server.
```hcl
# Get info by server name
data "scaleway_instance_server" "my_key" {
name = "my-server-name"
name = "my-server-name"
}

# Get info by server id
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/instance_servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gets information about multiple instance servers.
```hcl
# Find servers by tag
data "scaleway_instance_servers" "my_key" {
tags = ["tag"]
tags = ["tag"]
}

# Find servers by name and zone
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/iot_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ data "scaleway_iot_device" "my_device" {

# Get info by name and hub_id
data "scaleway_iot_device" "my_device" {
name = "foobar"
name = "foobar"
hub_id = "11111111-1111-1111-1111-111111111111"
}

Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/ipam_ip.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ Get an Instance's IP on a Private Network.
```terraform
# Connect your instance to a private network using a private nic.
resource "scaleway_instance_private_nic" "nic" {
server_id = scaleway_instance_server.server.id
server_id = scaleway_instance_server.server.id
private_network_id = scaleway_vpc_private_network.pn.id
}

# Find server private IPv4 using private-nic mac address
data "scaleway_ipam_ip" "by_mac" {
mac_address = scaleway_instance_private_nic.nic.mac_address
type = "ipv4"
type = "ipv4"
}

# Find server private IPv4 using private-nic id
data "scaleway_ipam_ip" "by_id" {
resource {
id = scaleway_instance_private_nic.nic.id
id = scaleway_instance_private_nic.nic.id
type = "instance_private_nic"
}
type = "ipv4"
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/k8s_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about a Kubernetes Cluster.
```hcl
# Get info by cluster name
data "scaleway_k8s_cluster" "my_key" {
name = "my-cluster-name"
name = "my-cluster-name"
}

# Get info by cluster id
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/k8s_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gets information about a Kubernetes Cluster's Pool.
```hcl
# Get info by pokl name (need cluster_id)
data "scaleway_k8s_pool" "my_key" {
name = "my-pool-name"
name = "my-pool-name"
cluster_id = "11111111-1111-1111-1111-111111111111"
}

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/lb.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported:

- `tags` - The tags associated with the Load Balancer.

- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Load Balancer exists.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Load Balancer exists.
2 changes: 1 addition & 1 deletion docs/data-sources/lb_acls.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ In addition to all arguments above, the following attributes are exported:
- `http_filter` - The HTTP filter to match.
- `http_filter_value` - The possible values to match for a given HTTP filter.
- `http_filter_option` - A list of possible values for the HTTP filter based on the HTTP header.
- `invert` - The condition will be of type "unless" if invert is set to `true`
- `invert` - The condition will be of type "unless" if invert is set to `true`
2 changes: 1 addition & 1 deletion docs/data-sources/lb_backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ The following arguments are supported:

## Attributes Reference

See the [Load Balancer backend resource](../resources/lb_backend.md) for details on the returned attributes - they are identical.
See the [Load Balancer backend resource](../resources/lb_backend.md) for details on the returned attributes - they are identical.
Loading
Loading