From a0ef4ad138a566827a67bad0cb824f91479284d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 16:29:45 +0200 Subject: [PATCH 1/9] feat: add description of webhosting --- .../services/webhosting/offer_data_source.go | 147 +++++++++++------- internal/services/webhosting/webhosting.go | 74 +++++++-- 2 files changed, 145 insertions(+), 76 deletions(-) diff --git a/internal/services/webhosting/offer_data_source.go b/internal/services/webhosting/offer_data_source.go index 64005a9b05..ee4b7a12b9 100644 --- a/internal/services/webhosting/offer_data_source.go +++ b/internal/services/webhosting/offer_data_source.go @@ -38,50 +38,61 @@ func DataSourceOffer() *schema.Resource { ConflictsWith: []string{"name", "control_panel"}, }, "billing_operation_path": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Billing operation path", + Type: schema.TypeString, }, "product": { - Type: schema.TypeList, - Computed: true, - Deprecated: "The product field is deprecated. Please use the offer field instead.", + Type: schema.TypeList, + Computed: true, + Description: "Product list", + Deprecated: "The product field is deprecated. Please use the offer field instead.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Name of the product", }, "option": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Computed: true, + Description: "Whether or not the product is in the offer", }, "email_accounts_quota": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Limit number of email accounts", + Computed: true, }, "email_storage_quota": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Limit quantity of email storage in gigabytes", + Computed: true, }, "databases_quota": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Limit number of databases", + Computed: true, }, "hosting_storage_quota": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Limit quantity of hosting storage in gigabytes", + Computed: true, }, "support_included": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Description: "Whether or not support is included", + Computed: true, }, "v_cpu": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Limit number of virtual CPU", + Computed: true, }, "ram": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Limit quantity of memory in gigabytes", + Computed: true, }, }, }, @@ -93,73 +104,90 @@ func DataSourceOffer() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "ID of the offer", + Computed: true, }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Name of the offer", + Computed: true, }, "billing_operation_path": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Billing operation path", + Computed: true, }, "available": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Description: "Whether or not the offer is available", + Computed: true, }, "control_panel_name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Name of the control panel.", + Computed: true, }, "end_of_life": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Description: "Whether this offer is in end of life", + Computed: true, }, "quota_warning": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Quota warning for this offer", + Computed: true, }, "price": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Price of the offer.", + Computed: true, }, "options": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of options available for a particular offer", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "ID of the option", }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Name of the option", }, "billing_operation_path": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Billing operation path", }, "min_value": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Computed: true, + Description: "Minimum value for this option", }, "current_value": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Computed: true, + Description: "Current value", }, "max_value": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Computed: true, + Description: "The maximum allowed value of this value.", }, "quota_warning": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Quota warning", }, "price": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Price of the options", }, }, }, @@ -168,8 +196,9 @@ func DataSourceOffer() *schema.Resource { }, }, "price": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Price of the offer.", + Computed: true, }, "region": regional.Schema(), }, diff --git a/internal/services/webhosting/webhosting.go b/internal/services/webhosting/webhosting.go index 478b9851b1..43dcb41b32 100644 --- a/internal/services/webhosting/webhosting.go +++ b/internal/services/webhosting/webhosting.go @@ -102,12 +102,14 @@ func ResourceWebhosting() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "ID of the active option", }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Name of the option", }, }, }, @@ -124,12 +126,14 @@ func ResourceWebhosting() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "dashboard": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "URL to connect to dashboard interface", }, "webmail": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "URL to connect to Webmail interface", }, }, }, @@ -145,12 +149,36 @@ func ResourceWebhosting() *schema.Resource { Description: "List of DNS records associated with the webhosting.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": {Type: schema.TypeString, Computed: true}, - "type": {Type: schema.TypeString, Computed: true}, - "ttl": {Type: schema.TypeInt, Computed: true}, - "value": {Type: schema.TypeString, Computed: true}, - "priority": {Type: schema.TypeInt, Computed: true}, - "status": {Type: schema.TypeString, Computed: true}, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the DNS record", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of the DNS record", + }, + "ttl": { + Type: schema.TypeInt, + Computed: true, + Description: "Time to live in seconds of the record", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Value of the DNS record", + }, + "priority": { + Type: schema.TypeInt, + Computed: true, + Description: "Priority of DNS records associated with the webhosting.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Status of the hosting record", + }, }, }, }, @@ -160,9 +188,21 @@ func ResourceWebhosting() *schema.Resource { Description: "List of nameservers associated with the webhosting.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "hostname": {Type: schema.TypeString, Computed: true}, - "status": {Type: schema.TypeString, Computed: true}, - "is_default": {Type: schema.TypeBool, Computed: true}, + "hostname": { + Description: "Hostname of the server", + Type: schema.TypeString, + Computed: true, + }, + "status": { + Description: "Status of the nameserver", + Type: schema.TypeString, + Computed: true, + }, + "is_default": { + Description: "Whether or not the webhosting is the default one", + Type: schema.TypeBool, + Computed: true, + }, }, }, }, From 99d514fcb24a64c4068bab3d59a2d2d7d1b5b2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 16:30:09 +0200 Subject: [PATCH 2/9] docs(object): add description for schema fields --- internal/services/object/bucket.go | 40 +++++++++++-------- internal/services/object/bucket_acl.go | 10 +++-- .../object/bucket_lock_configuration.go | 9 +++-- .../object/bucket_website_configuration.go | 10 +++-- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/internal/services/object/bucket.go b/internal/services/object/bucket.go index 6c949a5d52..143dff835c 100644 --- a/internal/services/object/bucket.go +++ b/internal/services/object/bucket.go @@ -77,34 +77,40 @@ func ResourceBucket() *schema.Resource { Computed: true, }, "cors_rule": { - Type: schema.TypeList, - Optional: true, - Computed: true, + Type: schema.TypeList, + Description: "List of CORS rules", + Optional: true, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "allowed_headers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Description: "Allowed headers in the CORS rule", + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "allowed_methods": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Description: "Allowed HTTP methods allowed in the CORS rule", + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "allowed_origins": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Description: "Allowed origins allowed in the CORS rule", + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "expose_headers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Description: "Exposed headers in the CORS rule", + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "max_age_seconds": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeInt, + Description: "Max age of the CORS rule", + Optional: true, }, }, }, diff --git a/internal/services/object/bucket_acl.go b/internal/services/object/bucket_acl.go index daf248e79c..fa15edcb2f 100644 --- a/internal/services/object/bucket_acl.go +++ b/internal/services/object/bucket_acl.go @@ -49,8 +49,9 @@ func ResourceBucketACL() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "grant": { - Type: schema.TypeSet, - Optional: true, + Type: schema.TypeSet, + Description: "Grant", + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "grantee": { @@ -61,8 +62,9 @@ func ResourceBucketACL() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "display_name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Display name of the grantee to grant access to.", + Computed: true, }, "uri": { Type: schema.TypeString, diff --git a/internal/services/object/bucket_lock_configuration.go b/internal/services/object/bucket_lock_configuration.go index 02f190ea92..9735c9e6b2 100644 --- a/internal/services/object/bucket_lock_configuration.go +++ b/internal/services/object/bucket_lock_configuration.go @@ -44,10 +44,11 @@ func ResourceLockConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "default_retention": { - Type: schema.TypeList, - Required: true, - MinItems: 1, - MaxItems: 1, + Type: schema.TypeList, + Description: "Default retention.", + Required: true, + MinItems: 1, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "mode": { diff --git a/internal/services/object/bucket_website_configuration.go b/internal/services/object/bucket_website_configuration.go index 4d7437b25d..5b831794f0 100644 --- a/internal/services/object/bucket_website_configuration.go +++ b/internal/services/object/bucket_website_configuration.go @@ -44,8 +44,9 @@ func ResourceBucketWebsiteConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "suffix": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Description: "Suffix that will be added to the index.", + Required: true, }, }, }, @@ -58,8 +59,9 @@ func ResourceBucketWebsiteConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "key": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Description: "Key for the object to use as an error document.", + Required: true, }, }, }, From 1a0338a84d1aad45d13b8e24849b8a5dbb515af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 16:31:12 +0200 Subject: [PATCH 3/9] docs: add description in schema --- internal/services/mnq/sns_credentials.go | 9 +++++---- internal/services/mnq/sns_topic_subscription.go | 2 ++ internal/services/mnq/sqs_credentials.go | 9 +++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/services/mnq/sns_credentials.go b/internal/services/mnq/sns_credentials.go index fa7939a400..238a4595ee 100644 --- a/internal/services/mnq/sns_credentials.go +++ b/internal/services/mnq/sns_credentials.go @@ -31,10 +31,11 @@ func ResourceSNSCredentials() *schema.Resource { Description: "The credentials name", }, "permissions": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, + Type: schema.TypeList, + Description: "The permissions attached to the credentials", + MaxItems: 1, + Optional: true, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "can_publish": { diff --git a/internal/services/mnq/sns_topic_subscription.go b/internal/services/mnq/sns_topic_subscription.go index 91f3e88f27..cb56701340 100644 --- a/internal/services/mnq/sns_topic_subscription.go +++ b/internal/services/mnq/sns_topic_subscription.go @@ -47,12 +47,14 @@ func ResourceSNSTopicSubscription() *schema.Resource { }, "topic_arn": { Type: schema.TypeString, + Description: "ARN of the topic", Optional: true, AtLeastOneOf: []string{"topic_id"}, ForceNew: true, }, "topic_id": { Type: schema.TypeString, + Description: "ID of the topic", Optional: true, AtLeastOneOf: []string{"topic_arn"}, ForceNew: true, diff --git a/internal/services/mnq/sqs_credentials.go b/internal/services/mnq/sqs_credentials.go index bb688259ae..9faf70e9c6 100644 --- a/internal/services/mnq/sqs_credentials.go +++ b/internal/services/mnq/sqs_credentials.go @@ -31,10 +31,11 @@ func ResourceSQSCredentials() *schema.Resource { Description: "The credentials name", }, "permissions": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, + Type: schema.TypeList, + Description: "The permissions attached to the credentials", + MaxItems: 1, + Optional: true, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "can_publish": { From 91449abc7bfba4bb8b9ddeb9025925fca0a46bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 16:31:48 +0200 Subject: [PATCH 4/9] docs: add description for domain --- internal/services/domain/registration.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/services/domain/registration.go b/internal/services/domain/registration.go index a0ddfa52e5..c6d1ed6ff0 100644 --- a/internal/services/domain/registration.go +++ b/internal/services/domain/registration.go @@ -40,9 +40,10 @@ func ResourceRegistration() *schema.Resource { Description: "List of domain names to be managed.", }, "duration_in_years": { - Type: schema.TypeInt, - Optional: true, - Default: 1, + Type: schema.TypeInt, + Description: "Duration of the registration period in years.", + Optional: true, + Default: 1, }, "owner_contact_id": { Type: schema.TypeString, From 78d74305be89a958bbdff73d4f3b3ca9d4b29ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 18:27:52 +0200 Subject: [PATCH 5/9] docs: add support for description in lb schema --- internal/services/lb/acls_data_source.go | 105 ++++++---- internal/services/lb/backend.go | 3 + internal/services/lb/backends_data_source.go | 183 +++++++++++------- .../services/lb/data_source_lb_frontends.go | 5 +- internal/services/lb/ips_data_source.go | 30 +-- internal/services/lb/lb.go | 5 +- internal/services/lb/lbs_data_source.go | 133 ++++++++----- internal/services/lb/routes_data_source.go | 45 +++-- 8 files changed, 311 insertions(+), 198 deletions(-) diff --git a/internal/services/lb/acls_data_source.go b/internal/services/lb/acls_data_source.go index 6bc58da41e..276a4e9ce3 100644 --- a/internal/services/lb/acls_data_source.go +++ b/internal/services/lb/acls_data_source.go @@ -27,93 +27,112 @@ func DataSourceACLs() *schema.Resource { Description: "ACLs with a name like it are listed.", }, "acls": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Computed: true, + Description: "ACLs that are listed.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the ACL.", + Type: schema.TypeString, }, "name": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Name of the ACL.", + Type: schema.TypeString, }, "frontend_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "ID of the frontend to use for the ACL.", + Type: schema.TypeString, }, "index": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "Priority of this ACL (ACLs are applied in ascending order, 0 is the first ACL executed).", + Type: schema.TypeInt, }, "description": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "ACL description.", + Type: schema.TypeString, }, "match": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "ACL Match configuration.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ip_subnet": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of IPs or CIDR v4/v6 addresses to filter for from the client side.", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "http_filter": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "type of HTTP filter to match. Extracts the request's URL path, which starts at the first slash and ends before the question mark (without the host part). Defines where to filter for the http_filter_value. Only supported for HTTP backends.", + Computed: true, }, "http_filter_value": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of values to filter for", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "http_filter_option": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Name of the HTTP header to filter on if `http_header_match` was selected in `http_filter`.", + Computed: true, }, "invert": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Defines whether to invert the match condition. If set to `true`, the ACL carries out its action when the condition DOES NOT match", + Type: schema.TypeBool, }, "ips_edge_services": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Defines whether Edge Services IPs should be matched", + Type: schema.TypeBool, }, }, }, }, "action": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "Action to take when incoming traffic matches an ACL filter.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "type: action to take when incoming traffic matches an ACL filter. (allow/deny)", + Computed: true, }, "redirect": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "redirection parameters when using an ACL with a `redirect` action.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Value can be location or scheme", + Computed: true, }, "target": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "redirect target. For a location redirect, you can use a URL e.g. `https://scaleway.com`. Using a scheme name (e.g. `https`, `http`, `ftp`, `git`) will replace the request's original scheme. This can be useful to implement HTTP to HTTPS redirects. Valid placeholders that can be used in a `location` redirect to preserve parts of the original request in the redirection URL are {{host}}, {{query}}, {{path}} and {{scheme}}.", + Computed: true, }, "code": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "HTTP redirect code to use. Valid values are 301, 302, 303, 307 and 308. Default value is 302.", + Computed: true, }, }, }, @@ -122,12 +141,14 @@ func DataSourceACLs() *schema.Resource { }, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Timestamp when the ACL was created (RFC3339)", + Type: schema.TypeString, }, "update_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Timestamp when the ACL was updated (RFC3339)", + Type: schema.TypeString, }, }, }, diff --git a/internal/services/lb/backend.go b/internal/services/lb/backend.go index 3d75669274..4b5c3e6a04 100644 --- a/internal/services/lb/backend.go +++ b/internal/services/lb/backend.go @@ -168,6 +168,7 @@ func ResourceBackend() *schema.Resource { }, "health_check_tcp": { Type: schema.TypeList, + Description: "TCP Health check", MaxItems: 1, ConflictsWith: []string{"health_check_http", "health_check_https"}, Optional: true, @@ -178,6 +179,7 @@ func ResourceBackend() *schema.Resource { }, "health_check_http": { Type: schema.TypeList, + Description: "HTTP Health check", MaxItems: 1, ConflictsWith: []string{"health_check_tcp", "health_check_https"}, Optional: true, @@ -210,6 +212,7 @@ func ResourceBackend() *schema.Resource { }, "health_check_https": { Type: schema.TypeList, + Description: "HTTPS Health check", MaxItems: 1, ConflictsWith: []string{"health_check_tcp", "health_check_http"}, Optional: true, diff --git a/internal/services/lb/backends_data_source.go b/internal/services/lb/backends_data_source.go index 150a720367..d67f9faea0 100644 --- a/internal/services/lb/backends_data_source.go +++ b/internal/services/lb/backends_data_source.go @@ -2,6 +2,7 @@ package lb import ( "context" + "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -27,163 +28,203 @@ func DataSourceBackends() *schema.Resource { Description: "Backends with a name like it are listed.", }, "backends": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Computed: true, + Description: "List of backends.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Backend ID", + Type: schema.TypeString, }, "name": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Name of the backend", + Type: schema.TypeString, }, "lb_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "ID of the load balancer the backend is associated with", + Type: schema.TypeString, }, "forward_protocol": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Protocol to be used by the backend when forwarding traffic to backend servers", + Type: schema.TypeString, }, "forward_port": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "Port to be used by the backend when forwarding traffic to backend servers", + Type: schema.TypeInt, }, "forward_port_algorithm": { Computed: true, - Type: schema.TypeString, + Description: func() string { + var t lb.ForwardPortAlgorithm + values := t.Values() + return fmt.Sprintf("Load balancing algorithm to be used when determining which backend server to forward new traffic to. Possible values are: %s", values) + }(), + Type: schema.TypeString, }, "sticky_sessions": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Defines whether sticky sessions (binding a particular session to a particular backend server) are activated and the method to use if so. None disables sticky sessions. Cookie-based uses an HTTP cookie to stick a session to a backend server. Table-based uses the source (client) IP address to stick a session to a backend server.", + Type: schema.TypeString, }, "sticky_sessions_cookie_name": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "cookie name for cookie-based sticky sessions.", + Type: schema.TypeString, }, "server_ips": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of IP addresses for the server attached to the backend.", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "timeout_server": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Maximum allowed time for a backend server to process a request", + Type: schema.TypeString, }, "timeout_connect": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Maximum allowed time for establishing a connection to a backend server", + Type: schema.TypeString, }, "timeout_tunnel": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Maximum allowed tunnel inactivity time after Websocket is established (takes precedence over client and server timeout)", + Type: schema.TypeString, }, "on_marked_down_action": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Action to take when a backend server is marked as down", + Type: schema.TypeString, }, "proxy_protocol": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "protocol to use between the Load Balancer and backend servers. Allows the backend servers to be informed of the client's real IP address. The PROXY protocol must be supported by the backend servers' software.", + Type: schema.TypeString, }, "failover_host": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Scaleway Object Storage bucket website to be served as failover if all backend servers are down, e.g. failover-website.s3-website.fr-par.scw.cloud", + Type: schema.TypeString, }, "ssl_bridging": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Defines whether to enable SSL bridging between the Load Balancer and backend servers", + Type: schema.TypeBool, }, "ignore_ssl_server_verify": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Defines whether the server certificate verification should be ignored", + Type: schema.TypeBool, }, "health_check_port": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "port to use for the backend server health check.", + Type: schema.TypeInt, }, "health_check_max_retries": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "Number of retries when a backend server connection failed.", + Type: schema.TypeInt, }, "health_check_timeout": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Maximum time a backend server has to reply to the health check.", + Type: schema.TypeString, }, "health_check_delay": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Time to wait between two consecutive health checks.", + Type: schema.TypeString, }, "health_check_tcp": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "TCP Health check configuration.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{}, }, }, "health_check_http": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "HTTP Health check configuration.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "uri": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "the HTTP path to use when performing a health check on backend servers.", + Computed: true, }, "method": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "the HTTP method used when performing a health check on backend servers.", + Computed: true, }, "code": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "the HTTP response code that should be returned for a health check to be considered successful.", + Computed: true, }, "host_header": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "the HTTP host header used when performing a health check on backend servers.", + Type: schema.TypeString, }, }, }, }, "health_check_https": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "Health checks configuration in HTTPS", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "uri": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "the HTTP path to use when performing a health check on backend servers.", + Computed: true, }, "method": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "the HTTP method used when performing a health check on backend servers.", + Computed: true, }, "code": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "the HTTP response code that should be returned for a health check to be considered successful.", + Computed: true, }, "host_header": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "the HTTP host header used when performing a health check on backend servers.", + Type: schema.TypeString, }, "sni": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "the SNI value used when performing a health check on backend servers over SSL.", + Type: schema.TypeString, }, }, }, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Timestamp when the backend server was created (RFC3339)", + Type: schema.TypeString, }, "update_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Time at which the backend server was last updated (RFC3339).", + Type: schema.TypeString, }, }, }, diff --git a/internal/services/lb/data_source_lb_frontends.go b/internal/services/lb/data_source_lb_frontends.go index 564845ef1b..48acca2c4b 100644 --- a/internal/services/lb/data_source_lb_frontends.go +++ b/internal/services/lb/data_source_lb_frontends.go @@ -27,8 +27,9 @@ func DataSourceFrontends() *schema.Resource { Description: "frontends with a name like it are listed.", }, "frontends": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of frontends.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { diff --git a/internal/services/lb/ips_data_source.go b/internal/services/lb/ips_data_source.go index 8051b1383b..59af508345 100644 --- a/internal/services/lb/ips_data_source.go +++ b/internal/services/lb/ips_data_source.go @@ -43,29 +43,35 @@ func DataSourceIPs() *schema.Resource { Description: "IPs with these exact tags are listed", }, "ips": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of IPs", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the IP", + Type: schema.TypeString, }, "ip_address": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "IP address of this IP", + Type: schema.TypeString, }, "lb_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Load balancer ID associated with this IP", + Type: schema.TypeString, }, "reverse": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Reverse DNS associated with this IP address", + Type: schema.TypeString, }, "tags": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of tags associated with this IP", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, diff --git a/internal/services/lb/lb.go b/internal/services/lb/lb.go index 1282fa1e46..48b18c8d6b 100644 --- a/internal/services/lb/lb.go +++ b/internal/services/lb/lb.go @@ -161,8 +161,9 @@ func ResourceLb() *schema.Resource { Description: "The status of private network connection", }, "zone": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Zone", + Computed: true, }, }, }, diff --git a/internal/services/lb/lbs_data_source.go b/internal/services/lb/lbs_data_source.go index 740687860b..e35ab3dd4d 100644 --- a/internal/services/lb/lbs_data_source.go +++ b/internal/services/lb/lbs_data_source.go @@ -2,6 +2,7 @@ package lb import ( "context" + "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -30,86 +31,104 @@ func DataSourceLbs() *schema.Resource { Description: "LBs with these exact tags are listed", }, "lbs": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of LBs", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the load balancer", + Type: schema.TypeString, }, "description": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Description of the load balancer", + Type: schema.TypeString, }, "status": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Status of the load balancer", + Type: schema.TypeString, }, "name": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Name of the load balancer", + Type: schema.TypeString, }, "type": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Type of the load balancer", + Type: schema.TypeString, }, "tags": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of tags assigned to the load balancer", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "instances": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of instances assigned to the load balancer", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "UUID of the instance", + Computed: true, }, "status": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Status of the instance", + Computed: true, }, "ip_address": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "IP address of the instance", + Computed: true, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the instance was created (RFC3339)", + Type: schema.TypeString, }, "updated_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the instance was updated (RFC3339)", + Type: schema.TypeString, }, "zone": zonal.Schema(), }, }, }, "ips": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of IPs assigned to the load balancer", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "UUID of the IP", + Computed: true, }, "ip_address": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "IP address", + Computed: true, }, "reverse": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Reverse DNS attached to the IP", + Computed: true, }, "lb_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the load balancer attached to the IP", + Type: schema.TypeString, }, "project_id": account.ProjectIDSchema(), "organization_id": account.OrganizationIDSchema(), @@ -118,36 +137,48 @@ func DataSourceLbs() *schema.Resource { }, }, "frontend_count": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "number of frontends the Load Balancer has.", + Type: schema.TypeInt, }, "backend_count": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "number of backends the Load Balancer has.", + Type: schema.TypeInt, }, "private_network_count": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "number of Private Networks attached to the Load Balancer.", + Type: schema.TypeInt, }, "route_count": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "number of routes configured on the Load Balancer.", + Type: schema.TypeInt, }, "subscriber": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Subscriber information.", + Type: schema.TypeString, }, "ssl_compatibility_level": { Computed: true, - Type: schema.TypeString, + Description: func() string { + var t lb.SSLCompatibilityLevel + values := t.Values() + return fmt.Sprintf("SSL compatibility level possible values are %s", values) + }(), + Type: schema.TypeString, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the load balancer was created (RFC3339)", + Type: schema.TypeString, }, "updated_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the load balancer was created (RFC3339)", + Type: schema.TypeString, }, "zone": zonal.Schema(), "organization_id": account.OrganizationIDSchema(), diff --git a/internal/services/lb/routes_data_source.go b/internal/services/lb/routes_data_source.go index 7b684d4b7e..1365235b06 100644 --- a/internal/services/lb/routes_data_source.go +++ b/internal/services/lb/routes_data_source.go @@ -22,41 +22,50 @@ func DataSourceRoutes() *schema.Resource { Description: "Routes with a frontend id like it are listed.", }, "routes": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of routes.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the route.", + Type: schema.TypeString, }, "frontend_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the frontend to use for this route.", + Type: schema.TypeString, }, "backend_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the backend to use for this route.", + Type: schema.TypeString, }, "match_sni": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Server Name Indication (SNI) value to match. Value to match in the Server Name Indication TLS extension (SNI) field from an incoming connection made via an SSL/TLS transport layer. This field should be set for routes on TCP Load Balancers. ", + Type: schema.TypeString, }, "match_host_header": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "HTTP host header to match. Value to match in the HTTP Host request header from an incoming request. This field should be set for routes on HTTP Load Balancers.", + Type: schema.TypeString, }, "match_subdomains": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "If true, all subdomains of this route will be matched for this route.", + Type: schema.TypeBool, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date on which the route was created (RFC 3339 format)", + Type: schema.TypeString, }, "update_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date at which the route was last updated (RFC 3339 format)", + Type: schema.TypeString, }, }, }, From c786dbea6cc60c4f9c6d4927ec07e1c044f94585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 18:28:17 +0200 Subject: [PATCH 6/9] docs: add support for description in instance schema --- internal/services/instance/image.go | 65 ++++++---- internal/services/instance/security_group.go | 1 + internal/services/instance/server.go | 1 + .../services/instance/servers_data_source.go | 114 +++++++++++------- 4 files changed, 109 insertions(+), 72 deletions(-) diff --git a/internal/services/instance/image.go b/internal/services/instance/image.go index c6273f0891..4bbf4de59c 100644 --- a/internal/services/instance/image.go +++ b/internal/services/instance/image.go @@ -108,59 +108,72 @@ func ResourceImage() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "UUID of the additional volume", + Computed: true, }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Name of the additional volume", + Computed: true, }, "export_uri": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "URI of the additional volume", + Computed: true, }, "size": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Description: "Size of the additional volume", + Computed: true, }, "volume_type": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Type of the additional volume", + Computed: true, }, "creation_date": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Date and time of the creation of the additional volume (RFC3339)", + Computed: true, }, "modification_date": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Date and time of the modification of the additional volume (RFC3339)", + Computed: true, }, "organization": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Organization ID of the additional volume", + Computed: true, }, "project": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Project ID of the additional volume", + Computed: true, }, "tags": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of tags attached to the additional volume", + Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "state": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "The state of the additional volume", + Computed: true, }, "zone": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Zone ID of the additional volume", + Computed: true, }, "server": { - Type: schema.TypeMap, - Computed: true, + Type: schema.TypeMap, + Description: "Server", + Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, }, diff --git a/internal/services/instance/security_group.go b/internal/services/instance/security_group.go index 6e44c34574..eb562b6a3a 100644 --- a/internal/services/instance/security_group.go +++ b/internal/services/instance/security_group.go @@ -78,6 +78,7 @@ func ResourceSecurityGroup() *schema.Resource { }, "external_rules": { Type: schema.TypeBool, + Description: "External rules for this security group", Optional: true, Default: false, ConflictsWith: []string{"inbound_rule", "outbound_rule"}, diff --git a/internal/services/instance/server.go b/internal/services/instance/server.go index 1edc883439..ed688a1361 100644 --- a/internal/services/instance/server.go +++ b/internal/services/instance/server.go @@ -220,6 +220,7 @@ func ResourceServer() *schema.Resource { }, "ip_ids": { Type: schema.TypeList, + Description: "The IDs of the reserved IP for the server", Optional: true, ConflictsWith: []string{"ip_id"}, Elem: &schema.Schema{ diff --git a/internal/services/instance/servers_data_source.go b/internal/services/instance/servers_data_source.go index ab9ec569b5..6d7a1eec24 100644 --- a/internal/services/instance/servers_data_source.go +++ b/internal/services/instance/servers_data_source.go @@ -36,38 +36,45 @@ func DataSourceServers() *schema.Resource { Description: "Servers with these exact tags are listed.", }, "servers": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "Servers", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "UUID of the server.", + Type: schema.TypeString, }, "public_ip": { - Computed: true, - Type: schema.TypeString, - Deprecated: "Use public_ips instead", + Computed: true, + Description: "Public IP address.", + Type: schema.TypeString, + Deprecated: "Use public_ips instead", }, "public_ips": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "Public IPs associated with this server.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "UUID of the public IP.", + Computed: true, }, "address": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Address of the server", + Computed: true, }, }, }, }, "private_ip": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Private IP address of the server.", + Type: schema.TypeString, }, "private_ips": { Type: schema.TypeList, @@ -90,68 +97,83 @@ func DataSourceServers() *schema.Resource { }, }, "state": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "State of the server", + Type: schema.TypeString, }, "name": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Name of the server", + Type: schema.TypeString, }, "boot_type": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Boot type", + Type: schema.TypeString, }, "bootscript_id": { - Computed: true, - Type: schema.TypeString, - Deprecated: "bootscript are not supported", + Computed: true, + Type: schema.TypeString, + Description: "UUID of the bootscript", + Deprecated: "bootscript are not supported", }, "type": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Type of the server", + Type: schema.TypeString, }, "tags": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of tags assigned to the server.", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "security_group_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Security group ID", + Type: schema.TypeString, }, "enable_ipv6": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Whether to enable IPv6 support", + Type: schema.TypeBool, }, "enable_dynamic_ip": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Whether to enable dynamic IP addresses on this server", + Type: schema.TypeBool, }, "image": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Image ID of the server", + Type: schema.TypeString, }, "placement_group_id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Placement Group ID", + Type: schema.TypeString, }, "placement_group_policy_respected": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Whether the placement group policy respected or not", + Type: schema.TypeBool, }, "ipv6_address": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "IPv6 Address for this server", + Type: schema.TypeString, }, "ipv6_gateway": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "IPv6 gateway address", + Type: schema.TypeString, }, "ipv6_prefix_length": { - Computed: true, - Type: schema.TypeInt, + Computed: true, + Description: "IPv6 prefix length", + Type: schema.TypeInt, }, "zone": zonal.Schema(), "organization_id": account.OrganizationIDSchema(), From 089d3e6c7a57dab1f167631086165c6fcfea68bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 18:28:42 +0200 Subject: [PATCH 7/9] docs: add support for description in all field of the schemas --- .github/workflows/tfproviderlint.yml | 2 + GNUmakefile | 3 + go.mod | 1 + internal/services/baremetal/server.go | 5 +- .../billing/consumption_data_source.go | 10 ++-- .../services/billing/invoices_data_source.go | 5 +- internal/services/container/domain.go | 1 - internal/services/container/token.go | 17 ++++-- internal/services/edgeservices/cache_stage.go | 5 +- .../flexibleip/data_source_flexible_ips.go | 45 +++++++++------ internal/services/function/domain.go | 1 - internal/services/function/token.go | 17 ++++-- internal/services/inference/model.go | 1 - internal/services/ipam/ip_data_source.go | 1 + internal/services/ipam/ips_data_source.go | 55 +++++++++++-------- internal/services/jobs/jobs.go | 40 +++++++++----- internal/services/k8s/pool.go | 5 +- internal/services/redis/cluster.go | 8 ++- .../services/registry/image_data_source.go | 5 +- .../scwconfig/scw_config_data_source.go | 52 +++++++++++------- internal/services/secret/secret.go | 20 +++++-- internal/services/tem/webhook.go | 1 + internal/services/vpc/routes_data_source.go | 5 +- internal/services/vpc/vpcs_data_source.go | 35 +++++++----- 24 files changed, 210 insertions(+), 130 deletions(-) diff --git a/.github/workflows/tfproviderlint.yml b/.github/workflows/tfproviderlint.yml index 56329af59d..9393678359 100644 --- a/.github/workflows/tfproviderlint.yml +++ b/.github/workflows/tfproviderlint.yml @@ -21,6 +21,8 @@ jobs: run: go install github.com/bflad/tfproviderlint/cmd/tfproviderlint - name: Run tfproviderlint run: make tfproviderlint + - name: Run tfproviderlintx + run: make tfproviderlintx tfproviderdocs: runs-on: ubuntu-latest steps: diff --git a/GNUmakefile b/GNUmakefile index 7e961f6b4c..fa6e7e3727 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -60,3 +60,6 @@ tfproviderlint: tfproviderdocs: go tool tfproviderdocs check -provider-name scaleway -enable-contents-check + +tfproviderlintx: + go tool tfproviderlintx -XR001=false -XS002=false ./... diff --git a/go.mod b/go.mod index 1473b0d14d..9b95a93b4c 100644 --- a/go.mod +++ b/go.mod @@ -176,6 +176,7 @@ require ( tool ( github.com/bflad/tfproviderdocs github.com/bflad/tfproviderlint/cmd/tfproviderlint + github.com/bflad/tfproviderlint/cmd/tfproviderlintx github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs github.com/katbyte/terrafmt ) diff --git a/internal/services/baremetal/server.go b/internal/services/baremetal/server.go index c6a4a26a78..0d89d529a4 100644 --- a/internal/services/baremetal/server.go +++ b/internal/services/baremetal/server.go @@ -185,8 +185,9 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument Elem: ResourceServerIP(), }, "domain": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Domain associated with the server", + Computed: true, }, "options": { Type: schema.TypeSet, diff --git a/internal/services/billing/consumption_data_source.go b/internal/services/billing/consumption_data_source.go index 9fd489f252..0d6006acbe 100644 --- a/internal/services/billing/consumption_data_source.go +++ b/internal/services/billing/consumption_data_source.go @@ -20,8 +20,9 @@ func DataSourceConsumptions() *schema.Resource { "organization_id": account.OrganizationIDSchema(), "project_id": account.ProjectIDSchema(), "consumptions": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of the consumptions.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "value": { @@ -63,8 +64,9 @@ func DataSourceConsumptions() *schema.Resource { }, }, "updated_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the consumption was updated", + Type: schema.TypeString, }, }, } diff --git a/internal/services/billing/invoices_data_source.go b/internal/services/billing/invoices_data_source.go index 10b77d1429..78c168d746 100644 --- a/internal/services/billing/invoices_data_source.go +++ b/internal/services/billing/invoices_data_source.go @@ -34,8 +34,9 @@ func DataSourceInvoices() *schema.Resource { Description: "The invoice type. It can either be `periodic` or `purchase`", }, "invoices": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of invoices", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { diff --git a/internal/services/container/domain.go b/internal/services/container/domain.go index fc6c5e6e8b..50246704d2 100644 --- a/internal/services/container/domain.go +++ b/internal/services/container/domain.go @@ -26,7 +26,6 @@ func ResourceDomain() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(defaultContainerDomainTimeout), Read: schema.DefaultTimeout(defaultContainerDomainTimeout), - Update: schema.DefaultTimeout(defaultContainerDomainTimeout), Delete: schema.DefaultTimeout(defaultContainerDomainTimeout), Default: schema.DefaultTimeout(defaultContainerDomainTimeout), }, diff --git a/internal/services/container/token.go b/internal/services/container/token.go index a5a4875cc1..f21bf84668 100644 --- a/internal/services/container/token.go +++ b/internal/services/container/token.go @@ -28,6 +28,7 @@ func ResourceToken() *schema.Resource { Schema: map[string]*schema.Schema{ "container_id": { Type: schema.TypeString, + Description: "Container ID", ForceNew: true, Optional: true, ExactlyOneOf: []string{"namespace_id"}, @@ -35,27 +36,31 @@ func ResourceToken() *schema.Resource { }, "namespace_id": { Type: schema.TypeString, + Description: "Namespace ID", ForceNew: true, Optional: true, ExactlyOneOf: []string{"container_id"}, DiffSuppressFunc: dsf.Locality, }, "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Description: "Description of the token.", + Optional: true, + ForceNew: true, }, "expires_at": { Type: schema.TypeString, + Description: "Expiration date of the token (TimeRFC3339)", Optional: true, ForceNew: true, ValidateDiagFunc: verify.IsDate(), DiffSuppressFunc: dsf.TimeRFC3339, }, "token": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Type: schema.TypeString, + Description: "Token", + Computed: true, + Sensitive: true, }, "region": regional.Schema(), diff --git a/internal/services/edgeservices/cache_stage.go b/internal/services/edgeservices/cache_stage.go index ccf401cbdb..0d0313d215 100644 --- a/internal/services/edgeservices/cache_stage.go +++ b/internal/services/edgeservices/cache_stage.go @@ -56,8 +56,9 @@ func ResourceCacheStage() *schema.Resource { Description: "The Time To Live (TTL) in seconds. Defines how long content is cached", }, "purge_requests": { - Type: schema.TypeSet, - Optional: true, + Type: schema.TypeSet, + Description: "Set of purge requests", + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "pipeline_id": { diff --git a/internal/services/flexibleip/data_source_flexible_ips.go b/internal/services/flexibleip/data_source_flexible_ips.go index 767bae02bb..b554620add 100644 --- a/internal/services/flexibleip/data_source_flexible_ips.go +++ b/internal/services/flexibleip/data_source_flexible_ips.go @@ -34,36 +34,43 @@ func DataSourceFlexibleIPs() *schema.Resource { Description: "Flexible IPs with these exact tags are listed", }, "ips": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of flexible IPs", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "ID of the flexible IP", + Type: schema.TypeString, }, "description": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Description of the flexible IP", + Type: schema.TypeString, }, "tags": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of flexible IP tags", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "status": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Status of the flexible IP", + Type: schema.TypeString, }, "ip_address": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "IP address of the flexible IP", + Type: schema.TypeString, }, "reverse": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Reverse DNS of the flexible IP", + Type: schema.TypeString, }, "mac_address": { Type: schema.TypeList, @@ -106,12 +113,14 @@ func DataSourceFlexibleIPs() *schema.Resource { }, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date on which the flexible IP was created (RFC 3339 format)", + Type: schema.TypeString, }, "updated_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date on which the flexible IP was last updated (RFC 3339 format)", + Type: schema.TypeString, }, "zone": zonal.ComputedSchema(), "organization_id": account.OrganizationIDSchema(), diff --git a/internal/services/function/domain.go b/internal/services/function/domain.go index 21cb5793de..c69a82b76b 100644 --- a/internal/services/function/domain.go +++ b/internal/services/function/domain.go @@ -25,7 +25,6 @@ func ResourceDomain() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Default: schema.DefaultTimeout(DefaultFunctionTimeout), Read: schema.DefaultTimeout(DefaultFunctionTimeout), - Update: schema.DefaultTimeout(DefaultFunctionTimeout), Delete: schema.DefaultTimeout(DefaultFunctionTimeout), Create: schema.DefaultTimeout(DefaultFunctionTimeout), }, diff --git a/internal/services/function/token.go b/internal/services/function/token.go index 6dcbb20d73..6613f5cb65 100644 --- a/internal/services/function/token.go +++ b/internal/services/function/token.go @@ -30,6 +30,7 @@ func ResourceToken() *schema.Resource { Schema: map[string]*schema.Schema{ "function_id": { Type: schema.TypeString, + Description: "The ID of the function", ForceNew: true, Optional: true, ExactlyOneOf: []string{"namespace_id"}, @@ -37,27 +38,31 @@ func ResourceToken() *schema.Resource { }, "namespace_id": { Type: schema.TypeString, + Description: "The ID of the namespace", ForceNew: true, Optional: true, ExactlyOneOf: []string{"function_id"}, DiffSuppressFunc: dsf.Locality, }, "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Description: "The description of the function", + Optional: true, + ForceNew: true, }, "expires_at": { Type: schema.TypeString, + Description: "The date after which the token expires RFC3339", Optional: true, ForceNew: true, ValidateDiagFunc: verify.IsDate(), DiffSuppressFunc: dsf.TimeRFC3339, }, "token": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Type: schema.TypeString, + Description: "Token generated", + Computed: true, + Sensitive: true, }, "region": regional.Schema(), diff --git a/internal/services/inference/model.go b/internal/services/inference/model.go index 3fa25013f2..6b955406a7 100644 --- a/internal/services/inference/model.go +++ b/internal/services/inference/model.go @@ -25,7 +25,6 @@ func ResourceModel() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Default: schema.DefaultTimeout(defaultModelTimeout), Create: schema.DefaultTimeout(defaultModelTimeout), - Update: schema.DefaultTimeout(defaultModelTimeout), Delete: schema.DefaultTimeout(defaultModelTimeout), }, SchemaVersion: 0, diff --git a/internal/services/ipam/ip_data_source.go b/internal/services/ipam/ip_data_source.go index a16bfe8bd3..d5c84dcb20 100644 --- a/internal/services/ipam/ip_data_source.go +++ b/internal/services/ipam/ip_data_source.go @@ -38,6 +38,7 @@ func DataSourceIP() *schema.Resource { }, "resource": { Type: schema.TypeList, + Description: "The resource to filter for", Optional: true, MaxItems: 1, ConflictsWith: []string{"ipam_ip_id"}, diff --git a/internal/services/ipam/ips_data_source.go b/internal/services/ipam/ips_data_source.go index 30104c81c3..442773ae23 100644 --- a/internal/services/ipam/ips_data_source.go +++ b/internal/services/ipam/ips_data_source.go @@ -77,56 +77,67 @@ func DataSourceIPs() *schema.Resource { "organization_id": account.OrganizationIDSchema(), // Computed "ips": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Computed: true, + Description: "IPs to filter for", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "ID of the IP to filter for", + Type: schema.TypeString, }, "address": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Address of the IP to filter for", + Type: schema.TypeString, }, "resource": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "Resource to filter for", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Type of resource to filter for", + Computed: true, }, "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "ID of the resource to filter for", + Computed: true, }, "mac_address": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "MAC address of the resource to filter for", + Computed: true, }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Name of the resource to filter for", + Computed: true, }, }, }, }, "tags": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "Tags to filter for", + Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the resource was created", + Type: schema.TypeString, }, "updated_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date and time when the resource was updated", + Type: schema.TypeString, }, "region": regional.ComputedSchema(), "zone": zonal.ComputedSchema(), diff --git a/internal/services/jobs/jobs.go b/internal/services/jobs/jobs.go index 41a3db3d5c..1c77554770 100644 --- a/internal/services/jobs/jobs.go +++ b/internal/services/jobs/jobs.go @@ -37,34 +37,41 @@ func ResourceDefinition() *schema.Resource { Description: "The job name", }, "description": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "The job description", + Optional: true, }, "cpu_limit": { - Type: schema.TypeInt, - Required: true, + Type: schema.TypeInt, + Description: "CPU limit of the job", + Required: true, }, "memory_limit": { - Type: schema.TypeInt, - Required: true, + Type: schema.TypeInt, + Description: "Memory limit of the job", + Required: true, }, "image_uri": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "Image URI to use for the job", + Optional: true, }, "command": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Description: "Command to use for the job", + Optional: true, }, "timeout": { Type: schema.TypeString, + Description: "Timeout for the job in seconds", Optional: true, Computed: true, DiffSuppressFunc: dsf.Duration, }, "env": { - Type: schema.TypeMap, - Optional: true, + Type: schema.TypeMap, + Description: "Environment variables to pass to the job", + Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 1000), @@ -72,18 +79,21 @@ func ResourceDefinition() *schema.Resource { ValidateDiagFunc: validation.MapKeyLenBetween(0, 100), }, "cron": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, + Type: schema.TypeList, + Description: "Cron expression", + Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "schedule": { Type: schema.TypeString, + Description: "UNIX cron schedule to run job", Required: true, RequiredWith: []string{"cron.0"}, }, "timezone": { Type: schema.TypeString, + Description: "Timezone for the cron schedule, in tz database format (e.g., 'Europe/Paris').", Required: true, RequiredWith: []string{"cron.0"}, }, diff --git a/internal/services/k8s/pool.go b/internal/services/k8s/pool.go index a9770c73d5..024cb95559 100644 --- a/internal/services/k8s/pool.go +++ b/internal/services/k8s/pool.go @@ -190,8 +190,9 @@ func ResourcePool() *schema.Resource { Description: "The actual size of the pool", }, "nodes": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of nodes in the pool", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { diff --git a/internal/services/redis/cluster.go b/internal/services/redis/cluster.go index d578d9d12d..e8ffe615ab 100644 --- a/internal/services/redis/cluster.go +++ b/internal/services/redis/cluster.go @@ -191,8 +191,9 @@ func ResourceCluster() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "UUID of the public network to be connected to the cluster", }, "port": { Type: schema.TypeInt, @@ -200,7 +201,8 @@ func ResourceCluster() *schema.Resource { Description: "TCP port of the endpoint", }, "ips": { - Type: schema.TypeList, + Type: schema.TypeList, + Description: "List of IPv4 addresses of the endpoint", Elem: &schema.Schema{ Type: schema.TypeString, }, diff --git a/internal/services/registry/image_data_source.go b/internal/services/registry/image_data_source.go index fd84e37f16..6756a43a04 100644 --- a/internal/services/registry/image_data_source.go +++ b/internal/services/registry/image_data_source.go @@ -60,8 +60,9 @@ func DataSourceImage() *schema.Resource { Description: "The tags associated with the registry image", }, "updated_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Timestamp when the image was last updated.", + Type: schema.TypeString, }, "region": regional.Schema(), "organization_id": account.OrganizationIDSchema(), diff --git a/internal/services/scwconfig/scw_config_data_source.go b/internal/services/scwconfig/scw_config_data_source.go index bdf32f5419..6a529952c7 100644 --- a/internal/services/scwconfig/scw_config_data_source.go +++ b/internal/services/scwconfig/scw_config_data_source.go @@ -13,45 +13,55 @@ func DataSourceConfig() *schema.Resource { ReadContext: dataSourceConfigRead, Schema: map[string]*schema.Schema{ "project_id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Project ID used", + Computed: true, }, "project_id_source": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Where the project id definition comes from (Environment, configuration file, variable, ...)", + Computed: true, }, "access_key": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Access Key used", + Computed: true, }, "access_key_source": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Where the access key definition comes from (Environment, configuration file, variable, ...)", + Computed: true, }, "secret_key": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Type: schema.TypeString, + Description: "Secret Key used", + Computed: true, + Sensitive: true, }, "secret_key_source": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Where the secret key definition comes from (Environment, configuration file, variable, ...)", + Computed: true, }, "zone": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Zone used", + Computed: true, }, "zone_source": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Where the zone definition comes from (Environment, configuration file, variable, ...)", + Computed: true, }, "region": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Region used", + Computed: true, }, "region_source": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "Where the region definition comes from (Environment, configuration file, variable, ...)", + Computed: true, }, }, } diff --git a/internal/services/secret/secret.go b/internal/services/secret/secret.go index c54bd43ab3..8e27608766 100644 --- a/internal/services/secret/secret.go +++ b/internal/services/secret/secret.go @@ -2,6 +2,7 @@ package secret import ( "context" + "fmt" "path/filepath" "strconv" @@ -79,8 +80,13 @@ func ResourceSecret() *schema.Resource { }, }, "type": { - ForceNew: true, - Type: schema.TypeString, + ForceNew: true, + Type: schema.TypeString, + Description: func() string { + var t secret.SecretType + secretTypes := t.Values() + return fmt.Sprintf("Type of the secret could be any value among: %s", secretTypes) + }(), Optional: true, Default: secret.SecretTypeOpaque, ValidateDiagFunc: verify.ValidateEnum[secret.SecretType](), @@ -91,8 +97,9 @@ func ResourceSecret() *schema.Resource { Description: "True if secret protection is enabled on a given secret. A protected secret cannot be deleted.", }, "ephemeral_policy": { - Type: schema.TypeList, - Optional: true, + Type: schema.TypeList, + Description: "Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.", + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ttl": { @@ -117,8 +124,9 @@ func ResourceSecret() *schema.Resource { }, }, "versions": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of the versions of the secret", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "revision": { diff --git a/internal/services/tem/webhook.go b/internal/services/tem/webhook.go index 2d77aa7873..0fde480232 100644 --- a/internal/services/tem/webhook.go +++ b/internal/services/tem/webhook.go @@ -33,6 +33,7 @@ func ResourceWebhook() *schema.Resource { }, "name": { Type: schema.TypeString, + Description: "The name of the webhook", Optional: true, Computed: true, ValidateFunc: validation.StringLenBetween(3, 127), diff --git a/internal/services/vpc/routes_data_source.go b/internal/services/vpc/routes_data_source.go index cd8a8952e8..d698f33b2f 100644 --- a/internal/services/vpc/routes_data_source.go +++ b/internal/services/vpc/routes_data_source.go @@ -52,8 +52,9 @@ func DataSourceRoutes() *schema.Resource { Description: "Routes with these exact tags are listed.", }, "routes": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Computed: true, + Description: "List of routes", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { diff --git a/internal/services/vpc/vpcs_data_source.go b/internal/services/vpc/vpcs_data_source.go index 2823c232cf..90829b8980 100644 --- a/internal/services/vpc/vpcs_data_source.go +++ b/internal/services/vpc/vpcs_data_source.go @@ -30,36 +30,43 @@ func DataSourceVPCs() *schema.Resource { Description: "VPCs with these exact tags are listed.", }, "vpcs": { - Type: schema.TypeList, - Computed: true, + Type: schema.TypeList, + Description: "List of VPCs.", + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "ID of the VPC.", + Type: schema.TypeString, }, "name": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Name of the VPC.", + Type: schema.TypeString, }, "tags": { - Computed: true, - Type: schema.TypeList, + Computed: true, + Description: "List of tags.", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "created_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date on which the VPC was created (RFC 3339 format)", + Type: schema.TypeString, }, "update_at": { - Computed: true, - Type: schema.TypeString, + Computed: true, + Description: "Date on which the VPC was last updated (RFC 3339 format)", + Type: schema.TypeString, }, "is_default": { - Computed: true, - Type: schema.TypeBool, + Computed: true, + Description: "Whether this VPC is the default one for its project.", + Type: schema.TypeBool, }, "region": regional.Schema(), "organization_id": account.OrganizationIDSchema(), From a891fac83b8b671e0d847fa3e3d3fccb0b2887cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 20 Aug 2025 18:33:41 +0200 Subject: [PATCH 8/9] Fix linter --- internal/services/lb/backends_data_source.go | 1 + internal/services/lb/lbs_data_source.go | 1 + internal/services/secret/secret.go | 1 + 3 files changed, 3 insertions(+) diff --git a/internal/services/lb/backends_data_source.go b/internal/services/lb/backends_data_source.go index d67f9faea0..b3da187ec8 100644 --- a/internal/services/lb/backends_data_source.go +++ b/internal/services/lb/backends_data_source.go @@ -63,6 +63,7 @@ func DataSourceBackends() *schema.Resource { Description: func() string { var t lb.ForwardPortAlgorithm values := t.Values() + return fmt.Sprintf("Load balancing algorithm to be used when determining which backend server to forward new traffic to. Possible values are: %s", values) }(), Type: schema.TypeString, diff --git a/internal/services/lb/lbs_data_source.go b/internal/services/lb/lbs_data_source.go index e35ab3dd4d..464551709e 100644 --- a/internal/services/lb/lbs_data_source.go +++ b/internal/services/lb/lbs_data_source.go @@ -166,6 +166,7 @@ func DataSourceLbs() *schema.Resource { Description: func() string { var t lb.SSLCompatibilityLevel values := t.Values() + return fmt.Sprintf("SSL compatibility level possible values are %s", values) }(), Type: schema.TypeString, diff --git a/internal/services/secret/secret.go b/internal/services/secret/secret.go index 8e27608766..c2b3dd4158 100644 --- a/internal/services/secret/secret.go +++ b/internal/services/secret/secret.go @@ -85,6 +85,7 @@ func ResourceSecret() *schema.Resource { Description: func() string { var t secret.SecretType secretTypes := t.Values() + return fmt.Sprintf("Type of the secret could be any value among: %s", secretTypes) }(), Optional: true, From 6a82762549f8a7e996cdf0e86ea5d4ac0728a4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 21 Aug 2025 11:32:52 +0200 Subject: [PATCH 9/9] Fix linter --- internal/services/redis/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/redis/cluster.go b/internal/services/redis/cluster.go index 7d823ef7f9..a99cdf1850 100644 --- a/internal/services/redis/cluster.go +++ b/internal/services/redis/cluster.go @@ -193,7 +193,7 @@ func ResourceCluster() *schema.Resource { "id": { Type: schema.TypeString, Computed: true, - Optional: true, + Optional: true, Description: "UUID of the public network to be connected to the cluster", }, "port": {