diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12ea260..c5fb140 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,6 +59,7 @@ jobs: terraform: - '1.6.*' - latest + max-parallel: 1 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 diff --git a/docs/data-sources/latest_datasources.md b/docs/data-sources/datasources.md similarity index 82% rename from docs/data-sources/latest_datasources.md rename to docs/data-sources/datasources.md index 929b257..1d6dc73 100644 --- a/docs/data-sources/latest_datasources.md +++ b/docs/data-sources/datasources.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "squaredup_latest_datasources Data Source - terraform-provider-squaredup" +page_title: "squaredup_datasources Data Source - terraform-provider-squaredup" subcategory: "" description: |- Data Sources are used to query third party APIs and SquaredUp visualizes the results --- -# squaredup_latest_datasources (Data Source) +# squaredup_datasources (Data Source) Data Sources are used to query third party APIs and SquaredUp visualizes the results ## Example Usage ```terraform -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } ``` diff --git a/docs/resources/dashboard.md b/docs/resources/dashboard.md index b27d6ab..a21acec 100644 --- a/docs/resources/dashboard.md +++ b/docs/resources/dashboard.md @@ -13,13 +13,13 @@ Dashboard are used to visualize data from Data Sources ## Example Usage ```terraform -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { @@ -29,7 +29,7 @@ resource "squaredup_workspace" "application_workspace" { } data "squaredup_data_streams" "sample_data_logs_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id } locals { diff --git a/docs/resources/datasource.md b/docs/resources/datasource.md index 6d07842..45f8127 100644 --- a/docs/resources/datasource.md +++ b/docs/resources/datasource.md @@ -13,13 +13,22 @@ Data Sources are used to query third party APIs and SquaredUp visualizes the res ## Example Usage ```terraform -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name +} + +resource "squaredup_datasource" "ado_datasource" { + display_name = "Azure DevOps" + data_source_name = "Azure DevOps" + config = jsonencode({ + org = "org-name" + accessToken = "access-token" + }) } ``` @@ -34,8 +43,7 @@ resource "squaredup_datasource" "sample_data_source" { ### Optional - `agent_group_id` (String) The ID of the agent group to which the data source should connect to (on-prem data sources only) -- `json_data_encoded` (String) Additional configuration for configuring data source. Needs to be a valid JSON -- `secure_json_data_encoded` (String, Sensitive) Sensitive configuration for the data source. Needs to be a valid JSON +- `config` (String, Sensitive) Sensitive configuration for the data source. Needs to be a valid JSON ### Read-Only diff --git a/docs/resources/workspace.md b/docs/resources/workspace.md index cd57057..1b74f8e 100644 --- a/docs/resources/workspace.md +++ b/docs/resources/workspace.md @@ -13,13 +13,13 @@ Each workspace has its own dashboards, data sources, monitors and scopes. ## Example Usage ```terraform -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { diff --git a/examples/data-sources/squaredup_datasources/data-source.tf b/examples/data-sources/squaredup_datasources/data-source.tf new file mode 100644 index 0000000..5f70bed --- /dev/null +++ b/examples/data-sources/squaredup_datasources/data-source.tf @@ -0,0 +1,3 @@ +data "squaredup_datasources" "sample_data" { + data_source_name = "Sample Data" +} diff --git a/examples/data-sources/squaredup_latest_datasources/data-source.tf b/examples/data-sources/squaredup_latest_datasources/data-source.tf deleted file mode 100644 index 6c1c43a..0000000 --- a/examples/data-sources/squaredup_latest_datasources/data-source.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "squaredup_latest_datasources" "sample_data" { - data_source_name = "Sample Data" -} diff --git a/examples/resources/squaredup_dashboard/resource.tf b/examples/resources/squaredup_dashboard/resource.tf index 73b323d..7f50bcc 100644 --- a/examples/resources/squaredup_dashboard/resource.tf +++ b/examples/resources/squaredup_dashboard/resource.tf @@ -1,10 +1,10 @@ -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { @@ -14,7 +14,7 @@ resource "squaredup_workspace" "application_workspace" { } data "squaredup_data_streams" "sample_data_logs_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id } locals { diff --git a/examples/resources/squaredup_datasource/resource.tf b/examples/resources/squaredup_datasource/resource.tf index 709a9a4..7dcc72c 100644 --- a/examples/resources/squaredup_datasource/resource.tf +++ b/examples/resources/squaredup_datasource/resource.tf @@ -1,8 +1,17 @@ -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name +} + +resource "squaredup_datasource" "ado_datasource" { + display_name = "Azure DevOps" + data_source_name = "Azure DevOps" + config = jsonencode({ + org = "org-name" + accessToken = "access-token" + }) } diff --git a/examples/resources/squaredup_workspace/resource.tf b/examples/resources/squaredup_workspace/resource.tf index 759bee8..f812c88 100644 --- a/examples/resources/squaredup_workspace/resource.tf +++ b/examples/resources/squaredup_workspace/resource.tf @@ -1,10 +1,10 @@ -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { diff --git a/examples/test-setup/main.tf b/examples/test-setup/main.tf index 72eeb96..8a6a0dc 100644 --- a/examples/test-setup/main.tf +++ b/examples/test-setup/main.tf @@ -11,28 +11,26 @@ provider "squaredup" { api_key = "api-key" } -data "squaredup_latest_datasources" "azure_devops" { +data "squaredup_datasources" "azure_devops" { data_source_name = "Azure DevOps" } -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "ado_datasource" { display_name = "Azure DevOps" - data_source_name = data.squaredup_latest_datasources.azure_devops.plugins[0].display_name - json_data_encoded = jsonencode({ - org = "org-name" - }) - secure_json_data_encoded = jsonencode({ + data_source_name = data.squaredup_datasources.azure_devops.plugins[0].display_name + config = jsonencode({ + org = "org-name" accessToken = "access-token" }) } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { @@ -51,7 +49,7 @@ resource "squaredup_workspace" "devops_workspace" { } data "squaredup_data_streams" "azure_devops_dataStreams" { - data_source_id = data.squaredup_latest_datasources.azure_devops.plugins[0].id + data_source_id = data.squaredup_datasources.azure_devops.plugins[0].id } locals { @@ -60,17 +58,17 @@ locals { } data "squaredup_data_streams" "sample_data_logs_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id data_stream_definition_name = "logs" } data "squaredup_data_streams" "sample_data_lambdaerrors_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id data_stream_definition_name = "perf-lambda-errors" } resource "squaredup_dashboard" "devops_team_dashboard" { - dashboard_template = file(".\\dashboardTemplate.json") + dashboard_template = file("dashboardTemplate.json") template_bindings = jsonencode({ azure_devops_data_source_id = squaredup_datasource.ado_datasource.id sample_data_source_id = squaredup_datasource.sample_data_source.id diff --git a/internal/provider/client_data_source.go b/internal/provider/client_data_source.go index de14600..98c57b2 100644 --- a/internal/provider/client_data_source.go +++ b/internal/provider/client_data_source.go @@ -42,7 +42,7 @@ func (c *SquaredUpClient) GetLatestDataSources(filterDisplayName string) ([]Late return plugins, nil } -func (c *SquaredUpClient) GenerateDataSourcePayload(displayName string, name string, pluginConfig map[string]interface{}, secureJsonData map[string]interface{}, agentGroupId string) (map[string]interface{}, error) { +func (c *SquaredUpClient) GenerateDataSourcePayload(displayName string, name string, pluginConfig map[string]interface{}, agentGroupId string) (map[string]interface{}, error) { plugins, err := c.GetLatestDataSources(name) if err != nil { return nil, err @@ -76,20 +76,11 @@ func (c *SquaredUpClient) GenerateDataSourcePayload(displayName string, name str config[key] = value } - for key, value := range secureJsonData { - config, ok := DataSourcePayload["config"].(map[string]interface{}) - if !ok { - config = make(map[string]interface{}) - DataSourcePayload["config"] = config - } - config[key] = value - } - return DataSourcePayload, nil } -func (c *SquaredUpClient) AddDataSource(displayName string, name string, pluginConfig map[string]interface{}, secureJsonData map[string]interface{}, agentGroupId string) (*DataSource, error) { - DataSourcePayload, err := c.GenerateDataSourcePayload(displayName, name, pluginConfig, secureJsonData, agentGroupId) +func (c *SquaredUpClient) AddDataSource(displayName string, name string, pluginConfig map[string]interface{}, agentGroupId string) (*DataSource, error) { + DataSourcePayload, err := c.GenerateDataSourcePayload(displayName, name, pluginConfig, agentGroupId) if err != nil { return nil, err } @@ -138,8 +129,8 @@ func (c *SquaredUpClient) GetDataSource(dataSourceId string) (*DataSource, error return &dataSource, nil } -func (c *SquaredUpClient) UpdateDataSource(dataSourceId string, displayName string, name string, pluginConfig map[string]interface{}, secureJsonData map[string]interface{}, agentGroupId string) error { - DataSourcePayload, err := c.GenerateDataSourcePayload(displayName, name, pluginConfig, secureJsonData, agentGroupId) +func (c *SquaredUpClient) UpdateDataSource(dataSourceId string, displayName string, name string, pluginConfig map[string]interface{}, agentGroupId string) error { + DataSourcePayload, err := c.GenerateDataSourcePayload(displayName, name, pluginConfig, agentGroupId) if err != nil { return err } diff --git a/internal/provider/data_source_latest_data_sources.go b/internal/provider/data_source_data_sources.go similarity index 98% rename from internal/provider/data_source_latest_data_sources.go rename to internal/provider/data_source_data_sources.go index 4a15470..c27a304 100644 --- a/internal/provider/data_source_latest_data_sources.go +++ b/internal/provider/data_source_data_sources.go @@ -39,7 +39,7 @@ type squaredupPluginModel struct { } func (d *squaredupLatestDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_latest_datasources" + resp.TypeName = req.ProviderTypeName + "_datasources" } func (d *squaredupLatestDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { diff --git a/internal/provider/data_source_data_streams_test.go b/internal/provider/data_source_data_streams_test.go index 6a4d6b5..8b2dca4 100644 --- a/internal/provider/data_source_data_streams_test.go +++ b/internal/provider/data_source_data_streams_test.go @@ -13,12 +13,12 @@ func TestDataStreamsDataSource(t *testing.T) { { Config: providerConfig + ` -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } data "squaredup_data_streams" "sample_data_logs_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id data_stream_definition_name = "logs" } `, diff --git a/internal/provider/data_source_latest_data_sources_test.go b/internal/provider/data_source_latest_data_sources_test.go index 7b60611..ac1fe6d 100644 --- a/internal/provider/data_source_latest_data_sources_test.go +++ b/internal/provider/data_source_latest_data_sources_test.go @@ -13,13 +13,13 @@ func TestLatestDataSourcesDataSource(t *testing.T) { { Config: providerConfig + ` -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } `, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.squaredup_latest_datasources.sample_data", "plugins.#", "1"), - resource.TestCheckResourceAttr("data.squaredup_latest_datasources.sample_data", "plugins.0.display_name", "Sample Data"), + resource.TestCheckResourceAttr("data.squaredup_datasources.sample_data", "plugins.#", "1"), + resource.TestCheckResourceAttr("data.squaredup_datasources.sample_data", "plugins.0.display_name", "Sample Data"), ), }, }, diff --git a/internal/provider/resource_dashboard_test.go b/internal/provider/resource_dashboard_test.go index f89abc0..b54e66a 100644 --- a/internal/provider/resource_dashboard_test.go +++ b/internal/provider/resource_dashboard_test.go @@ -13,13 +13,13 @@ func TestDashboardResource(t *testing.T) { //Create Dashboard Test { Config: providerConfig + ` -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { @@ -29,7 +29,7 @@ resource "squaredup_workspace" "application_workspace" { } data "squaredup_data_streams" "sample_data_logs_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id } locals { @@ -149,13 +149,13 @@ EOT //Update Dashboard Test { Config: providerConfig + ` -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } resource "squaredup_workspace" "application_workspace" { @@ -165,7 +165,7 @@ resource "squaredup_workspace" "application_workspace" { } data "squaredup_data_streams" "sample_data_logs_dataStreams" { - data_source_id = data.squaredup_latest_datasources.sample_data.plugins[0].id + data_source_id = data.squaredup_datasources.sample_data.plugins[0].id } locals { diff --git a/internal/provider/resource_data_source.go b/internal/provider/resource_data_source.go index 9cff923..9a375ce 100644 --- a/internal/provider/resource_data_source.go +++ b/internal/provider/resource_data_source.go @@ -34,13 +34,12 @@ func (r *dataSourceResource) Metadata(_ context.Context, req resource.MetadataRe } type dataSource struct { - DisplayName types.String `tfsdk:"display_name"` - ID types.String `tfsdk:"id"` - Name types.String `tfsdk:"data_source_name"` - AdditionalConfig types.String `tfsdk:"json_data_encoded"` - SecureJsonData types.String `tfsdk:"secure_json_data_encoded"` - AgentGroupID types.String `tfsdk:"agent_group_id"` - LastUpdated types.String `tfsdk:"last_updated"` + DisplayName types.String `tfsdk:"display_name"` + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"data_source_name"` + Config types.String `tfsdk:"config"` + AgentGroupID types.String `tfsdk:"agent_group_id"` + LastUpdated types.String `tfsdk:"last_updated"` } func (r *dataSourceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -62,12 +61,7 @@ func (r *dataSourceResource) Schema(_ context.Context, _ resource.SchemaRequest, Description: "Display name of the data source", Required: true, }, - "json_data_encoded": schema.StringAttribute{ - Description: "Additional configuration for configuring data source. Needs to be a valid JSON", - Optional: true, - CustomType: basetypes.StringType{}, - }, - "secure_json_data_encoded": schema.StringAttribute{ + "config": schema.StringAttribute{ Description: "Sensitive configuration for the data source. Needs to be a valid JSON", Optional: true, CustomType: basetypes.StringType{}, @@ -113,22 +107,11 @@ func (r *dataSourceResource) Create(ctx context.Context, req resource.CreateRequ } var plugin_config map[string]interface{} - if plan.AdditionalConfig.ValueString() != "" { - if err := json.Unmarshal([]byte(plan.AdditionalConfig.ValueString()), &plugin_config); err != nil { + if plan.Config.ValueString() != "" { + if err := json.Unmarshal([]byte(plan.Config.ValueString()), &plugin_config); err != nil { resp.Diagnostics.AddError( - "Error unmarshalling json_data_encoded", - fmt.Sprintf("Error unmarshalling json_data_encoded: %v", err), - ) - return - } - } - - var secure_json_data map[string]interface{} - if plan.SecureJsonData.ValueString() != "" { - if err := json.Unmarshal([]byte(plan.SecureJsonData.ValueString()), &secure_json_data); err != nil { - resp.Diagnostics.AddError( - "Error unmarshalling secure_json_data_encoded", - fmt.Sprintf("Error unmarshalling secure_json_data_encoded: %v", err), + "Error unmarshalling config", + fmt.Sprintf("Error unmarshalling config: %v", err), ) return } @@ -138,7 +121,6 @@ func (r *dataSourceResource) Create(ctx context.Context, req resource.CreateRequ plan.DisplayName.ValueString(), plan.Name.ValueString(), plugin_config, - secure_json_data, plan.AgentGroupID.ValueString(), ) if err != nil { @@ -157,12 +139,8 @@ func (r *dataSourceResource) Create(ctx context.Context, req resource.CreateRequ LastUpdated: types.StringValue(time.Now().Format(time.RFC850)), } - if plan.AdditionalConfig.ValueString() != "" { - state.AdditionalConfig = types.StringValue(plan.AdditionalConfig.ValueString()) - } - - if plan.SecureJsonData.ValueString() != "" { - state.SecureJsonData = types.StringValue(plan.SecureJsonData.ValueString()) + if plan.Config.ValueString() != "" { + state.Config = types.StringValue(plan.Config.ValueString()) } diags = resp.State.Set(ctx, state) @@ -194,12 +172,8 @@ func (r *dataSourceResource) Read(ctx context.Context, req resource.ReadRequest, state.AgentGroupID = types.StringValue(readDataSource.AgentGroupID) state.ID = types.StringValue(readDataSource.ID) - if state.AdditionalConfig.ValueString() != "" { - state.AdditionalConfig = types.StringValue(state.AdditionalConfig.ValueString()) - } - - if state.SecureJsonData.ValueString() != "" { - state.SecureJsonData = types.StringValue(state.SecureJsonData.ValueString()) + if state.Config.ValueString() != "" { + state.Config = types.StringValue(state.Config.ValueString()) } diags = resp.State.Set(ctx, state) @@ -225,22 +199,11 @@ func (r *dataSourceResource) Update(ctx context.Context, req resource.UpdateRequ } var plugin_config map[string]interface{} - if plan.AdditionalConfig.ValueString() != "" { - if err := json.Unmarshal([]byte(plan.AdditionalConfig.ValueString()), &plugin_config); err != nil { - resp.Diagnostics.AddError( - "Error unmarshalling json_data_encoded", - fmt.Sprintf("Error unmarshalling json_data_encoded: %v", err), - ) - return - } - } - - var secure_json_data map[string]interface{} - if plan.SecureJsonData.ValueString() != "" { - if err := json.Unmarshal([]byte(plan.SecureJsonData.ValueString()), &secure_json_data); err != nil { + if plan.Config.ValueString() != "" { + if err := json.Unmarshal([]byte(plan.Config.ValueString()), &plugin_config); err != nil { resp.Diagnostics.AddError( - "Error unmarshalling secure_json_data_encoded", - fmt.Sprintf("Error unmarshalling secure_json_data_encoded: %v", err), + "Error unmarshalling config", + fmt.Sprintf("Error unmarshalling config: %v", err), ) return } @@ -251,7 +214,6 @@ func (r *dataSourceResource) Update(ctx context.Context, req resource.UpdateRequ plan.DisplayName.ValueString(), plan.Name.ValueString(), plugin_config, - secure_json_data, plan.AgentGroupID.ValueString(), ) if err != nil { @@ -279,12 +241,8 @@ func (r *dataSourceResource) Update(ctx context.Context, req resource.UpdateRequ LastUpdated: types.StringValue(time.Now().Format(time.RFC850)), } - if plan.AdditionalConfig.ValueString() != "" { - state.AdditionalConfig = types.StringValue(plan.AdditionalConfig.ValueString()) - } - - if plan.SecureJsonData.ValueString() != "" { - state.SecureJsonData = types.StringValue(plan.SecureJsonData.ValueString()) + if plan.Config.ValueString() != "" { + state.Config = types.StringValue(plan.Config.ValueString()) } diags = resp.State.Set(ctx, state) diff --git a/internal/provider/resource_data_source_test.go b/internal/provider/resource_data_source_test.go index b445e15..d114a48 100644 --- a/internal/provider/resource_data_source_test.go +++ b/internal/provider/resource_data_source_test.go @@ -13,13 +13,13 @@ func TestDataSourceResource(t *testing.T) { //Create DataSource Test { Config: providerConfig + ` -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Test - Sample Data" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } `, Check: resource.ComposeTestCheckFunc( @@ -31,13 +31,13 @@ resource "squaredup_datasource" "sample_data_source" { //Update DataSource Test { Config: providerConfig + ` -data "squaredup_latest_datasources" "sample_data" { +data "squaredup_datasources" "sample_data" { data_source_name = "Sample Data" } resource "squaredup_datasource" "sample_data_source" { display_name = "Test - Sample Data Updated" - data_source_name = data.squaredup_latest_datasources.sample_data.plugins[0].display_name + data_source_name = data.squaredup_datasources.sample_data.plugins[0].display_name } `, Check: resource.ComposeTestCheckFunc(