diff --git a/docs/resources/fleet_integration.md b/docs/resources/fleet_integration.md index f67e09faa..4332d84bf 100644 --- a/docs/resources/fleet_integration.md +++ b/docs/resources/fleet_integration.md @@ -1,4 +1,3 @@ - --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "elasticstack_fleet_integration Resource - terraform-provider-elasticstack" @@ -22,6 +21,8 @@ set `skip_destroy` to `true`. ## Example Usage +### Basic usage + ```terraform provider "elasticstack" { kibana {} @@ -34,6 +35,28 @@ resource "elasticstack_fleet_integration" "test_integration" { } ``` +### Tracking the latest version + +An integration can track the latest available version by utilizing the `elasticstack_fleet_integration` data source. +The data source will retrieve the latest available version of the specified integration package, which can then be +passed to the `version` attribute of the `elasticstack_fleet_integration` resource. + +```terraform +provider "elasticstack" { + kibana {} +} + +data "elasticstack_fleet_integration" "tcp" { + name = "tcp" +} + +resource "elasticstack_fleet_integration" "test_integration" { + name = "tcp" + version = data.elasticstack_fleet_integration.tcp.version + force = true +} +``` + ## Schema diff --git a/examples/resources/elasticstack_fleet_integration/resource-with-latest-version.tf b/examples/resources/elasticstack_fleet_integration/resource-with-latest-version.tf new file mode 100644 index 000000000..e0dd00265 --- /dev/null +++ b/examples/resources/elasticstack_fleet_integration/resource-with-latest-version.tf @@ -0,0 +1,13 @@ +provider "elasticstack" { + kibana {} +} + +data "elasticstack_fleet_integration" "tcp" { + name = "tcp" +} + +resource "elasticstack_fleet_integration" "test_integration" { + name = "tcp" + version = data.elasticstack_fleet_integration.tcp.version + force = true +} diff --git a/templates/resources/fleet_integration.md.tmpl b/templates/resources/fleet_integration.md.tmpl new file mode 100644 index 000000000..093f5e554 --- /dev/null +++ b/templates/resources/fleet_integration.md.tmpl @@ -0,0 +1,53 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}" +subcategory: "Fleet" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Basic usage + +{{ tffile "examples/resources/elasticstack_fleet_integration/resource.tf" }} + +### Tracking the latest version + +An integration can track the latest available version by utilizing the `elasticstack_fleet_integration` data source. +The data source will retrieve the latest available version of the specified integration package, which can then be +passed to the `version` attribute of the `elasticstack_fleet_integration` resource. + +{{ tffile "examples/resources/elasticstack_fleet_integration/resource-with-latest-version.tf" }} + +{{ .SchemaMarkdown | trimspace }} +{{- if or .HasImport .HasImportIDConfig .HasImportIdentityConfig }} + +## Import + +Import is supported using the following syntax: +{{- end }} +{{- if .HasImportIdentityConfig }} + +In Terraform v1.12.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the `identity` attribute, for example: + +{{tffile .ImportIdentityConfigFile }} + +{{ .IdentitySchemaMarkdown | trimspace }} +{{- end }} +{{- if .HasImportIDConfig }} + +In Terraform v1.5.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +{{tffile .ImportIDConfigFile }} +{{- end }} +{{- if .HasImport }} + +The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: + +{{codefile "shell" .ImportFile }} +{{- end }}