From 6baf23c83c779dea279eb54ac56802ea83320f59 Mon Sep 17 00:00:00 2001 From: Markus Blomqvist Date: Fri, 13 Sep 2024 18:07:33 +0300 Subject: [PATCH] Regenerate --- .speakeasy/gen.lock | 10 +++--- README.md | 61 +++++++++++++++++++++++++++------- docs/index.md | 2 +- examples/provider/provider.tf | 24 ++----------- gen.yaml | 2 +- internal/sdk/sdk.go | 7 ++-- internal/sdk/types/pointers.go | 1 + 7 files changed, 65 insertions(+), 42 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9c06ca2..7873ea3 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 5a857039-7f4b-42d5-86fd-449767242ed2 management: docChecksum: e4360dfb76bc6a89e63423a01fb462d3 docVersion: 1.0.0 - speakeasyVersion: 1.393.2 - generationVersion: 2.413.0 - releaseVersion: 0.10.4 - configChecksum: 1ffadd962a5fbaa8054b4641b477e9f0 + speakeasyVersion: 1.396.7 + generationVersion: 2.415.6 + releaseVersion: 0.10.5 + configChecksum: d1007f22f98a4ca33da84ce78fb0fdb5 repoURL: https://github.com/epilot-dev/terraform-provider-epilot-product.git repoSubDirectory: . published: true @@ -22,7 +22,7 @@ features: terraform: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.4 - core: 3.24.9 + core: 3.24.11 envVarSecurityUsage: 0.1.0 globalSecurity: 2.81.8 globalServerURLs: 2.82.1 diff --git a/README.md b/README.md index 49174ab..476ad82 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,13 @@ TF_REATTACH_PROVIDERS=... terraform apply ## Table of Contents -* [SDK Installation](#sdk-installation) -* [SDK Example Usage](#sdk-example-usage) +* [Installation](#installation) +* [Available Resources and Data Sources](#available-resources-and-data-sources) +* [Testing the provider locally](#testing-the-provider-locally) - -## SDK Installation + +## Installation To install this provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`. @@ -77,7 +78,7 @@ terraform { required_providers { epilot-product = { source = "epilot-dev/epilot-product" - version = "0.10.4" + version = "0.10.5" } } } @@ -86,21 +87,19 @@ provider "epilot-product" { # Configuration options } ``` - + - -## SDK Example Usage + +## Testing the provider locally -### Testing the provider locally +#### Local Provider Should you want to validate a change locally, the `--debug` flag allows you to execute the provider against a terraform instance locally. This also allows for debuggers (e.g. delve) to be attached to the provider. -### Example - ```sh go run main.go --debug # Copy the TF_REATTACH_PROVIDERS env var @@ -109,9 +108,47 @@ cd examples/your-example TF_REATTACH_PROVIDERS=... terraform init TF_REATTACH_PROVIDERS=... terraform apply ``` - +#### Compiled Provider + +Terraform allows you to use local provider builds by setting a `dev_overrides` block in a configuration file called `.terraformrc`. This block overrides all other configured installation methods. + +1. Execute `go build` to construct a binary called `terraform-provider-epilot-product` +2. Ensure that the `.terraformrc` file is configured with a `dev_overrides` section such that your local copy of terraform can see the provider binary + +Terraform searches for the `.terraformrc` file in your home directory and applies any configuration settings you set. + +``` +provider_installation { + + dev_overrides { + "registry.terraform.io/epilot-dev/epilot-product" = "" + } + + # For all other providers, install them directly from their origin provider + # registries as normal. If you omit this, Terraform will _only_ use + # the dev_overrides block, and so no other providers will be available. + direct {} +} +``` + + + + + +## Available Resources and Data Sources + +### Resources + +* [epilot-product_price](docs/resources/price.md) +* [epilot-product_product](docs/resources/product.md) +* [epilot-product_tax](docs/resources/tax.md) +### Data Sources +* [epilot-product_price](docs/data-sources/price.md) +* [epilot-product_product](docs/data-sources/product.md) +* [epilot-product_tax](docs/data-sources/tax.md) + diff --git a/docs/index.md b/docs/index.md index 166235d..b39b323 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,7 +17,7 @@ terraform { required_providers { epilot-product = { source = "epilot-dev/epilot-product" - version = "0.10.4" + version = "0.10.5" } } } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 10ab5f4..1d1214c 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,30 +1,12 @@ -# Provider definitions terraform { required_providers { epilot-product = { source = "epilot-dev/epilot-product" - version = "0.10.1" + version = "0.10.5" } } } -# Variables -variable "epilot_auth" { - type = string -} - -variable "product_api_url" { - type = string - default = "https://product.dev.sls.epilot.io" -} -# Providers configuration - provider "epilot-product" { - epilot_auth = var.epilot_auth - server_url = var.product_api_url -} - - -# resource "epilot-product_product" "my_product" { - -# } \ No newline at end of file + # Configuration options +} \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 3d07837..0aed856 100644 --- a/gen.yaml +++ b/gen.yaml @@ -27,7 +27,7 @@ go: outputModelSuffix: output packageName: openapi terraform: - version: 0.10.4 + version: 0.10.5 additionalDataSources: [] additionalDependencies: {} additionalResources: [] diff --git a/internal/sdk/sdk.go b/internal/sdk/sdk.go index dd02146..bdeb019 100644 --- a/internal/sdk/sdk.go +++ b/internal/sdk/sdk.go @@ -42,6 +42,9 @@ func Float32(f float32) *float32 { return &f } // Float64 provides a helper function to return a pointer to a float64 func Float64(f float64) *float64 { return &f } +// Pointer provides a helper function to return a pointer to a type +func Pointer[T any](v T) *T { return &v } + type sdkConfiguration struct { Client HTTPClient Security func(context.Context) (interface{}, error) @@ -150,8 +153,8 @@ func New(opts ...SDKOption) *SDK { Language: "go", OpenAPIDocVersion: "1.0.0", SDKVersion: "0.0.1", - GenVersion: "2.413.0", - UserAgent: "speakeasy-sdk/go 0.0.1 2.413.0 1.0.0 github.com/epilot-dev/terraform-provider-epilot-product/internal/sdk", + GenVersion: "2.415.6", + UserAgent: "speakeasy-sdk/go 0.0.1 2.415.6 1.0.0 github.com/epilot-dev/terraform-provider-epilot-product/internal/sdk", Hooks: hooks.New(), }, } diff --git a/internal/sdk/types/pointers.go b/internal/sdk/types/pointers.go index 950d6a3..35c439d 100644 --- a/internal/sdk/types/pointers.go +++ b/internal/sdk/types/pointers.go @@ -8,3 +8,4 @@ func Int(i int) *int { return &i } func Int64(i int64) *int64 { return &i } func Float32(f float32) *float32 { return &f } func Float64(f float64) *float64 { return &f } +func Pointer[T any](v T) *T { return &v }