From 05948d1bfa3a335837ce7debf8e2ec75d2102c4c Mon Sep 17 00:00:00 2001 From: Diana Barreto Date: Thu, 30 Nov 2023 16:43:36 +1000 Subject: [PATCH] calling terraform provider doit instead of doit-console --- docs/index.md | 12 +-- docs/resources/attribution.md | 14 +--- docs/resources/attribution_group.md | 13 +--- docs/resources/report.md | 73 ++----------------- examples/main.tf | 8 +- examples/provider/provider.tf | 6 +- .../doit-console_attribution/resource.tf | 2 +- .../resource.tf | 2 +- .../resources/doit-console_report/resource.tf | 2 +- go.mod | 2 +- internal/provider/provider.go | 2 +- main.go | 4 +- 12 files changed, 30 insertions(+), 110 deletions(-) diff --git a/docs/index.md b/docs/index.md index 77b0121..8a98378 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "doit-console Provider" +page_title: "doit Provider" subcategory: "" description: |- --- -# doit-console Provider +# doit Provider @@ -15,14 +15,14 @@ description: |- ```terraform terraform { required_providers { - doit-console = { - source = "doitintl/doit-console" - version = "0.3.1" + doit = { + source = "doitintl/doit" + version = "0.2.1" } } } -provider "doit-console" { +provider "doit" { # Configuration options prefer to use environment variables # DOIT_API_TOKEN, DOIT_HOST=https://api.doit.com and DOIT_CUSTOMER_CONTEXT } diff --git a/docs/resources/attribution.md b/docs/resources/attribution.md index 5575e96..f4f30eb 100644 --- a/docs/resources/attribution.md +++ b/docs/resources/attribution.md @@ -1,26 +1,16 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "doit-console_attribution Resource - terraform-provider-doit-console" +page_title: "doit_attribution Resource - terraform-provider-doit" subcategory: "" description: |- --- -# doit-console_attribution (Resource) +# doit_attribution (Resource) -## Example Usage -```terraform -# Manage Attribution group -resource "doit-console_attribution" "attri" { - name = "attritestnewname9" - description = "attritestdiana8" - formula = "A" - components = [{ type = "label", key = "iris_location", values = ["us"] }] -} -``` ## Schema diff --git a/docs/resources/attribution_group.md b/docs/resources/attribution_group.md index 6ee7cfd..9b3be1a 100644 --- a/docs/resources/attribution_group.md +++ b/docs/resources/attribution_group.md @@ -1,25 +1,16 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "doit-console_attribution_group Resource - terraform-provider-doit-console" +page_title: "doit_attribution_group Resource - terraform-provider-doit" subcategory: "" description: |- --- -# doit-console_attribution_group (Resource) +# doit_attribution_group (Resource) -## Example Usage -```terraform -# Manage Attribution group -resource "doit-console_attribution_group" "attributeGroup" { - name = "attritestnewgroup" - description = "attritestgroup" - attributions = [doit_attribution.attribute1.id, doit_attribution.attribute2.id] -} -``` ## Schema diff --git a/docs/resources/report.md b/docs/resources/report.md index f021073..7b2f8b9 100644 --- a/docs/resources/report.md +++ b/docs/resources/report.md @@ -1,77 +1,16 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "doit-console_report Resource - terraform-provider-doit-console" +page_title: "doit_report Resource - terraform-provider-doit" subcategory: "" description: |- --- -# doit-console_report (Resource) - - - -## Example Usage - -```terraform -resource "doit-console_report" "my-report" { - name = "test10" - description = "test10" - config = { - metric = { - type = "basic" - value = "cost" - } - include_promotional_credits = false - advanced_analysis = { - trending_up = false - trending_down = false - not_trending = false - forecast = false - } - aggregation = "total" - time_interval = "month" - dimensions = [ - { - id = "year" - type = "datetime" - }, - { - id = "month" - type = "datetime" - } - ] - time_range = { - mode = "last" - amount = 12 - include_current = true - unit = "month" - } - filters = [ - { - inverse = false - id = "attribution" - type = "attribution" - values = [ - "1CE699ZdwN5CRBw0tInY" - ] - } - ] - group = [ - { - id = "BSQZmvX6hvuKGPDHX7R3" - type = "attribution_group" - }, - { - id = "cloud_provider" - type = "fixed" - } - ] - layout = "table" - display_values = "actuals_only" - currency = "USD" - } -} -``` +# doit_report (Resource) + + + + ## Schema diff --git a/examples/main.tf b/examples/main.tf index 1c15bae..0117a80 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -1,13 +1,13 @@ terraform { required_providers { - doit-console = { - source = "doitintl/doit-console" + doit = { + source = "doitintl/doit" version = "0.3.1" } } } -resource "doit-console_report" "my-report" { +resource "doit_report" "my-report" { name = "test10" config = { metric = { @@ -65,5 +65,5 @@ resource "doit-console_report" "my-report" { } } -provider "doit-console" { +provider "doit" { } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 43a85d4..1730182 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,13 +1,13 @@ terraform { required_providers { - doit-console = { - source = "doitintl/doit-console" + doit = { + source = "doitintl/doit" version = "0.2.1" } } } -provider "doit-console" { +provider "doit" { # Configuration options prefer to use environment variables # DOIT_API_TOKEN, DOIT_HOST=https://api.doit.com and DOIT_CUSTOMER_CONTEXT } diff --git a/examples/resources/doit-console_attribution/resource.tf b/examples/resources/doit-console_attribution/resource.tf index 08696a3..02d4027 100644 --- a/examples/resources/doit-console_attribution/resource.tf +++ b/examples/resources/doit-console_attribution/resource.tf @@ -1,5 +1,5 @@ # Manage Attribution group -resource "doit-console_attribution" "attri" { +resource "doit_attribution" "attri" { name = "attritestnewname9" description = "attritestdiana8" formula = "A" diff --git a/examples/resources/doit-console_attribution_group/resource.tf b/examples/resources/doit-console_attribution_group/resource.tf index 78bd80b..7325953 100644 --- a/examples/resources/doit-console_attribution_group/resource.tf +++ b/examples/resources/doit-console_attribution_group/resource.tf @@ -1,5 +1,5 @@ # Manage Attribution group -resource "doit-console_attribution_group" "attributeGroup" { +resource "doit_attribution_group" "attributeGroup" { name = "attritestnewgroup" description = "attritestgroup" attributions = [doit_attribution.attribute1.id, doit_attribution.attribute2.id] diff --git a/examples/resources/doit-console_report/resource.tf b/examples/resources/doit-console_report/resource.tf index df6fbaa..48c096b 100644 --- a/examples/resources/doit-console_report/resource.tf +++ b/examples/resources/doit-console_report/resource.tf @@ -1,4 +1,4 @@ -resource "doit-console_report" "my-report" { +resource "doit_report" "my-report" { name = "test10" description = "test10" config = { diff --git a/go.mod b/go.mod index e80b080..897b0d4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module terraform-provider-doit-console +module terraform-provider-doit go 1.19 diff --git a/internal/provider/provider.go b/internal/provider/provider.go index d9ad801..1f47c90 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -51,7 +51,7 @@ type doitProvider struct { // Metadata returns the provider type name. func (p *doitProvider) Metadata(ctx context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse) { tflog.Debug(ctx, "provider Metadata") - resp.TypeName = "doit-console" + resp.TypeName = "doit" resp.Version = p.version } diff --git a/main.go b/main.go index 62c7ed2..d28dcdc 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "flag" "log" - "terraform-provider-doit-console/internal/provider" + "terraform-provider-doit/internal/provider" "github.com/hashicorp/terraform-plugin-framework/providerserver" ) @@ -43,7 +43,7 @@ func main() { // provider address is used in these tutorials in conjunction with a // specific Terraform CLI configuration for manual development testing // of this provider. - Address: "registry.terraform.io/doitintl/doit-console", + Address: "registry.terraform.io/doitintl/doit", Debug: debug, } err := providerserver.Serve(context.Background(), provider.New(version), opts)