Skip to content

Commit 5670205

Browse files
committed
cleanup on docs
1 parent c471710 commit 5670205

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

pkg/framework/objects/environment/schema.go

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ func (r *environmentDataSource) Schema(
6666
Description: "The ID of the extended attributes applied",
6767
},
6868
"connection_id": schema.Int64Attribute{
69-
Computed: true,
70-
Description: "A connection ID (used with Global Connections)",
69+
Computed: true,
70+
Description: "The ID of the connection to use (can be the `id` of a `dbtcloud_global_connection` or the `connection_id` of a legacy connection). " +
71+
"At the moment, it is optional and the environment will use the connection set in `dbtcloud_project_connection` if `connection_id` is not set in this resource. " +
72+
"In future versions this field will become required, so it is recommended to set it from now on. " +
73+
"When configuring this field, it needs to be configured for all the environments of the project. " +
74+
"To avoid Terraform state issues, when using this field, the `dbtcloud_project_connection` resource should be removed from the project or you need to make sure that the `connection_id` is the same in `dbtcloud_project_connection` and in the `connection_id` of the Development environment of the project",
7175
},
7276
"enable_model_query_history": schema.BoolAttribute{
7377
Computed: true,
@@ -104,7 +108,7 @@ func (r *environmentsDataSources) Schema(
104108
},
105109
"credentials_id": schema.Int64Attribute{
106110
Computed: true,
107-
Description: "Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments",
111+
Description: "Credential ID for this environment. A credential is not required for development environments, as dbt Cloud defaults to the user's credentials, but deployment environments will have this.",
108112
},
109113
"name": schema.StringAttribute{
110114
Computed: true,
@@ -155,18 +159,21 @@ func (r *environmentResource) Schema(
155159
resp *resource.SchemaResponse,
156160
) {
157161
resp.Schema = resource_schema.Schema{
158-
Description: "Retrieve data for a single environment",
162+
Description: "Resource to manage dbt Cloud environments for the different dbt Cloud projects." +
163+
" In a given dbt Cloud project, one development environment can be defined and as many deployment environments as needed can be created." +
164+
" ~> In August 2024, dbt Cloud released the \"global connection\" feature, allowing connections to be defined at the account level and reused across environments and projects." +
165+
" This version of the provider has the connection_id as an optional field but it is recommended to start setting it up in your projects. In future versions, this field will become mandatory.",
159166
Attributes: map[string]resource_schema.Attribute{
160167
"id": resource_schema.StringAttribute{
161168
Computed: true,
162-
Description: "The ID of the license map",
169+
Description: "The ID of environment.",
163170
PlanModifiers: []planmodifier.String{
164171
stringplanmodifier.UseStateForUnknown(),
165172
},
166173
},
167174
"environment_id": resource_schema.Int64Attribute{
168175
Computed: true,
169-
Description: "The ID of the environment",
176+
Description: "The ID of the environment. Duplicated. Here for backward compatibility.",
170177
PlanModifiers: []planmodifier.Int64{
171178
int64planmodifier.UseStateForUnknown(),
172179
},
@@ -179,13 +186,13 @@ func (r *environmentResource) Schema(
179186
},
180187
"project_id": resource_schema.Int64Attribute{
181188
Required: true,
182-
Description: "(Number) Project ID to create the environment in",
189+
Description: "Project ID to create the environment in",
183190
},
184191
"credential_id": resource_schema.Int64Attribute{
185192
Optional: true,
186193
Computed: true,
187194
Default: nil,
188-
Description: "The project ID to which the environment belong",
195+
Description: "The project ID to which the environment belongs.",
189196
},
190197
"name": resource_schema.StringAttribute{
191198
Required: true,
@@ -198,14 +205,14 @@ func (r *environmentResource) Schema(
198205
Computed: true,
199206
Optional: true,
200207
Default: stringdefault.StaticString("latest"),
201-
Description: "(String) Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` (e.g. `1.5.0-latest`), `major.minor.0-pre`, `versionless`, or `latest`. While `versionless` is still supported, using `latest` is recommended. Defaults to `latest` if no version is provided",
208+
Description: "Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` (e.g. `1.5.0-latest`), `major.minor.0-pre`, `versionless`, or `latest`. While `versionless` is still supported, using `latest` is recommended. Defaults to `latest` if no version is provided",
202209
Validators: []validator.String{
203210
stringvalidator.OneOf("latest", "versionless"),
204211
},
205212
},
206213
"type": resource_schema.StringAttribute{
207214
Required: true,
208-
Description: "(String) The type of environment (must be either development or deployment)",
215+
Description: "The type of environment (must be either development or deployment)",
209216
PlanModifiers: []planmodifier.String{
210217
stringplanmodifier.RequiresReplace(),
211218
},
@@ -228,7 +235,7 @@ func (r *environmentResource) Schema(
228235
"deployment_type": resource_schema.StringAttribute{
229236
Computed: true,
230237
Optional: true,
231-
Description: "(String) The type of environment. Only valid for environments of type 'deployment' and for now can only be 'production', 'staging' or left empty for generic environments",
238+
Description: "The type of environment. Only valid for environments of type 'deployment' and for now can only be 'production', 'staging' or left empty for generic environments",
232239
},
233240
"extended_attributes_id": resource_schema.Int64Attribute{
234241
Computed: true,
@@ -248,7 +255,7 @@ func (r *environmentResource) Schema(
248255
Computed: true,
249256
Optional: true,
250257
Default: booldefault.StaticBool(false),
251-
Description: "(Boolean) Whether to enable model query history in this environment. As of Oct 2024, works only for Snowflake and BigQuery.",
258+
Description: "Whether to enable model query history in this environment. As of Oct 2024, works only for Snowflake and BigQuery.",
252259
},
253260
},
254261
}

0 commit comments

Comments
 (0)