From cb9401c32ea21ed17028785e97b0a0852793c805 Mon Sep 17 00:00:00 2001 From: dmpe Date: Thu, 14 Nov 2024 15:43:13 +0100 Subject: [PATCH] add some additional examples --- .copywrite.hcl | 1 + docs/index.md | 48 ++++++++++++++++++++++++++++++++--- examples/provider/main.tf | 16 ++++++++++++ examples/provider/main_env.tf | 11 ++++++++ readme.md | 3 +-- templates/index.md.tmpl | 26 +++++++++++++++++++ 6 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 examples/provider/main.tf create mode 100644 examples/provider/main_env.tf create mode 100644 templates/index.md.tmpl diff --git a/.copywrite.hcl b/.copywrite.hcl index 5a52fc0..74d54ec 100644 --- a/.copywrite.hcl +++ b/.copywrite.hcl @@ -6,6 +6,7 @@ project { copyright_year = 2024 header_ignore = [ ".github/**", + "examples/**", ".goreleaser.yml", ] } \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 560721e..082bf5c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,15 +1,54 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "storagegrid Provider" -subcategory: "" description: |- - + NetApp StorageGrid provider for working with S3 REST API. --- -# storagegrid Provider +# NetApp storagegrid Provider +This unofficial NetApp provider can be used to interact with [StorageGrid](https://www.netapp.com/data-storage/storagegrid/) system. +Such system, be it a hardware or virtual appliance, supports Amazon S3 protocol. +It is import to note that this provider only supports "TENANT" REST API - not the administrative "GRID" REST API. +See also provider's documentation on GitHub, and on [NetApp](https://docs.netapp.com/us-en/storagegrid-family/). + +## Example Provider Usage + +```terraform +terraform { + required_providers { + storagegrid = { + source = "dmpe/storagegrid" + version = "" # My strong advice - always pin this provider's version! + } + } +} + +provider "storagegrid" { + address = "https://grid.firm.com:9443/api/v3" + username = "grid" + password = "change_me" + tenant = "" # Tenant ID + insecure = false +} +``` + +### Using environmental variables + +```terraform +terraform { + required_providers { + storagegrid = { + source = "dmpe/storagegrid" + version = "" # My strong advice - always pin this provider's version! + } + } +} + +provider "storagegrid" { +} +``` @@ -27,3 +66,4 @@ Must be without `/` at the end and without `api/v3` suffix which is added automa - `enable_trace_context` (Boolean) Enable trace context. If `true` a `Traceparent` header will be added to the request. Default: `false` - `insecure` (Boolean) Use insecure HTTP connection. Setting this to true will ignore certificates when calling REST API. Default: `false` + diff --git a/examples/provider/main.tf b/examples/provider/main.tf new file mode 100644 index 0000000..61cfc7a --- /dev/null +++ b/examples/provider/main.tf @@ -0,0 +1,16 @@ +terraform { + required_providers { + storagegrid = { + source = "dmpe/storagegrid" + version = "" # My strong advice - always pin this provider's version! + } + } +} + +provider "storagegrid" { + address = "https://grid.firm.com:9443/api/v3" + username = "grid" + password = "change_me" + tenant = "" # Tenant ID + insecure = false +} \ No newline at end of file diff --git a/examples/provider/main_env.tf b/examples/provider/main_env.tf new file mode 100644 index 0000000..8d2a654 --- /dev/null +++ b/examples/provider/main_env.tf @@ -0,0 +1,11 @@ +terraform { + required_providers { + storagegrid = { + source = "dmpe/storagegrid" + version = "" # My strong advice - always pin this provider's version! + } + } +} + +provider "storagegrid" { +} \ No newline at end of file diff --git a/readme.md b/readme.md index c7e3670..df32f7c 100644 --- a/readme.md +++ b/readme.md @@ -37,9 +37,8 @@ Configuring [required providers](https://www.terraform.io/docs/language/provider ```terraform terraform { - required_version = ">= 1.0.0" required_providers { - elasticstack = { + storagegrid = { source = "dmpe/storagegrid" version = "" # My strong advice - always pin this provider's version! } diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl new file mode 100644 index 0000000..4b9ea2c --- /dev/null +++ b/templates/index.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{ .ProviderShortName }} Provider" +description: |- + NetApp StorageGrid provider for working with S3 REST API. +--- + +# NetApp {{ .ProviderShortName }} Provider + +This unofficial NetApp provider can be used to interact with [StorageGrid](https://www.netapp.com/data-storage/storagegrid/) system. +Such system, be it a hardware or virtual appliance, supports Amazon S3 protocol. + +It is import to note that this provider only supports "TENANT" REST API - not the administrative "GRID" REST API. + +See also provider's documentation on GitHub, and on [NetApp](https://docs.netapp.com/us-en/storagegrid-family/). + +## Example Provider Usage + +{{ tffile "examples/provider/main.tf" }} + +### Using environmental variables + +{{ tffile "examples/provider/main_env.tf" }} + + +{{ .SchemaMarkdown | trimspace }} +