Skip to content

Commit a12c684

Browse files
committed
add ConflictWith on stages
1 parent 2e67bf0 commit a12c684

File tree

6 files changed

+60
-50
lines changed

6 files changed

+60
-50
lines changed

docs/resources/edge_services_cache_stage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ resource "scaleway_edge_services_cache_stage" "main" {
3535
## Argument Reference
3636

3737
- `pipeline_id` - (Required) The ID of the pipeline.
38-
- `backend_stage_id` - (Optional) The backend stage ID the cache stage will be linked to.
39-
- `route_stage_id` - (Optional) The route stage ID the cache stage will be linked to.
40-
- `waf_stage_id` - (Optional) The WAF stage ID the cache stage will be linked to.
38+
- `backend_stage_id` - (Optional) The backend stage ID the cache stage will be linked to. Only one of `backend_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
39+
- `route_stage_id` - (Optional) The route stage ID the cache stage will be linked to. Only one of `backend_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
40+
- `waf_stage_id` - (Optional) The WAF stage ID the cache stage will be linked to. Only one of `backend_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
4141
- `fallback_ttl` - (Optional) The Time To Live (TTL) in seconds. Defines how long content is cached.
4242
- `refresh_cache` - (Optional) Trigger a refresh of the cache by changing this field's value.
4343
- `purge_requests` - (Optional) The Scaleway Object Storage origin bucket (S3) linked to the backend stage.

docs/resources/edge_services_dns_stage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ resource "scaleway_edge_services_dns_stage" "main" {
2121
## Argument Reference
2222

2323
- `pipeline_id` - (Required) The ID of the pipeline.
24-
- `backend_stage_id` - (Optional) The backend stage ID the DNS stage will be linked to.
25-
- `tls_stage_id` - (Optional) The TLS stage ID the DNS stage will be linked to.
26-
- `cache_stage_id` - (Optional) The cache stage ID the DNS stage will be linked to.
24+
- `backend_stage_id` - (Optional) The backend stage ID the DNS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id` and `tls_stage_id` should be specified.
25+
- `tls_stage_id` - (Optional) The TLS stage ID the DNS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id` and `tls_stage_id` should be specified.
26+
- `cache_stage_id` - (Optional) The cache stage ID the DNS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id` and `tls_stage_id` should be specified.
2727
- `fqdns` - (Optional) Fully Qualified Domain Name (in the format subdomain.example.com) to attach to the stage.
2828
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the DNS stage is associated with.
2929

docs/resources/edge_services_tls_stage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ resource "scaleway_edge_services_tls_stage" "main" {
3333
## Argument Reference
3434

3535
- `pipeline_id` - (Required) The ID of the pipeline.
36-
- `backend_stage_id` - (Optional) The backend stage ID the TLS stage will be linked to.
37-
- `cache_stage_id` - (Optional) The cache stage ID the TLS stage will be linked to.
38-
- `route_stage_id` - (Optional) The route stage ID the TLS stage will be linked to.
39-
- `waf_stage_id` - (Optional) The WAF stage ID the TLS stage will be linked to.
36+
- `backend_stage_id` - (Optional) The backend stage ID the TLS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
37+
- `cache_stage_id` - (Optional) The cache stage ID the TLS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
38+
- `route_stage_id` - (Optional) The route stage ID the TLS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
39+
- `waf_stage_id` - (Optional) The WAF stage ID the TLS stage will be linked to. Only one of `backend_stage_id`, `cache_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
4040
- `managed_certificate` - (Optional) Set to true when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint.
4141
- `secrets` - (Optional) The TLS secrets.
4242
- `bucket_name` - The ID of the secret.

internal/services/edgeservices/cache_stage.go

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,25 @@ func ResourceCacheStage() *schema.Resource {
2929
Description: "The ID of the pipeline",
3030
},
3131
"backend_stage_id": {
32-
Type: schema.TypeString,
33-
Optional: true,
34-
Computed: true,
35-
Description: "The backend stage ID the cache stage will be linked to",
32+
Type: schema.TypeString,
33+
Optional: true,
34+
Computed: true,
35+
Description: "The backend stage ID the cache stage will be linked to",
36+
ConflictsWith: []string{"waf_stage_id", "route_stage_id"},
3637
},
3738
"waf_stage_id": {
38-
Type: schema.TypeString,
39-
Optional: true,
40-
Computed: true,
41-
Description: "The WAF stage ID the cache stage will be linked to",
39+
Type: schema.TypeString,
40+
Optional: true,
41+
Computed: true,
42+
Description: "The WAF stage ID the cache stage will be linked to",
43+
ConflictsWith: []string{"backend_stage_id", "route_stage_id"},
4244
},
4345
"route_stage_id": {
44-
Type: schema.TypeString,
45-
Optional: true,
46-
Computed: true,
47-
Description: "The route stage ID the cache stage will be linked to",
46+
Type: schema.TypeString,
47+
Optional: true,
48+
Computed: true,
49+
Description: "The route stage ID the cache stage will be linked to",
50+
ConflictsWith: []string{"backend_stage_id", "waf_stage_id"},
4851
},
4952
"fallback_ttl": {
5053
Type: schema.TypeInt,

internal/services/edgeservices/dns_stage.go

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,25 @@ func ResourceDNSStage() *schema.Resource {
2929
Description: "The ID of the pipeline",
3030
},
3131
"backend_stage_id": {
32-
Type: schema.TypeString,
33-
Optional: true,
34-
Computed: true,
35-
Description: "The backend stage ID the DNS stage will be linked to",
32+
Type: schema.TypeString,
33+
Optional: true,
34+
Computed: true,
35+
Description: "The backend stage ID the DNS stage will be linked to",
36+
ConflictsWith: []string{"cache_stage_id", "tls_stage_id"},
3637
},
3738
"tls_stage_id": {
38-
Type: schema.TypeString,
39-
Optional: true,
40-
Computed: true,
41-
Description: "The TLS stage ID the DNS stage will be linked to",
39+
Type: schema.TypeString,
40+
Optional: true,
41+
Computed: true,
42+
Description: "The TLS stage ID the DNS stage will be linked to",
43+
ConflictsWith: []string{"cache_stage_id", "backend_stage_id"},
4244
},
4345
"cache_stage_id": {
44-
Type: schema.TypeString,
45-
Optional: true,
46-
Computed: true,
47-
Description: "The cache stage ID the DNS stage will be linked to",
46+
Type: schema.TypeString,
47+
Optional: true,
48+
Computed: true,
49+
Description: "The cache stage ID the DNS stage will be linked to",
50+
ConflictsWith: []string{"backend_stage_id", "tls_stage_id"},
4851
},
4952
"fqdns": {
5053
Type: schema.TypeList,

internal/services/edgeservices/tls_stage.go

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,32 @@ func ResourceTLSStage() *schema.Resource {
3030
Description: "The ID of the pipeline",
3131
},
3232
"backend_stage_id": {
33-
Type: schema.TypeString,
34-
Optional: true,
35-
Computed: true,
36-
Description: "The backend stage ID the TLS stage will be linked to",
33+
Type: schema.TypeString,
34+
Optional: true,
35+
Computed: true,
36+
Description: "The backend stage ID the TLS stage will be linked to",
37+
ConflictsWith: []string{"cache_stage_id", "route_stage_id", "waf_stage_id"},
3738
},
3839
"cache_stage_id": {
39-
Type: schema.TypeString,
40-
Optional: true,
41-
Computed: true,
42-
Description: "The cache stage ID the TLS stage will be linked to",
40+
Type: schema.TypeString,
41+
Optional: true,
42+
Computed: true,
43+
Description: "The cache stage ID the TLS stage will be linked to",
44+
ConflictsWith: []string{"backend_stage_id", "route_stage_id", "waf_stage_id"},
4345
},
4446
"waf_stage_id": {
45-
Type: schema.TypeString,
46-
Optional: true,
47-
Computed: true,
48-
Description: "The WAF stage ID the TLS stage will be linked to",
47+
Type: schema.TypeString,
48+
Optional: true,
49+
Computed: true,
50+
Description: "The WAF stage ID the TLS stage will be linked to",
51+
ConflictsWith: []string{"backend_stage_id", "cache_stage_id", "route_stage_id"},
4952
},
5053
"route_stage_id": {
51-
Type: schema.TypeString,
52-
Optional: true,
53-
Computed: true,
54-
Description: "The route stage ID the TLS stage will be linked to",
54+
Type: schema.TypeString,
55+
Optional: true,
56+
Computed: true,
57+
Description: "The route stage ID the TLS stage will be linked to",
58+
ConflictsWith: []string{"backend_stage_id", "cache_stage_id", "waf_stage_id"},
5559
},
5660
"managed_certificate": {
5761
Type: schema.TypeBool,

0 commit comments

Comments
 (0)