Skip to content

feat(edge_services): add resources #2637

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 35 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e0c3ba8
bump sdk go
yfodil Jun 27, 2024
591e9f0
add resources
yfodil Jun 27, 2024
ee6870b
add docs
yfodil Jun 27, 2024
511aff4
Merge branch 'master' into feat/edge-services
yfodil Jun 27, 2024
b38489b
lint
yfodil Jun 27, 2024
598b48f
Merge branch 'feat/edge-services' of github.com:yfodil/terraform-prov…
yfodil Jun 27, 2024
26b0516
goimports
yfodil Jun 27, 2024
c24fe03
fix tests
yfodil Jun 27, 2024
d093a5e
fix
yfodil Jun 27, 2024
7377188
update test
yfodil Jun 27, 2024
f641080
Merge branch 'master' into feat/edge-services
remyleone Jun 27, 2024
9b82a0c
rename functions
yfodil Jun 28, 2024
d4a01eb
Merge branch 'feat/edge-services' of github.com:yfodil/terraform-prov…
yfodil Jun 28, 2024
0612631
Merge branch 'master' into feat/edge-services
remyleone Jul 1, 2024
426accc
Merge branch 'master' into feat/edge-services
remyleone Jul 2, 2024
46830ba
Merge branch 'master' into feat/edge-services
yfodil Oct 10, 2024
4a597f4
refacto
yfodil Oct 15, 2024
ae1f7a0
fix
yfodil Oct 15, 2024
f359529
Merge branch 'master' into feat/edge-services
yfodil Mar 6, 2025
6446d5a
bump sdk go
yfodil Mar 6, 2025
bacc9e6
update resources to v1beta1
yfodil Mar 6, 2025
1e14484
update doc
yfodil Mar 6, 2025
8c5121a
Merge branch 'master' into feat/edge-services
yfodil Mar 6, 2025
4445d72
gofumpt
yfodil Mar 6, 2025
a5cf688
Merge branch 'feat/edge-services' of github.com:yfodil/terraform-prov…
yfodil Mar 6, 2025
a831c64
lint
yfodil Mar 6, 2025
8b08f58
Merge branch 'master' into feat/edge-services
yfodil Mar 6, 2025
72d1948
lint
yfodil Mar 7, 2025
d572595
Merge branch 'feat/edge-services' of github.com:yfodil/terraform-prov…
yfodil Mar 7, 2025
5e26532
fix tfproviderdocs lint
yfodil Mar 7, 2025
75e5283
fix lb origin
yfodil Mar 7, 2025
0018d49
check non-nil HeadStage
yfodil Mar 10, 2025
45e4125
Merge branch 'master' into feat/edge-services
remyleone Mar 12, 2025
5c596a2
update descriptions
yfodil Mar 12, 2025
07601a1
Merge branch 'feat/edge-services' of github.com:yfodil/terraform-prov…
yfodil Mar 12, 2025
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/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- cockpit
- container
- domain
- edgeservices
- flexibleip
- function
- iam
Expand Down
101 changes: 101 additions & 0 deletions docs/resources/edge_services_backend_stage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
subcategory: "Edge Services"
page_title: "Scaleway: scaleway_edge_services_backend_stage"
---

# Resource: scaleway_edge_services_backend_stage

Creates and manages Scaleway Edge Services Backend Stages.

## Example Usage

### With object backend

```terraform
resource "scaleway_object_bucket" "main" {
name = "my-bucket-name"
tags = {
foo = "bar"
}
}

resource "scaleway_edge_services_pipeline" "main" {
name = "my-pipeline"
}

resource "scaleway_edge_services_backend_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
s3_backend_config {
bucket_name = scaleway_object_bucket.main.name
bucket_region = "fr-par"
}
}
```

### With LB backend

```terraform
resource "scaleway_lb" "main" {
ip_ids = [scaleway_lb_ip.main.id]
zone = "fr-par-1"
type = "LB-S"
}

resource "scaleway_lb_frontend" "main" {
lb_id = scaleway_lb.main.id
backend_id = scaleway_lb_backend.main.id
name = "frontend01"
inbound_port = "443"
certificate_ids = [
scaleway_lb_certificate.cert01.id,
]
}

resource "scaleway_edge_services_pipeline" "main" {
name = "my-pipeline"
}

resource "scaleway_edge_services_backend_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
lb_backend_config {
lb_config {
id = scaleway_lb.main.id
frontend_id = scaleway_lb_frontend.id
is_ssl = true
zone = "fr-par-1"
}
}
}
```

