Skip to content

Commit

Permalink
Merge branch 'master' into pool_upgrade_mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Jun 16, 2022
2 parents 7abd609 + ed4a48e commit 72196b1
Show file tree
Hide file tree
Showing 104 changed files with 50,344 additions and 17,316 deletions.
64 changes: 64 additions & 0 deletions docs/data-sources/instance_servers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
page_title: "Scaleway: scaleway_instance_servers"
description: |-
Gets information about multiple Instance Servers.
---

# scaleway_instance_servers

Gets information about multiple instance servers.

## Examples

### Basic

```hcl
# Find servers by tag
data "scaleway_instance_servers" "my_key" {
tags = ["tag"]
}
# Find servers by name and zone
data "scaleway_instance_servers" "my_key" {
name = "myserver"
zone = "fr-par-2"
}
```

## Argument Reference

- `name` - (Optional) The server name used as filter. Servers with a name like it are listed.

- `tags` - (Optional) List of tags used as filter. Servers with these exact tags are listed.

- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which servers exist.

## Attributes Reference

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

- `id` - The zone of the servers

- `servers` - List of found servers
- `id` - The ID of the server.
- `tags` - The tags associated with the server.
- `public_ip` - The public IPv4 address of the server.
- `private_ip` - The Scaleway internal IP address of the server.
- `state` - The state of the server. Possible values are: `started`, `stopped` or `standby`.
- `zone` - The [zone](../guides/regions_and_zones.md#zones) in which the server is.
- `name` - The name of the server.
- `boot_type` - The boot Type of the server. Possible values are: `local`, `bootscript` or `rescue`.
- `bootscript_id` - The ID of the bootscript.
- `type` - The commercial type of the server.
- `security_group_id` - The [security group](https://developers.scaleway.com/en/products/instance/api/#security-groups-8d7f89) the server is attached to.
- `enable_ipv6` - Determines if IPv6 is enabled for the server.
- `ipv6_address` - The default ipv6 address routed to the server. ( Only set when enable_ipv6 is set to true )
- `ipv6_gateway` - The ipv6 gateway address. ( Only set when enable_ipv6 is set to true )
- `ipv6_prefix_length` - The prefix length of the ipv6 subnet routed to the server. ( Only set when enable_ipv6 is set to true )
- `enable_dynamic_ip` - If true a dynamic IP will be attached to the server.
- `image` - The UUID or the label of the base image used by the server.
- `placement_group_id` - The [placement group](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) the server is attached to.
- `organization_id` - The organization ID the server is associated with.
- `project_id` - The ID of the project the server is associated with.


39 changes: 39 additions & 0 deletions docs/data-sources/rdb_database_backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_rdb_database_backup"
description: |-
Gets information about an RDB backup.
---

# scaleway_rdb_database_backup

Gets information about an RDB backup.

## Example Usage

```hcl
data scaleway_rdb_database_backup find_by_name {
name = "mybackup"
}
data scaleway_rdb_database_backup find_by_name_and_instance {
name = "mybackup"
instance_id = "11111111-1111-1111-1111-111111111111"
}
data scaleway_rdb_database_backup find_by_id {
backup_id = "11111111-1111-1111-1111-111111111111"
}
```

## Argument Reference

- `backup_id` - (Optional) The RDB backup ID.
Only one of the `name` and `backup_id` should be specified.

- `instance_id` - (Optional) The RDB instance ID.

- `name` - (Optional) The name of the RDB instance.
Only one of the `name` and `backup_id` should be specified.


2 changes: 2 additions & 0 deletions docs/resources/container_namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ The following arguments are supported:

- `environment_variables` - The environment variables of the namespace.

- `destroy_registry` - (Defaults to false). Destroy linked container registry on deletion.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
Expand Down
104 changes: 104 additions & 0 deletions docs/resources/function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
page_title: "Scaleway: scaleway_function"
description: |-
Manages Scaleway Functions.
---

# scaleway_function

Creates and manages Scaleway Functions.
For more information see [the documentation](https://developers.scaleway.com/en/products/functions/api/).

## Examples

### Basic

```hcl
resource "scaleway_function_namespace" "main" {
name = "main-function-namespace"
description = "Main function namespace"
}
resource scaleway_function main {
namespace_id = scaleway_function_namespace.main.id
runtime = "go118"
handler = "Handle"
privacy = "private"
}
```

### With sources and deploy

You create a zip of your function (ex: `zip function.zip -r go.mod go.sum handler.go`)

```hcl
resource "scaleway_function_namespace" "main" {
name = "main-function-namespace"
description = "Main function namespace"
}
resource scaleway_function main {
namespace_id = scaleway_function_namespace.main.id
runtime = "go118"
handler = "Handle"
privacy = "private"
zip_file = "function.zip"
zip_hash = filesha256("function.zip")
deploy = true
}
```


## Arguments Reference

The following arguments are supported:

- `name` - (Required) The unique name of the function.

~> **Important** Updates to `name` will recreate the function.

- `description` (Optional) The description of the function.

- `environment_variables` - The environment variables of the function.

- `privacy` - Privacy of the function. Can be either `private` or `public`. Read more on [authentication](https://developers.scaleway.com/en/products/functions/api/#authentication)

- `runtime` - Runtime of the function. Runtimes can be fetched using [specific route](https://developers.scaleway.com/en/products/functions/api/#get-f7de6a)

- `min_scale` - Minimum replicas for your function, defaults to 0, Note that a function is billed when it gets executed, and using a min_scale greater than 0 will cause your function container to run constantly.

- `max_scale` - Maximum replicas for your function (defaults to 20), our system will scale your functions automatically based on incoming workload, but will never scale the number of replicas above the configured max_scale.

- `memory_limit` - Memory limit in MB for your function, defaults to 128MB

- `handler` - Handler of the function. Depends on the runtime ([function guide](https://developers.scaleway.com/en/products/functions/api/#create-a-function))

- `timeout` - Holds the max duration (in seconds) the function is allowed for responding to a request

- `zip_file` - Location of the zip file to upload containing your function sources

- `zip_hash` - The hash of your source zip file, changing it will re-apply function. Can be any string, changing it will just trigger state change. You can use any terraform hash function to trigger a change on your zip change (see examples)

- `deploy` - Define if the function should be deployed, terraform will wait for function to be deployed. Function will get deployed if you change source zip

- `region` - (Defaults to [provider](../index.md#region) `region`). The [region](../guides/regions_and_zones.md#regions) in which the namespace should be created.

- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the namespace is associated with.


## Attributes Reference

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

- `id` - The ID of the function
- `organization_id` - The organization ID the function is associated with.
- `cpu_limit` - The CPU limit in mCPU for your function. More infos on resources [here](https://developers.scaleway.com/en/products/functions/api/#functions)


## Import

Functions can be imported using the `{region}/{id}`, e.g.

```bash
$ terraform import scaleway_function.main fr-par/11111111-1111-1111-1111-111111111111
```
28 changes: 26 additions & 2 deletions docs/resources/instance_private_nic.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ description: |-
Creates and manages Scaleway Instance Private NICs. For more information, see
[the documentation](https://developers.scaleway.com/en/products/instance/api/#private-nics-a42eea).

## Example
## Examples

### Basic

```hcl
resource "scaleway_instance_private_nic" "pnic01" {
Expand All @@ -18,19 +20,41 @@ resource "scaleway_instance_private_nic" "pnic01" {
}
```

### With zone

```hcl
resource scaleway_vpc_private_network pn01 {
name = "private_network_instance"
zone = "fr-par-2"
}
resource "scaleway_instance_server" "base" {
image = "ubuntu_focal"
type = "DEV1-S"
zone = scaleway_vpc_private_network.pn01.zone
}
resource "scaleway_instance_private_nic" "pnic01" {
server_id = scaleway_instance_server.base.id
private_network_id = scaleway_vpc_private_network.pn01.id
zone = scaleway_vpc_private_network.pn01.zone
}
```

## Arguments Reference

The following arguments are required:

- `server_id` - (Required) The ID of the server associated with.
- `private_network_id` - (Required) The ID of the private network attached to.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the server must be created.

## Attributes Reference

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

- `id` - The ID of the private NIC.
- ``mac_address` - The MAC address of the private NIC.
- `mac_address` - The MAC address of the private NIC.

## Import

Expand Down
5 changes: 5 additions & 0 deletions docs/resources/instance_security_group_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ The `inbound_rule` and `outbound_rule` block supports:

- `port`- (Optional) The port this rule apply to. If no port is specified, rule will apply to all port.

- `port_range`- Need terraform >= 0.13.0 (Optional) The port range (e.g `22-23`) this rule applies to.
Port range MUST comply the Scaleway-notation: interval between ports must be a power of 2 `2^X-1` number (e.g 2^13-1=8191 in port_range = "10000-18191").
If no `port` nor `port_range` are specified, rule will apply to all port.
Only one of `port` and `port_range` should be specified.

- `ip`- (Optional) The ip this rule apply to. If no `ip` nor `ip_range` are specified, rule will apply to all ip. Only one of `ip` and `ip_range` should be specified.

- `ip_range`- (Optional) The ip range (e.g `192.168.1.0/24`) this rule applies to. If no `ip` nor `ip_range` are specified, rule will apply to all ip. Only one of `ip` and `ip_range` should be specified.
Expand Down
64 changes: 64 additions & 0 deletions docs/resources/rdb_database_backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
page_title: "Scaleway: scaleway_rdb_database_backup"
description: |-
Manages Scaleway RDB Database Backup.
---

# scaleway_rdb_database_backup

Creates and manages Scaleway RDB database backup.
For more information, see [the documentation](https://developers.scaleway.com/en/products/rdb/api).

## Examples

### Basic

```hcl
resource scaleway_rdb_database_backup "main" {
instance_id = data.scaleway_rdb_instance.main.id
database_name = data.scaleway_rdb_database.main.name
}
```

### With expiration

```hcl
resource scaleway_rdb_database_backup "main" {
instance_id = data.scaleway_rdb_instance.main.id
database_name = data.scaleway_rdb_database.main.name
expires_at = "2022-06-16T07:48:44Z"
}
```

## Arguments Reference

The following arguments are supported:

- `instance_id` - (Required) UUID of the instance where the database to backup is.

~> **Important:** Updates to `instance_id` will recreate the Backup.

- `name` - (Required) Name of the database (e.g. `my-database`).

- `expires_at` (Optional) Expiration date (Format ISO 8601).

~> **Important:** `expires_at` cannot be removed after being set.


## Attributes Reference

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

- `size` - Size of the backup (in bytes).
- `instance_name` - Name of the instance of the backup.
- `created_at` - Creation date (Format ISO 8601).
- `updated_at` - Updated date (Format ISO 8601).


## Import

RDB Database can be imported using the `{region}/{id}`, e.g.

```bash
$ terraform import scaleway_rdb_database_backup.mybackup fr-par/11111111-1111-1111-1111-111111111111
```

0 comments on commit 72196b1

Please sign in to comment.