Skip to content

Commit c1e165e

Browse files
committed
review comments
1 parent 4a2267f commit c1e165e

File tree

5 files changed

+129
-146
lines changed

5 files changed

+129
-146
lines changed

docs/data-sources/cdn_distribution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ data "stackit_cdn_distribution" "example" {
3636
- `created_at` (String) Time when the distribution was created
3737
- `domains` (Attributes List) List of configured domains for the distribution (see [below for nested schema](#nestedatt--domains))
3838
- `errors` (List of String) List of distribution errors
39-
- `id` (String) Terrform resource ID
39+
- `id` (String) Terrform resource ID, on the form of [project_id],[distribution_id]
4040
- `status` (String) Status of the distribution
4141
- `updated_at` (String) Time when the distribution was last updated
4242

@@ -46,7 +46,7 @@ data "stackit_cdn_distribution" "example" {
4646
Read-Only:
4747

4848
- `backend` (Attributes) The configured backend for the distribution (see [below for nested schema](#nestedatt--config--backend))
49-
- `regions` (List of String)
49+
- `regions` (List of String) The configured regions where content will be hosted
5050

5151
<a id="nestedatt--config--backend"></a>
5252
### Nested Schema for `config.backend`
@@ -55,7 +55,7 @@ Read-Only:
5555

5656
- `origin_request_headers` (Map of String) The configured origin request headers for the backend
5757
- `origin_url` (String) The configured backend type for the distribution
58-
- `type` (String) the
58+
- `type` (String) The configured backend type
5959

6060

6161

docs/resources/cdn_distribution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ resource "stackit_cdn_distribution" "example_distribution" {
4343
- `distribution_id` (String) STACKIT project ID associated with the distribution
4444
- `domains` (Attributes List) List of configured domains for the distribution (see [below for nested schema](#nestedatt--domains))
4545
- `errors` (List of String) List of distribution errors
46-
- `id` (String) Terrform resource ID
46+
- `id` (String) Terrform resource ID, on the form of [project_id],[distribution_id]
4747
- `status` (String) Status of the distribution
4848
- `updated_at` (String) Time when the distribution was last updated
4949

@@ -53,15 +53,15 @@ resource "stackit_cdn_distribution" "example_distribution" {
5353
Required:
5454

5555
- `backend` (Attributes) The configured backend for the distribution (see [below for nested schema](#nestedatt--config--backend))
56-
- `regions` (List of String)
56+
- `regions` (List of String) The configured regions where content will be hosted
5757

5858
<a id="nestedatt--config--backend"></a>
5959
### Nested Schema for `config.backend`
6060

6161
Required:
6262

6363
- `origin_url` (String) The configured backend type for the distribution
64-
- `type` (String) the
64+
- `type` (String) The configured backend type
6565

6666
Optional:
6767

stackit/internal/services/cdn/distribution/datasource.go

+18-37
Original file line numberDiff line numberDiff line change
@@ -73,115 +73,96 @@ func (r *distributionDataSource) Metadata(_ context.Context, req datasource.Meta
7373
}
7474

7575
func (r *distributionDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
76-
descriptions := map[string]string{
77-
"id": "Terrform resource ID",
78-
"distribution_id": "CDN distribution ID",
79-
"project_id": "STACKIT project ID associated with the distribution",
80-
"status": "Status of the distribution",
81-
"created_at": "Time when the distribution was created",
82-
"updated_at": "Time when the distribution was last updated",
83-
"errors": "List of distribution errors",
84-
"domains": "List of configured domains for the distribution",
85-
"config": "The distribution configuration",
86-
"config_backend": "The configured backend for the distribution",
87-
"config_regions": "The configured regions where content will be hosted",
88-
"config_backend_type": "the ",
89-
"config_backend_origin_url": "The configured backend type for the distribution",
90-
"config_backend_origin_request_headers": "The configured origin request headers for the backend",
91-
"domain_name": "The name of the domain",
92-
"domain_status": "The status of the domain",
93-
"domain_type": "The type of the domain. Each distribution has one domain of type \"managed\", and domains of type \"custom\" may be additionally created by the user",
94-
"domain_errors": "List of domain errors",
95-
}
9676
resp.Schema = schema.Schema{
9777
MarkdownDescription: features.AddBetaDescription("CDN distribution data source schema."),
9878
Description: "CDN distribution data source schema.",
9979
Attributes: map[string]schema.Attribute{
10080
"id": schema.StringAttribute{
101-
Description: descriptions["id"],
81+
Description: schemaDescriptions["id"],
10282
Computed: true,
10383
},
10484
"distribution_id": schema.StringAttribute{
105-
Description: descriptions["project_id"],
85+
Description: schemaDescriptions["project_id"],
10686
Required: true,
10787
Validators: []validator.String{
10888
validate.UUID(),
10989
},
11090
},
11191
"project_id": schema.StringAttribute{
112-
Description: descriptions["project_id"],
92+
Description: schemaDescriptions["project_id"],
11393
Required: true,
11494
Validators: []validator.String{
11595
validate.UUID(),
11696
},
11797
},
11898
"status": schema.StringAttribute{
11999
Computed: true,
120-
Description: descriptions["status"],
100+
Description: schemaDescriptions["status"],
121101
},
122102
"created_at": schema.StringAttribute{
123103
Computed: true,
124-
Description: descriptions["created_at"],
104+
Description: schemaDescriptions["created_at"],
125105
},
126106
"updated_at": schema.StringAttribute{
127107
Computed: true,
128-
Description: descriptions["updated_at"],
108+
Description: schemaDescriptions["updated_at"],
129109
},
130110
"errors": schema.ListAttribute{
131111
ElementType: types.StringType,
132112
Computed: true,
133-
Description: descriptions["errors"],
113+
Description: schemaDescriptions["errors"],
134114
},
135115
"domains": schema.ListNestedAttribute{
136116
Computed: true,
137-
Description: descriptions["domains"],
117+
Description: schemaDescriptions["domains"],
138118
NestedObject: schema.NestedAttributeObject{
139119
Attributes: map[string]schema.Attribute{
140120
"name": schema.StringAttribute{
141121
Computed: true,
142-
Description: descriptions["domain_name"],
122+
Description: schemaDescriptions["domain_name"],
143123
},
144124
"status": schema.StringAttribute{
145125
Computed: true,
146-
Description: descriptions["domain_status"],
126+
Description: schemaDescriptions["domain_status"],
147127
},
148128
"type": schema.StringAttribute{
149129
Computed: true,
150-
Description: descriptions["domain_type"],
130+
Description: schemaDescriptions["domain_type"],
151131
},
152132
"errors": schema.ListAttribute{
153133
Computed: true,
154-
Description: descriptions["domain_errors"],
134+
Description: schemaDescriptions["domain_errors"],
155135
ElementType: types.StringType,
156136
},
157137
},
158138
},
159139
},
160140
"config": schema.SingleNestedAttribute{
161141
Computed: true,
162-
Description: descriptions["config"],
142+
Description: schemaDescriptions["config"],
163143
Attributes: map[string]schema.Attribute{
164144
"backend": schema.SingleNestedAttribute{
165145
Computed: true,
166-
Description: descriptions["config_backend"],
146+
Description: schemaDescriptions["config_backend"],
167147
Attributes: map[string]schema.Attribute{
168148
"type": schema.StringAttribute{
169149
Computed: true,
170-
Description: descriptions["config_backend_type"],
150+
Description: schemaDescriptions["config_backend_type"],
171151
},
172152
"origin_url": schema.StringAttribute{
173153
Computed: true,
174-
Description: descriptions["config_backend_origin_url"],
154+
Description: schemaDescriptions["config_backend_origin_url"],
175155
},
176156
"origin_request_headers": schema.MapAttribute{
177157
Computed: true,
178-
Description: descriptions["config_backend_origin_request_headers"],
158+
Description: schemaDescriptions["config_backend_origin_request_headers"],
179159
ElementType: types.StringType,
180160
},
181161
},
182162
},
183163
"regions": schema.ListAttribute{
184164
Computed: true,
165+
Description: schemaDescriptions["config_regions"],
185166
ElementType: types.StringType,
186167
}},
187168
},

0 commit comments

Comments
 (0)