From 696ffd868ac5884db4f2d4d30a559b54221d93b0 Mon Sep 17 00:00:00 2001 From: Kim Schuhmacher Date: Tue, 5 Dec 2023 11:39:45 +0100 Subject: [PATCH] a --- README.md | 9 ++++++++- docs/data-sources/{vpc.md => vpcs.md} | 4 ++-- docs/resources/{vpc.md => vpcs.md} | 4 ++-- examples/data-sources/vpcs/vpcs.tf | 4 ++-- internal/provider/vpcs_data_source.go | 2 +- internal/provider/vpcs_resource.go | 3 ++- 6 files changed, 17 insertions(+), 9 deletions(-) rename docs/data-sources/{vpc.md => vpcs.md} (92%) rename docs/resources/{vpc.md => vpcs.md} (87%) diff --git a/README.md b/README.md index 083cdb2..ff8e40c 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,13 @@ it will still be charged for the full hour of usage. go install . ``` +#### Generating the provider documentation + +```shell +go generate +``` + + ### Local provider development override To use the locally built provider, create a `~/.terraformrc` file with the following content @@ -119,4 +126,4 @@ In order to run the full suite of Acceptance tests, run `make testacc`. ```shell make testacc -``` +``` \ No newline at end of file diff --git a/docs/data-sources/vpc.md b/docs/data-sources/vpcs.md similarity index 92% rename from docs/data-sources/vpc.md rename to docs/data-sources/vpcs.md index 90d850b..f6f18f2 100644 --- a/docs/data-sources/vpc.md +++ b/docs/data-sources/vpcs.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "timescale_vpc Data Source - terraform-provider-timescale" +page_title: "timescale_vpcs Data Source - terraform-provider-timescale" subcategory: "" description: |- --- -# timescale_vpc (Data Source) +# timescale_vpcs (Data Source) diff --git a/docs/resources/vpc.md b/docs/resources/vpcs.md similarity index 87% rename from docs/resources/vpc.md rename to docs/resources/vpcs.md index e2ea3af..d305d5f 100644 --- a/docs/resources/vpc.md +++ b/docs/resources/vpcs.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "timescale_vpc Resource - terraform-provider-timescale" +page_title: "timescale_vpcs Resource - terraform-provider-timescale" subcategory: "" description: |- --- -# timescale_vpc (Resource) +# timescale_vpcs (Resource) diff --git a/examples/data-sources/vpcs/vpcs.tf b/examples/data-sources/vpcs/vpcs.tf index 25b0773..34d531c 100644 --- a/examples/data-sources/vpcs/vpcs.tf +++ b/examples/data-sources/vpcs/vpcs.tf @@ -20,9 +20,9 @@ provider "timescale" { project_id = var.ts_project_id } -data "timescale_vpc" "vpcs" { +data "timescale_vpcs" "vpcs" { } output "vpc_list" { - value = data.timescale_vpc.vpcs + value = data.timescale_vpcs.vpcs } diff --git a/internal/provider/vpcs_data_source.go b/internal/provider/vpcs_data_source.go index 0e2466c..7e5c625 100644 --- a/internal/provider/vpcs_data_source.go +++ b/internal/provider/vpcs_data_source.go @@ -67,7 +67,7 @@ type peerVpcModel struct { // Metadata returns the data source type name. func (d *vpcsDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_vpc" + resp.TypeName = req.ProviderTypeName + "_vpcs" } // Read refreshes the Terraform state with the latest data. diff --git a/internal/provider/vpcs_resource.go b/internal/provider/vpcs_resource.go index 74c9ac3..6a06021 100644 --- a/internal/provider/vpcs_resource.go +++ b/internal/provider/vpcs_resource.go @@ -42,7 +42,7 @@ type vpcsResourceModel struct { // Metadata returns the data source type name. func (d *vpcsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_vpc" + resp.TypeName = req.ProviderTypeName + "_vpcs" } // Read refreshes the Terraform state with the latest data. @@ -69,6 +69,7 @@ func (d *vpcsResource) Read(ctx context.Context, req resource.ReadRequest, resp ID: types.Int64Value(vpcId), Name: types.StringValue(vpc.Name), ProvisionedID: types.StringValue(vpc.ProvisionedID), + ProjectID: types.StringValue(vpc.ProjectID), CIDR: types.StringValue(vpc.CIDR), RegionCode: types.StringValue(vpc.RegionCode), Status: types.StringValue(vpc.Status),