## Argument Reference

- `pipeline_id` - (Required) The ID of the pipeline.
- `s3_backend_config` - (Optional) The Scaleway Object Storage origin bucket (S3) linked to the backend stage.
- `bucket_name` - The name of the Bucket.
- `bucket_region` - The region of the Bucket.
- `is_website` - Defines whether the bucket website feature is enabled.
- `lb_backend_config` - (Optional) The Scaleway Load Balancer linked to the backend stage.
- `lb_config` - The Load Balancer config.
- `id` - The ID of the Load Balancer.
- `frontend_id` - The ID of the frontend.
- `is_ssl` - Defines whether the Load Balancer's frontend handles SSL connections.
- `domain_name` - The Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) of the Load Balancer.
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the backend stage is associated with.

## Attributes Reference

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

- `id` - The ID of the backend stage (UUID format).
- `created_at` - The date and time of the creation of the backend stage.
- `updated_at` - The date and time of the last update of the backend stage.

## Import

Backend stages can be imported using the `{id}`, e.g.

```bash
$ terraform import scaleway_edge_services_backend_stage.basic 11111111-1111-1111-1111-111111111111
```
61 changes: 61 additions & 0 deletions docs/resources/edge_services_cache_stage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
subcategory: "Edge Services"
page_title: "Scaleway: scaleway_edge_services_cache_stage"
---

# Resource: scaleway_edge_services_cache_stage

Creates and manages Scaleway Edge Services Cache Stages.

## Example Usage

### Basic

```terraform
resource "scaleway_edge_services_cache_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
backend_stage_id = scaleway_edge_services_backend_stage.main.id
}
```

### Purge request

```terraform
resource "scaleway_edge_services_cache_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
backend_stage_id = scaleway_edge_services_backend_stage.main.id

purge {
pipeline_id = scaleway_edge_services_pipeline.main.id
all = true
}
}
```

## Argument Reference

- `pipeline_id` - (Required) The ID of the pipeline.
- `backend_stage_id` - (Optional) The backend stage ID the cache stage will be linked to.
- `fallback_ttl` - (Optional) The Time To Live (TTL) in seconds. Defines how long content is cached.
- `refresh_cache` - (Optional) Trigger a refresh of the cache by changing this field's value.
- `purge_requests` - (Optional) The Scaleway Object Storage origin bucket (S3) linked to the backend stage.
- `pipeline_id` - The pipeline ID in which the purge request will be created.
- `assets` - The list of asserts to purge.
- `all` - Defines whether to purge all content.
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the cache stage is associated with.

## Attributes Reference

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

- `id` - The ID of the cache stage (UUID format).
- `created_at` - The date and time of the creation of the cache stage.
- `updated_at` - The date and time of the last update of the cache stage.

## Import

Cache stages can be imported using the `{id}`, e.g.

```bash
$ terraform import scaleway_edge_services_cache_stage.basic 11111111-1111-1111-1111-111111111111
```
45 changes: 45 additions & 0 deletions docs/resources/edge_services_dns_stage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
subcategory: "Edge Services"
page_title: "Scaleway: scaleway_edge_services_dns_stage"
---

# Resource: scaleway_edge_services_dns_stage

Creates and manages Scaleway Edge Services DNS Stages.

## Example Usage

### Basic

```terraform
resource "scaleway_edge_services_dns_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
fqdns = ["subdomain.example.com"]
}
```

## Argument Reference

- `pipeline_id` - (Required) The ID of the pipeline.
- `backend_stage_id` - (Optional) The backend stage ID the DNS stage will be linked to.
- `tls_stage_id` - (Optional) The TLS stage ID the DNS stage will be linked to.
- `cache_stage_id` - (Optional) The cache stage ID the DNS stage will be linked to.
- `fqdns` - (Optional) Fully Qualified Domain Name (in the format subdomain.example.com) to attach to the stage.
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the DNS stage is associated with.

