diff --git a/docs/index.md b/docs/index.md index 4b8d88d..0dbb173 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "kiwi Provider" +page_title: "misc Provider" subcategory: "" description: |- Terraform helpers. --- -# kiwi Provider +# misc Provider -Terraform helpers. +Various Terraform helpers. diff --git a/docs/resources/claim_from_pool.md b/docs/resources/claim_from_pool.md index 4636319..6540e6d 100644 --- a/docs/resources/claim_from_pool.md +++ b/docs/resources/claim_from_pool.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "kiwi_claim_from_pool Resource - kiwi" +page_title: "misc_claim_from_pool Resource - misc" subcategory: "" description: |- - Manages an order. + Manages pool claimers. --- -# kiwi_claim_from_pool (Resource) +# misc_claim_from_pool (Resource) -Manages an order. +Manages pool claimers. diff --git a/examples/main.tf b/examples/main.tf index e9966ee..fc9138f 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -1,28 +1,21 @@ terraform { required_providers { kiwi = { - source = "kiwicom/kiwi" + source = "kiwicom/misc" } } } -resource "kiwi_claim_from_pool" "server_addresses" { - pool = [ - "10.0.0.1", - "10.0.0.2", - "10.0.0.3", - "10.0.0.4", - "10.0.0.5", - "10.0.0.6", - ] +resource "misc_claim_from_pool" "master_cidr_subnets" { + pool = [for i in range(900, 1024) : cidrsubnet("172.23.192.0/18", 10, i)] claimers = [ - "server1", - "server2", - "server3", - "server4", + "cluster1", + "cluster2", + "cluster3", + "cluster4", ] } -output "server_addresses" { - value = kiwi_claim_from_pool.output +output "master_cidr_subnets" { + value = misc_claim_from_pool.master_cidr_subnets.output } diff --git a/examples/terraform-provider-hashicups b/examples/terraform-provider-hashicups deleted file mode 100755 index ff94951..0000000 Binary files a/examples/terraform-provider-hashicups and /dev/null differ diff --git a/go.mod b/go.mod index 52c753f..21d32d1 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module terraform-provider-kiwi +module terraform-provider-misc go 1.18 diff --git a/main.go b/main.go index e66e99c..3ea0415 100644 --- a/main.go +++ b/main.go @@ -2,13 +2,13 @@ package main import ( "context" - "terraform-provider-kiwi/kiwi" + "terraform-provider-misc/misc" "github.com/hashicorp/terraform-plugin-framework/providerserver" ) // Provider documentation generation. -//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name kiwi +//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name misc func main() { providerserver.Serve(context.Background(), kiwi.New, providerserver.ServeOpts{ diff --git a/kiwi/claim_from_pool_resource.go b/misc/claim_from_pool_resource.go similarity index 99% rename from kiwi/claim_from_pool_resource.go rename to misc/claim_from_pool_resource.go index cde2177..38fd7ce 100644 --- a/kiwi/claim_from_pool_resource.go +++ b/misc/claim_from_pool_resource.go @@ -24,7 +24,7 @@ var ( ) // NewOrderResource is a helper function to simplify the provider implementation. -func NewOrderResource() resource.Resource { +func NewClaimFromPoolResource() resource.Resource { return &claimFromPool{} } diff --git a/kiwi/helpers.go b/misc/helpers.go similarity index 100% rename from kiwi/helpers.go rename to misc/helpers.go diff --git a/kiwi/provider.go b/misc/provider.go similarity index 97% rename from kiwi/provider.go rename to misc/provider.go index 56548db..5106a75 100644 --- a/kiwi/provider.go +++ b/misc/provider.go @@ -25,7 +25,7 @@ type kiwiProvider struct{} // Metadata returns the provider type name. func (p *kiwiProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse) { - resp.TypeName = "kiwi" + resp.TypeName = "misc" } // Schema defines the provider-level schema for configuration data. @@ -50,6 +50,6 @@ func (p *kiwiProvider) DataSources(_ context.Context) []func() datasource.DataSo // Resources defines the resources implemented in the provider. func (p *kiwiProvider) Resources(_ context.Context) []func() resource.Resource { return []func() resource.Resource{ - NewOrderResource, + NewClaimFromPoolResource, } }