diff --git a/examples/data-sources/devcycle_evaluated_variable_boolean/data-source.tf b/examples/data-sources/devcycle_evaluated_variable_boolean/data-source.tf new file mode 100644 index 0000000..10f8f14 --- /dev/null +++ b/examples/data-sources/devcycle_evaluated_variable_boolean/data-source.tf @@ -0,0 +1,7 @@ +data "devcycle_evaluated_variable_boolean" "test" { + id = "acceptance-testing-boolean" + user = { + id = "acceptancetesting" + } + default_value = false +} \ No newline at end of file diff --git a/examples/data-sources/devcycle_evaluated_variable_json/data-source.tf b/examples/data-sources/devcycle_evaluated_variable_json/data-source.tf new file mode 100644 index 0000000..b87c196 --- /dev/null +++ b/examples/data-sources/devcycle_evaluated_variable_json/data-source.tf @@ -0,0 +1,7 @@ +data "devcycle_evaluated_variable_json" "test" { + id = "acceptance-testing-json" + user = { + id = "acceptancetesting" + } + default_value = "{}" +} \ No newline at end of file diff --git a/examples/data-sources/devcycle_evaluated_variable_number/data-source.tf b/examples/data-sources/devcycle_evaluated_variable_number/data-source.tf new file mode 100644 index 0000000..7e2703c --- /dev/null +++ b/examples/data-sources/devcycle_evaluated_variable_number/data-source.tf @@ -0,0 +1,7 @@ +data "devcycle_evaluated_variable_number" "test" { + id = "acceptance-testing-number" + user = { + id = "acceptancetesting" + } + default_value = 1 +} \ No newline at end of file diff --git a/examples/data-sources/devcycle_evaluated_variable_string/data-source.tf b/examples/data-sources/devcycle_evaluated_variable_string/data-source.tf new file mode 100644 index 0000000..bb0de7c --- /dev/null +++ b/examples/data-sources/devcycle_evaluated_variable_string/data-source.tf @@ -0,0 +1,7 @@ +data "devcycle_evaluated_variable_string" "test" { + id = "acceptance-testing-string" + user = { + id = "acceptancetesting" + } + default_value = "string" +} \ No newline at end of file diff --git a/internal/provider/environment_data_source.go b/internal/provider/environment_data_source.go index 955337a..6289b3c 100644 --- a/internal/provider/environment_data_source.go +++ b/internal/provider/environment_data_source.go @@ -12,7 +12,7 @@ type environmentDataSourceType struct{} func (t environmentDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: `DevCycle Environment Data Source.`, + MarkdownDescription: `DevCycle Environment Data Source. Read data from a given DevCycle Environment. R`, Attributes: map[string]tfsdk.Attribute{ "project_id": { diff --git a/internal/provider/environment_resource.go b/internal/provider/environment_resource.go index 1ad402c..5f614bf 100644 --- a/internal/provider/environment_resource.go +++ b/internal/provider/environment_resource.go @@ -16,7 +16,7 @@ type environmentResourceType struct{} func (t environmentResourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "DevCycle Environment resource", + MarkdownDescription: "DevCycle Environment resource. This resource is used to create and manage DevCycle environments.", Attributes: map[string]tfsdk.Attribute{ "project_id": { diff --git a/internal/provider/evaluated_boolean_variable_data_source.go b/internal/provider/evaluated_boolean_variable_data_source.go index ea5a479..7afb351 100644 --- a/internal/provider/evaluated_boolean_variable_data_source.go +++ b/internal/provider/evaluated_boolean_variable_data_source.go @@ -14,7 +14,7 @@ type evaluatedBoolVariableDataSourceType struct{} func (t evaluatedBoolVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "Evaluated Variable data source.", + MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.", Attributes: map[string]tfsdk.Attribute{ "user": userDataSchema(), @@ -24,7 +24,7 @@ func (t evaluatedBoolVariableDataSourceType) GetSchema(ctx context.Context) (tfs Type: types.BoolType, }, "default_value": { - MarkdownDescription: "Default value of the Variable. Either true or false.", + MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.", Required: true, Type: types.BoolType, }, diff --git a/internal/provider/evaluated_json_variable_data_source.go b/internal/provider/evaluated_json_variable_data_source.go index 952af7a..bc801a4 100644 --- a/internal/provider/evaluated_json_variable_data_source.go +++ b/internal/provider/evaluated_json_variable_data_source.go @@ -15,7 +15,7 @@ type evaluatedJSONVariableDataSourceType struct{} func (t evaluatedJSONVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "Evaluated Variable data source.", + MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.", Attributes: map[string]tfsdk.Attribute{ "user": userDataSchema(), @@ -25,7 +25,7 @@ func (t evaluatedJSONVariableDataSourceType) GetSchema(ctx context.Context) (tfs Type: types.StringType, }, "default_value": { - MarkdownDescription: "Default value of the Variable", + MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.", Required: true, Type: types.StringType, }, diff --git a/internal/provider/evaluated_number_variable_data_source.go b/internal/provider/evaluated_number_variable_data_source.go index 692d95c..099a927 100644 --- a/internal/provider/evaluated_number_variable_data_source.go +++ b/internal/provider/evaluated_number_variable_data_source.go @@ -15,7 +15,7 @@ type evaluatedNumberVariableDataSourceType struct{} func (t evaluatedNumberVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "Evaluated Variable data source.", + MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.", Attributes: map[string]tfsdk.Attribute{ "user": userDataSchema(), @@ -25,7 +25,7 @@ func (t evaluatedNumberVariableDataSourceType) GetSchema(ctx context.Context) (t Type: types.NumberType, }, "default_value": { - MarkdownDescription: "Default value of the Variable", + MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.", Required: true, Type: types.NumberType, }, diff --git a/internal/provider/evaluated_string_variable_data_source.go b/internal/provider/evaluated_string_variable_data_source.go index 14fc867..6155b7a 100644 --- a/internal/provider/evaluated_string_variable_data_source.go +++ b/internal/provider/evaluated_string_variable_data_source.go @@ -14,7 +14,7 @@ type evaluatedStringVariableDataSourceType struct{} func (t evaluatedStringVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "Evaluated Variable data source.", + MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.", Attributes: map[string]tfsdk.Attribute{ "user": userDataSchema(), @@ -24,7 +24,7 @@ func (t evaluatedStringVariableDataSourceType) GetSchema(ctx context.Context) (t Type: types.StringType, }, "default_value": { - MarkdownDescription: "Default value of the Variable", + MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.", Required: true, Type: types.StringType, }, diff --git a/internal/provider/feature_data_source.go b/internal/provider/feature_data_source.go index fc05ea2..41e6025 100644 --- a/internal/provider/feature_data_source.go +++ b/internal/provider/feature_data_source.go @@ -12,7 +12,7 @@ type featureDataSourceType struct{} func (t featureDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "DevCycle Feature data source", + MarkdownDescription: "DevCycle Feature data source.", Attributes: map[string]tfsdk.Attribute{ "name": { diff --git a/internal/provider/feature_resource.go b/internal/provider/feature_resource.go index e310c3b..f02cd98 100644 --- a/internal/provider/feature_resource.go +++ b/internal/provider/feature_resource.go @@ -19,7 +19,7 @@ type featureResourceType struct{} func (t featureResourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "DevCycle Feature resource", + MarkdownDescription: "DevCycle Feature resource. It's recommended to use the variable resource instead of this resource to manage variables. Variations currently have to be managed in this resource.", Attributes: map[string]tfsdk.Attribute{ "name": { diff --git a/internal/provider/project_data_source.go b/internal/provider/project_data_source.go index 796fe8e..85b0829 100644 --- a/internal/provider/project_data_source.go +++ b/internal/provider/project_data_source.go @@ -12,7 +12,7 @@ type projectDataSourceType struct{} func (t projectDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "DevCycle Project data source", + MarkdownDescription: "DevCycle Project data source.", Attributes: map[string]tfsdk.Attribute{ "key": { diff --git a/internal/provider/provider.go b/internal/provider/provider.go index e0ed585..b7e627b 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -112,22 +112,24 @@ func (p *provider) GetDataSources(ctx context.Context) (map[string]tfsdk.DataSou func (p *provider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{ + MarkdownDescription: "This provider allows you to manage DevCycle projects, environments, features, and variables. It uses the DevCycle API to manage these resources. You can find more information about the DevCycle API [here](https://docs.devcycle.com/management-api/)." + + "\n\n" + "This provider is compatible with Terraform v1.0 and newer. Because of the way that authentication for the management api works - this provider will have access to manage all projects within a DevCycle org. Be careful!", Attributes: map[string]tfsdk.Attribute{ "client_id": { - MarkdownDescription: "API Authentication Client ID", + MarkdownDescription: "API Authentication Client ID. Found in your DevCycle account settings.", Optional: true, Sensitive: true, Type: types.StringType, }, "client_secret": { - MarkdownDescription: "API Authentication Client Secret", + MarkdownDescription: "API Authentication Client Secret. Found in your DevCycle account settings.", Optional: true, Sensitive: true, Type: types.StringType, }, "server_sdk_token": { Type: types.StringType, - MarkdownDescription: "Server SDK Token", + MarkdownDescription: "Server SDK Token. This is specific to a given project, and an environment. Used to identify and authenticate server sdk requests to evaluate feature flags.", Sensitive: true, Optional: true, }, diff --git a/internal/provider/util.go b/internal/provider/util.go index 43e4a27..7c2d58f 100644 --- a/internal/provider/util.go +++ b/internal/provider/util.go @@ -20,7 +20,7 @@ func randSeq(n int) string { func userDataSchema() tfsdk.Attribute { return tfsdk.Attribute{ - MarkdownDescription: "User data to drive bucketing into variations", + MarkdownDescription: "User data to drive bucketing into variations for feature flag evaluations.", Required: true, Attributes: tfsdk.SingleNestedAttributes(map[string]tfsdk.Attribute{ "id": {