## Attributes Reference

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

- `id` - The ID of the DNS stage (UUID format).
- `type` - The type of the stage.
- `created_at` - The date and time of the creation of the DNS stage.
- `updated_at` - The date and time of the last update of the DNS stage.

## Import

DNS stages can be imported using the `{id}`, e.g.

```bash
$ terraform import scaleway_edge_services_dns_stage.basic 11111111-1111-1111-1111-111111111111
```
48 changes: 48 additions & 0 deletions docs/resources/edge_services_head_stage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
subcategory: "Edge Services"
page_title: "Scaleway: scaleway_edge_services_head_stage"
---

# Resource: scaleway_edge_services_head_stage

Sets the Scaleway Edge Services head stage of your pipeline.

## Example Usage

### Basic

```terraform
resource "scaleway_edge_services_pipeline" "main" {
name = "my-edge_services-pipeline"
description = "pipeline description"
}

resource "scaleway_edge_services_dns_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
tls_stage_id = scaleway_edge_services_tls_stage.main.id
fqdns = ["subdomain.example.com"]
}

resource "scaleway_edge_services_head_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
head_stage_id = scaleway_edge_services_dns_stage.main.id
}

```

## Argument Reference

- `pipeline_id` - (Required) The ID of the pipeline.
- `head_stage_id` - (Required) The ID of head stage of the pipeline.

## Attributes Reference

No additional attributes are exported.

## Import

Head stages can be imported using the `{id}`, e.g.

```bash
$ terraform import scaleway_edge_services_head_stage.main 11111111-1111-1111-1111-111111111111
```
81 changes: 81 additions & 0 deletions docs/resources/edge_services_pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
subcategory: "Edge Services"
page_title: "Scaleway: scaleway_edge_services_pipeline"
---

# Resource: scaleway_edge_services_pipeline

Creates and manages Scaleway Edge Services Pipelines.

## Example Usage

### Basic

```terraform
resource "scaleway_edge_services_pipeline" "main" {
name = "pipeline-name"
description = "pipeline description"
}
```

### Complete pipeline

```terraform
resource "scaleway_edge_services_pipeline" "main" {
name = "pipeline-name"
description = "pipeline description"
}

resource "scaleway_edge_services_backend_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
s3_backend_config {
bucket_name = "my-bucket-name"
bucket_region = "fr-par"
}
}

resource "scaleway_edge_services_tls_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
cache_stage_id = scaleway_edge_services_cache_stage.main.id
managed_certificate = true
}

resource "scaleway_edge_services_dns_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
tls_stage_id = scaleway_edge_services_tls_stage.main.id
fqdns = ["subdomain.example.com"]
}

resource "scaleway_edge_services_head_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
head_stage_id = scaleway_edge_services_dns_stage.main.id
}

resource "scaleway_edge_services_cache_stage" "main" {
pipeline_id = scaleway_edge_services_pipeline.main.id
backend_stage_id = scaleway_edge_services_backend_stage.main.id
}
```

## Argument Reference

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

## Attributes Reference

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

- `id` - The ID of the pipeline (UUID format).
- `created_at` - The date and time of the creation of the pipeline.
- `updated_at` - The date and time of the last update of the pipeline.
- `status` - The status of user pipeline.

## Import

Pipelines can be imported using the `{id}`, e.g.

```bash
$ terraform import scaleway_edge_services_pipeline.basic 11111111-1111-1111-1111-111111111111
```
35 changes: 35 additions & 0 deletions docs/resources/edge_services_plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
subcategory: "Edge Services"
page_title: "Scaleway: scaleway_edge_services_plan"
---

# Resource: scaleway_edge_services_plan

Creates and manages Scaleway Edge Services plans.

## Example Usage

### Basic

```terraform
resource "scaleway_edge_services_plan" "main" {
name = "starter"
}
```

## Argument Reference

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

## Attributes Reference

No additional attributes are exported.

## Import

Plans can be imported using `{project_id}/{plan_name}`, e.g.

```bash
$ terraform import scaleway_edge_services_plan.main 11111111-1111-1111-1111-111111111111/starter
```
Loading
Loading