Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ jobs:
- uses: hashicorp/setup-terraform@v3
- run: go tool tfplugindocs validate
- run: go tool tfplugindocs generate
- run: git diff --exit-code docs
53 changes: 53 additions & 0 deletions templates/data-sources/account_project.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
subcategory: "Account"
page_title: "Scaleway: scaleway_account_project"
---

# scaleway_account_project

The `scaleway_account_project` data source is used to retrieve information about a Scaleway project.

Refer to the Organizations and Projects [documentation](https://www.scaleway.com/en/docs/organizations-and-projects/) and [API documentation](https://www.scaleway.com/en/developers/api/account/project-api/) for more information.


## Retrieve a Scaleway Project

The following commands allow you to:

- retrieve a Project by its name
- retrieve a Project by its ID
- retrieve the default project of an Organization

```hcl
# Get info by name
data scaleway_account_project "by_name" {
name = "myproject"
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
# Get default project
data scaleway_account_project "by_name" {
name = "default"
}
# Get info by ID
data scaleway_account_project "by_id" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Argument Reference

This section lists the arguments that you can provide to the `scaleway_account_project` data source to filter and retrieve the desired project. Each argument has a specific purpose:

- `name` - (Optional) The name of the Project.
Only one of the `name` and `project_id` should be specified.

- `project_id` - (Optional) The unique identifier of the Project.
Only one of the `name` and `project_id` should be specified.

- `organization_id` - (Optional) The unique identifier of the Organization with which the Project is associated.

If no default `organization_id` is set, one must be set explicitly in this datasource

## Attribute reference

The `scaleway_account_project` data source exports certain attributes once the account information is retrieved. These attributes can be referenced in other parts of your Terraform configuration. The exported attributes come from the `account_project` [resource](../resources/account_project.md).
57 changes: 57 additions & 0 deletions templates/data-sources/account_projects.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
subcategory: "Account"
page_title: "Scaleway: scaleway_account_projects"
---

# scaleway_account_projects

The `scaleway_account_projects` data source is used to list all Scaleway projects in an Organization.

Refer to the Organizations and Projects [documentation](https://www.scaleway.com/en/docs/organizations-and-projects/) and [API documentation](https://www.scaleway.com/en/developers/api/account/project-api/) for more information.


## Retrieve a Scaleway Projects

The following commands allow you to:

- retrieve all Projects in an Organization

```hcl
# Get all Projects in an Organization
data scaleway_account_projects "all" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

## Example Usage

### Deploy an SSH key in all your organization's projects

```hcl
data scaleway_account_projects "all" {}

resource "scaleway_account_ssh_key" "main" {
name = "main"
public_key = local.public_key
count = length(data.scaleway_account_projects.all.projects)
project_id = data.scaleway_account_projects.all.projects[count.index].id
}
```

## Argument Reference

- `organization_id` - (Optional) The unique identifier of the Organization with which the Projects are associated.
If no default `organization_id` is set, one must be set explicitly in this datasource


## Attribute reference

The `scaleway_account_projects` data source exports the following attributes:

- `projects` - (Computed) A list of projects. Each project has the following attributes:
- `id` - (Computed) The unique identifier of the project.
- `name` - (Computed) The name of the project.
- `organization_id` - (Computed) The unique identifier of the organization with which the project is associated.
- `created_at` - (Computed) The date and time when the project was created.
- `updated_at` - (Computed) The date and time when the project was updated.
- `description` - (Computed) The description of the project.
51 changes: 51 additions & 0 deletions templates/data-sources/account_ssh_key.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
subcategory: "Account"
page_title: "Scaleway: scaleway_account_ssh_key"
---

# scaleway_account_ssh_key

The `scaleway_account_ssh_key` data source is used to retrieve information about a the SSH key of a Scaleway account.

Refer to the Organizations and Projects [documentation](https://www.scaleway.com/en/docs/organizations-and-projects/how-to/create-ssh-key/) and [API documentation](https://www.scaleway.com/en/developers/api/iam/#path-ssh-keys) for more information.


## Retrieve the SSH key of a Scaleway account

The following commands allow you to:

- retrieve an SSH key by its name
- retrieve an SSH key by its ID

```hcl
# Get info by SSH key name
data "scaleway_account_ssh_key" "my_key" {
name = "my-key-name"
}

# Get info by SSH key id
data "scaleway_account_ssh_key" "my_key" {
ssh_key_id = "11111111-1111-1111-1111-111111111111"
}
```

## Argument Reference

This section lists the arguments that you can provide to the `scaleway_account_ssh_key` data source to filter and retrieve the desired SSH key. Each argument has a specific purpose:

- `name` - The name of the SSH key.
- `ssh_key_id` - The unique identifier of the SSH key.

-> **Note** You must specify at least one: `name` and/or `ssh_key_id`.

- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The unique identifier of the project with which the SSH key is associated.

## Attributes Reference

The `scaleway_account_ssh_key` data source exports certain attributes once the SSH key information is retrieved. These attributes can be referenced in other parts of your Terraform configuration.

In addition to all above arguments, the following attributes are exported:

- `id` - The unique identifier of the SSH public key.
- `public_key` - The string of the SSH public key.
- `organization_id` - The unique identifier of the Organization with which the SSH key is associated.
39 changes: 39 additions & 0 deletions templates/data-sources/availability_zones.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
subcategory: "Account"
page_title: "Scaleway: scaleway_availability_zones"
---

# scaleway_availability_zones

The `scaleway_availability_zones` data source is used to retrieve information about the available zones based on its Region.

For technical and legal reasons, some products are split by Region or by Availability Zones. When using such product,
you can choose the location that better fits your need (country, latency, etc.).

Refer to the Account [documentation](https://www.scaleway.com/en/docs/console/account/reference-content/products-availability/) for more information.

## Retrieve the Availability Zones of a Region

The following command allow you to retrieve a the AZs of a Region.

```hcl
# Get info by Region key
data "scaleway_availability_zones" "main" {
region = "nl-ams"
}
```

## Argument Reference

This section lists the arguments that you can provide to the `scaleway_availability_zones` data source to filter and retrieve the desired AZs:

- `region` - Region is represented as a Geographical area, such as France. Defaults to `fr-par`.

## Attributes Reference

The `scaleway_availability_zones` data source exports certain attributes once the Availability Zones information is retrieved. These attributes can be referenced in other parts of your Terraform configuration.

In addition to all above arguments, the following attributes are exported:

- `id` - The unique identifier of the Region
- `zones` - The list of availability zones in each Region
82 changes: 82 additions & 0 deletions templates/data-sources/baremetal_offer.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
subcategory: "Elastic Metal"
page_title: "Scaleway: scaleway_baremetal_offer"
---

# scaleway_baremetal_offer

Gets information about a baremetal offer. For more information, see the [API documentation](https://developers.scaleway.com/en/products/baremetal/api).

## Example Usage

```hcl
# Get info by offer name
data "scaleway_baremetal_offer" "my_offer" {
zone = "fr-par-2"
name = "EM-A210R-SATA"
}

# Get info by offer id
data "scaleway_baremetal_offer" "my_offer" {
zone = "fr-par-2"
offer_id = "25dcf38b-c90c-4b18-97a2-6956e9d1e113"
}
```

## Argument Reference

- `name` - (Optional) The offer name. Only one of `name` and `offer_id` should be specified.

- `subscription_period` - (Optional) Period of subscription the desired offer. Should be `hourly` or `monthly`.

- `offer_id` - (Optional) The offer id. Only one of `name` and `offer_id` should be specified.

- `allow_disabled` - (Optional, default `false`) Include disabled offers.

- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the offer should be created.

## Attributes Reference

In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the offer.

~> **Important:** Baremetal offers' IDs are [zoned](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`

- `bandwidth` - Available Bandwidth with the offer.

- `commercial_range` - Commercial range of the offer.

- `cpu` - A list of cpu specifications. (Structure is documented below.)

- `disk` - A list of disk specifications. (Structure is documented below.)

- `memory` - A list of memory specifications. (Structure is documented below.)

- `stock` - Stock status for this offer. Possible values are: `empty`, `low` or `available`.

The `cpu` block supports:

- `name` - Name of the CPU.

- `core_count`- Number of core on this CPU.

- `frequency`- Frequency of the CPU in MHz.

- `thread_count`- Number of thread on this CPU.

The `disk` block supports:

- `type` - Type of disk.

- `capacity`- Capacity of the disk in GB.

The `memory` block supports:

- `type` - Type of memory.

- `capacity`- Capacity of the memory in GB.

- `frequency` - Frequency of the memory in MHz.

- `is_ecc`- True if error-correcting code is available on this memory.
40 changes: 40 additions & 0 deletions templates/data-sources/baremetal_option.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
subcategory: "Elastic Metal"
page_title: "Scaleway: scaleway_baremetal_option"
---

# scaleway_baremetal_option

Gets information about a baremetal option.
For more information, see the [API documentation](https://developers.scaleway.com/en/products/baremetal/api).

## Example Usage

```hcl
# Get info by option name
data "scaleway_baremetal_option" "by_name" {
name = "Remote Access"
}

# Get info by option id
data "scaleway_baremetal_option" "by_id" {
option_id = "931df052-d713-4674-8b58-96a63244c8e2"
}
```

## Argument Reference

- `name` - (Optional) The option name. Only one of `name` and `option_id` should be specified.
- `option_id` - (Optional) The option id. Only one of `name` and `option_id` should be specified.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the option exists.

## Attributes Reference

In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the option.

~> **Important:** Baremetal options' IDs are [zoned](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`

- `name` - The name of the option.
- `manageable` - Is false if the option could not be added or removed.
41 changes: 41 additions & 0 deletions templates/data-sources/baremetal_os.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
subcategory: "Elastic Metal"
page_title: "Scaleway: scaleway_baremetal_os"
---

# scaleway_baremetal_os

Gets information about a baremetal operating system.
For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/elastic-metal/#path-os-list-available-oses).

You can also use the [scaleway-cli](https://github.com/scaleway/scaleway-cli) with `scw baremetal os list` to list all available operating systems.

## Example Usage

```hcl
# Get info by os name and version
data "scaleway_baremetal_os" "by_name" {
name = "Ubuntu"
version = "20.04 LTS (Focal Fossa)"
}

# Get info by os id
data "scaleway_baremetal_os" "by_id" {
os_id = "03b7f4ba-a6a1-4305-984e-b54fafbf1681"
}
```

## Argument Reference

- `name` - (Optional) The os name. Only one of `name` and `os_id` should be specified.
- `version` - (Optional) The os version.
- `os_id` - (Optional) The operating system id. Only one of `name` and `os_id` should be specified.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the os exists.

## Attributes Reference

In addition to all above arguments, the following attributes are exported:

- `id` - The resource's ID

~> **Important:** Baremetal operating systems' IDs are [zoned](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`
Loading
Loading