diff --git a/docs/data-sources/dragonfly.md b/docs/data-sources/dragonfly.md index 8d6290c7a..2c11fb0c5 100644 --- a/docs/data-sources/dragonfly.md +++ b/docs/data-sources/dragonfly.md @@ -3,14 +3,21 @@ page_title: "aiven_dragonfly Data Source - terraform-provider-aiven" subcategory: "" description: |- - The Dragonfly data source provides information about the existing Aiven Dragonfly service. + Gets information about an Aiven for Dragonfly® service. --- # aiven_dragonfly (Data Source) -The Dragonfly data source provides information about the existing Aiven Dragonfly service. +Gets information about an Aiven for Dragonfly® service. +## Example Usage +```terraform +data "aiven_dragonfly" "example_dragonfly" { + project = data.aiven_project.example_project.project + service_name = "example-dragonfly-service" +} +``` ## Schema diff --git a/docs/resources/dragonfly.md b/docs/resources/dragonfly.md index fffc39869..55d9b2f3f 100644 --- a/docs/resources/dragonfly.md +++ b/docs/resources/dragonfly.md @@ -3,14 +3,27 @@ page_title: "aiven_dragonfly Resource - terraform-provider-aiven" subcategory: "" description: |- - The Dragonfly resource allows the creation and management of Aiven Dragonfly services. + Creates and manages an Aiven for Dragonfly® https://aiven.io/docs/products/dragonfly/concepts/overview service. --- # aiven_dragonfly (Resource) -The Dragonfly resource allows the creation and management of Aiven Dragonfly services. +Creates and manages an [Aiven for Dragonfly®](https://aiven.io/docs/products/dragonfly/concepts/overview) service. +## Example Usage +```terraform +resource "aiven_dragonfly" "example_dragonfly" { + project = data.aiven_project.example_project.project + plan = "startup-4" + cloud_name = "google-europe-west1" + service_name = "example-dragonfly-service" + + dragonfly_user_config { + cache_mode = true + } +} +``` ## Schema @@ -189,3 +202,11 @@ Read-Only: ### Nested Schema for `dragonfly` Read-Only: + +## Import + +Import is supported using the following syntax: + +```shell +terraform import aiven_dragonfly.example_dragonfly PROJECT/SERVICE_NAME +``` diff --git a/examples/data-sources/aiven_dragonfly/data-source.tf b/examples/data-sources/aiven_dragonfly/data-source.tf new file mode 100644 index 000000000..84ab437e8 --- /dev/null +++ b/examples/data-sources/aiven_dragonfly/data-source.tf @@ -0,0 +1,4 @@ +data "aiven_dragonfly" "example_dragonfly" { + project = data.aiven_project.example_project.project + service_name = "example-dragonfly-service" +} diff --git a/examples/dragonfly/provider.tf b/examples/dragonfly/provider.tf new file mode 100644 index 000000000..85d33a5b7 --- /dev/null +++ b/examples/dragonfly/provider.tf @@ -0,0 +1,12 @@ +terraform { + required_providers { + aiven = { + source = "aiven/aiven" + version = ">=4.0.0, <5.0.0" + } + } +} + +provider "aiven" { + api_token = var.aiven_token +} \ No newline at end of file diff --git a/examples/dragonfly/service.tf b/examples/dragonfly/service.tf new file mode 100644 index 000000000..08cf87e13 --- /dev/null +++ b/examples/dragonfly/service.tf @@ -0,0 +1,10 @@ +resource "aiven_dragonfly" "example_dragonfly" { + project = var.aiven_project_name + plan = "startup-4" + cloud_name = "google-europe-west1" + service_name = "example-dragonfly-service" + + dragonfly_user_config { + cache_mode = true + } +} \ No newline at end of file diff --git a/examples/dragonfly/variables.tf b/examples/dragonfly/variables.tf new file mode 100644 index 000000000..af2418dcb --- /dev/null +++ b/examples/dragonfly/variables.tf @@ -0,0 +1,9 @@ +variable "aiven_token" { + description = "Aiven token" + type = string +} + +variable "aiven_project_name" { + description = "Aiven project name" + type = string +} \ No newline at end of file diff --git a/examples/resources/aiven_dragonfly/import.sh b/examples/resources/aiven_dragonfly/import.sh new file mode 100644 index 000000000..5bebd9d1b --- /dev/null +++ b/examples/resources/aiven_dragonfly/import.sh @@ -0,0 +1 @@ +terraform import aiven_dragonfly.example_dragonfly PROJECT/SERVICE_NAME diff --git a/examples/resources/aiven_dragonfly/resource.tf b/examples/resources/aiven_dragonfly/resource.tf new file mode 100644 index 000000000..4e9fd43ff --- /dev/null +++ b/examples/resources/aiven_dragonfly/resource.tf @@ -0,0 +1,10 @@ +resource "aiven_dragonfly" "example_dragonfly" { + project = data.aiven_project.example_project.project + plan = "startup-4" + cloud_name = "google-europe-west1" + service_name = "example-dragonfly-service" + + dragonfly_user_config { + cache_mode = true + } +} \ No newline at end of file diff --git a/internal/sdkprovider/service/dragonfly/dragonfly.go b/internal/sdkprovider/service/dragonfly/dragonfly.go index 73b5ca7ae..d9765cd15 100644 --- a/internal/sdkprovider/service/dragonfly/dragonfly.go +++ b/internal/sdkprovider/service/dragonfly/dragonfly.go @@ -22,7 +22,7 @@ func dragonflySchema() map[string]*schema.Schema { func ResourceDragonfly() *schema.Resource { return &schema.Resource{ - Description: "The Dragonfly resource allows the creation and management of Aiven Dragonfly services.", + Description: "Creates and manages an [Aiven for Dragonfly®](https://aiven.io/docs/products/dragonfly/concepts/overview) service.", CreateContext: schemautil.ResourceServiceCreateWrapper(schemautil.ServiceTypeDragonfly), ReadContext: schemautil.ResourceServiceRead, UpdateContext: schemautil.ResourceServiceUpdate, diff --git a/internal/sdkprovider/service/dragonfly/dragonfly_data_source.go b/internal/sdkprovider/service/dragonfly/dragonfly_data_source.go index ac7155f49..8b0705446 100644 --- a/internal/sdkprovider/service/dragonfly/dragonfly_data_source.go +++ b/internal/sdkprovider/service/dragonfly/dragonfly_data_source.go @@ -9,7 +9,7 @@ import ( func DatasourceDragonfly() *schema.Resource { return &schema.Resource{ ReadContext: schemautil.DatasourceServiceRead, - Description: "The Dragonfly data source provides information about the existing Aiven Dragonfly service.", + Description: "Gets information about an Aiven for Dragonfly® service.", Schema: schemautil.ResourceSchemaAsDatasourceSchema(dragonflySchema(), "project", "service_name"), } }