diff --git a/CHANGELOG.md b/CHANGELOG.md index ff377475f..7a760e265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,7 @@ nav_order: 1 ## [MAJOR.MINOR.PATCH] - YYYY-MM-DD - - - +- Add Dragonfly resource (`aiven_dragonfly`) to allow for the creation and management of Dragonfly services - Use new user config generator to generate service integration and service integration endpoint configs - Fix `aiven_kafka_schema` version update - Add `external_aws_cloudwatch_logs`, `external_elasticsearch_logs_user_config`, `external_opensearch_logs_user_config`, diff --git a/docs/data-sources/dragonfly.md b/docs/data-sources/dragonfly.md new file mode 100644 index 000000000..8d6290c7a --- /dev/null +++ b/docs/data-sources/dragonfly.md @@ -0,0 +1,170 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "aiven_dragonfly Data Source - terraform-provider-aiven" +subcategory: "" +description: |- + The Dragonfly data source provides information about the existing Aiven Dragonfly service. +--- + +# aiven_dragonfly (Data Source) + +The Dragonfly data source provides information about the existing Aiven Dragonfly service. + + + + +## Schema + +### Required + +- `project` (String) Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. +- `service_name` (String) Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the service so name should be picked based on intended service usage rather than current attributes. + +### Read-Only + +- `additional_disk_space` (String) Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing. +- `cloud_name` (String) Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These are documented on each Cloud provider's own support articles, like [here for Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). +- `components` (List of Object) Service component information objects (see [below for nested schema](#nestedatt--components)) +- `disk_space` (String) Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing. +- `disk_space_cap` (String) The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project. +- `disk_space_default` (String) The default disk space of the service, possible values depend on the service type, the cloud provider and the project. Its also the minimum value for `disk_space` +- `disk_space_step` (String) The default disk space step of the service, possible values depend on the service type, the cloud provider and the project. `disk_space` needs to increment from `disk_space_default` by increments of this size. +- `disk_space_used` (String) Disk space that service is currently using +- `dragonfly` (List of Object) Dragonfly server provided values (see [below for nested schema](#nestedatt--dragonfly)) +- `dragonfly_user_config` (List of Object) Dragonfly user configurable settings (see [below for nested schema](#nestedatt--dragonfly_user_config)) +- `id` (String) The ID of this resource. +- `maintenance_window_dow` (String) Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc. +- `maintenance_window_time` (String) Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format. +- `plan` (String) Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available options can be seem from the [Aiven pricing page](https://aiven.io/pricing). +- `project_vpc_id` (String) Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new servers so the operation can take significant amount of time to complete if the service has a lot of data. +- `service_host` (String) The hostname of the service. +- `service_integrations` (List of Object) Service integrations to specify when creating a service. Not applied after initial service creation (see [below for nested schema](#nestedatt--service_integrations)) +- `service_password` (String, Sensitive) Password used for connecting to the service, if applicable +- `service_port` (Number) The port of the service +- `service_type` (String) Aiven internal service type code +- `service_uri` (String, Sensitive) URI for connecting to the service. Service specific info is under "kafka", "pg", etc. +- `service_username` (String) Username used for connecting to the service, if applicable +- `state` (String) Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING` +- `static_ips` (Set of String) Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a static ip resource is in the 'assigned' state it cannot be unbound from the node again +- `tag` (Set of Object) Tags are key-value pairs that allow you to categorize services. (see [below for nested schema](#nestedatt--tag)) +- `tech_emails` (Set of Object) Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service instability. (see [below for nested schema](#nestedatt--tech_emails)) +- `termination_protection` (Boolean) Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent unintentional service deletion. This does not shield against deleting databases or topics but for services with backups much of the content can at least be restored from backup in case accidental deletion is done. + + +### Nested Schema for `components` + +Read-Only: + +- `component` (String) +- `connection_uri` (String) +- `host` (String) +- `kafka_authentication_method` (String) +- `port` (Number) +- `route` (String) +- `ssl` (Boolean) +- `usage` (String) + + + +### Nested Schema for `dragonfly` + +Read-Only: + + + + +### Nested Schema for `dragonfly_user_config` + +Read-Only: + +- `cache_mode` (Boolean) +- `dragonfly_ssl` (Boolean) +- `ip_filter` (Set of String) +- `ip_filter_object` (Set of Object) (see [below for nested schema](#nestedobjatt--dragonfly_user_config--ip_filter_object)) +- `ip_filter_string` (Set of String) +- `migration` (List of Object) (see [below for nested schema](#nestedobjatt--dragonfly_user_config--migration)) +- `private_access` (List of Object) (see [below for nested schema](#nestedobjatt--dragonfly_user_config--private_access)) +- `privatelink_access` (List of Object) (see [below for nested schema](#nestedobjatt--dragonfly_user_config--privatelink_access)) +- `project_to_fork_from` (String) +- `public_access` (List of Object) (see [below for nested schema](#nestedobjatt--dragonfly_user_config--public_access)) +- `recovery_basebackup_name` (String) +- `service_log` (Boolean) +- `service_to_fork_from` (String) +- `static_ips` (Boolean) + + +### Nested Schema for `dragonfly_user_config.ip_filter_object` + +Read-Only: + +- `description` (String) +- `network` (String) + + + +### Nested Schema for `dragonfly_user_config.migration` + +Read-Only: + +- `dbname` (String) +- `host` (String) +- `ignore_dbs` (String) +- `method` (String) +- `password` (String) +- `port` (Number) +- `ssl` (Boolean) +- `username` (String) + + + +### Nested Schema for `dragonfly_user_config.private_access` + +Read-Only: + +- `dragonfly` (Boolean) +- `prometheus` (Boolean) + + + +### Nested Schema for `dragonfly_user_config.privatelink_access` + +Read-Only: + +- `dragonfly` (Boolean) +- `prometheus` (Boolean) + + + +### Nested Schema for `dragonfly_user_config.public_access` + +Read-Only: + +- `dragonfly` (Boolean) +- `prometheus` (Boolean) + + + + +### Nested Schema for `service_integrations` + +Read-Only: + +- `integration_type` (String) +- `source_service_name` (String) + + + +### Nested Schema for `tag` + +Read-Only: + +- `key` (String) +- `value` (String) + + + +### Nested Schema for `tech_emails` + +Read-Only: + +- `email` (String) diff --git a/docs/resources/dragonfly.md b/docs/resources/dragonfly.md new file mode 100644 index 000000000..fffc39869 --- /dev/null +++ b/docs/resources/dragonfly.md @@ -0,0 +1,191 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "aiven_dragonfly Resource - terraform-provider-aiven" +subcategory: "" +description: |- + The Dragonfly resource allows the creation and management of Aiven Dragonfly services. +--- + +# aiven_dragonfly (Resource) + +The Dragonfly resource allows the creation and management of Aiven Dragonfly services. + + + + +## Schema + +### Required + +- `plan` (String) Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available options can be seem from the [Aiven pricing page](https://aiven.io/pricing). +- `project` (String) Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. +- `service_name` (String) Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the service so name should be picked based on intended service usage rather than current attributes. + +### Optional + +- `additional_disk_space` (String) Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing. +- `cloud_name` (String) Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These are documented on each Cloud provider's own support articles, like [here for Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). +- `disk_space` (String, Deprecated) Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing. +- `dragonfly_user_config` (Block List, Max: 1) Dragonfly user configurable settings (see [below for nested schema](#nestedblock--dragonfly_user_config)) +- `maintenance_window_dow` (String) Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc. +- `maintenance_window_time` (String) Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format. +- `project_vpc_id` (String) Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new servers so the operation can take significant amount of time to complete if the service has a lot of data. +- `service_integrations` (Block List) Service integrations to specify when creating a service. Not applied after initial service creation (see [below for nested schema](#nestedblock--service_integrations)) +- `static_ips` (Set of String) Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a static ip resource is in the 'assigned' state it cannot be unbound from the node again +- `tag` (Block Set) Tags are key-value pairs that allow you to categorize services. (see [below for nested schema](#nestedblock--tag)) +- `tech_emails` (Block Set) Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service instability. (see [below for nested schema](#nestedblock--tech_emails)) +- `termination_protection` (Boolean) Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent unintentional service deletion. This does not shield against deleting databases or topics but for services with backups much of the content can at least be restored from backup in case accidental deletion is done. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `components` (List of Object) Service component information objects (see [below for nested schema](#nestedatt--components)) +- `disk_space_cap` (String) The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project. +- `disk_space_default` (String) The default disk space of the service, possible values depend on the service type, the cloud provider and the project. Its also the minimum value for `disk_space` +- `disk_space_step` (String) The default disk space step of the service, possible values depend on the service type, the cloud provider and the project. `disk_space` needs to increment from `disk_space_default` by increments of this size. +- `disk_space_used` (String) Disk space that service is currently using +- `dragonfly` (List of Object) Dragonfly server provided values (see [below for nested schema](#nestedatt--dragonfly)) +- `id` (String) The ID of this resource. +- `service_host` (String) The hostname of the service. +- `service_password` (String, Sensitive) Password used for connecting to the service, if applicable +- `service_port` (Number) The port of the service +- `service_type` (String) Aiven internal service type code +- `service_uri` (String, Sensitive) URI for connecting to the service. Service specific info is under "kafka", "pg", etc. +- `service_username` (String) Username used for connecting to the service, if applicable +- `state` (String) Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING` + + +### Nested Schema for `dragonfly_user_config` + +Optional: + +- `cache_mode` (Boolean) Evict entries when getting close to maxmemory limit. The default value is `false`. +- `dragonfly_ssl` (Boolean) Require SSL to access Dragonfly. The default value is `true`. +- `ip_filter` (Set of String, Deprecated) Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'. +- `ip_filter_object` (Block Set, Max: 1024) Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16' (see [below for nested schema](#nestedblock--dragonfly_user_config--ip_filter_object)) +- `ip_filter_string` (Set of String) Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'. +- `migration` (Block List, Max: 1) Migrate data from existing server (see [below for nested schema](#nestedblock--dragonfly_user_config--migration)) +- `private_access` (Block List, Max: 1) Allow access to selected service ports from private networks (see [below for nested schema](#nestedblock--dragonfly_user_config--private_access)) +- `privatelink_access` (Block List, Max: 1) Allow access to selected service components through Privatelink (see [below for nested schema](#nestedblock--dragonfly_user_config--privatelink_access)) +- `project_to_fork_from` (String) Name of another project to fork a service from. This has effect only when a new service is being created. +- `public_access` (Block List, Max: 1) Allow access to selected service ports from the public Internet (see [below for nested schema](#nestedblock--dragonfly_user_config--public_access)) +- `recovery_basebackup_name` (String) Name of the basebackup to restore in forked service. +- `service_log` (Boolean) Store logs for the service so that they are available in the HTTP API and console. +- `service_to_fork_from` (String) Name of another service to fork from. This has effect only when a new service is being created. +- `static_ips` (Boolean) Use static public IP addresses. + + +### Nested Schema for `dragonfly_user_config.ip_filter_object` + +Required: + +- `network` (String) CIDR address block. + +Optional: + +- `description` (String) Description for IP filter list entry. + + + +### Nested Schema for `dragonfly_user_config.migration` + +Required: + +- `host` (String) Hostname or IP address of the server where to migrate data from. +- `port` (Number) Port number of the server where to migrate data from. + +Optional: + +- `dbname` (String) Database name for bootstrapping the initial connection. +- `ignore_dbs` (String) Comma-separated list of databases, which should be ignored during migration (supported by MySQL and PostgreSQL only at the moment). +- `method` (String) The migration method to be used (currently supported only by Redis, Dragonfly, MySQL and PostgreSQL service types). +- `password` (String, Sensitive) Password for authentication with the server where to migrate data from. +- `ssl` (Boolean) The server where to migrate data from is secured with SSL. The default value is `true`. +- `username` (String) User name for authentication with the server where to migrate data from. + + + +### Nested Schema for `dragonfly_user_config.private_access` + +Optional: + +- `dragonfly` (Boolean) Allow clients to connect to dragonfly with a DNS name that always resolves to the service's private IP addresses. Only available in certain network locations. +- `prometheus` (Boolean) Allow clients to connect to prometheus with a DNS name that always resolves to the service's private IP addresses. Only available in certain network locations. + + + +### Nested Schema for `dragonfly_user_config.privatelink_access` + +Optional: + +- `dragonfly` (Boolean) Enable dragonfly. +- `prometheus` (Boolean) Enable prometheus. + + + +### Nested Schema for `dragonfly_user_config.public_access` + +Optional: + +- `dragonfly` (Boolean) Allow clients to connect to dragonfly from the public internet for service nodes that are in a project VPC or another type of private network. +- `prometheus` (Boolean) Allow clients to connect to prometheus from the public internet for service nodes that are in a project VPC or another type of private network. + + + + +### Nested Schema for `service_integrations` + +Required: + +- `integration_type` (String) Type of the service integration. The only supported value at the moment is `read_replica` +- `source_service_name` (String) Name of the source service + + + +### Nested Schema for `tag` + +Required: + +- `key` (String) Service tag key +- `value` (String) Service tag value + + + +### Nested Schema for `tech_emails` + +Required: + +- `email` (String) An email address to contact for technical issues + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `default` (String) +- `delete` (String) +- `read` (String) +- `update` (String) + + + +### Nested Schema for `components` + +Read-Only: + +- `component` (String) +- `connection_uri` (String) +- `host` (String) +- `kafka_authentication_method` (String) +- `port` (Number) +- `route` (String) +- `ssl` (Boolean) +- `usage` (String) + + + +### Nested Schema for `dragonfly` + +Read-Only: diff --git a/internal/sdkprovider/provider/provider.go b/internal/sdkprovider/provider/provider.go index f8549e669..2c97bf79c 100644 --- a/internal/sdkprovider/provider/provider.go +++ b/internal/sdkprovider/provider/provider.go @@ -12,6 +12,7 @@ import ( "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/cassandra" "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/clickhouse" "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/connectionpool" + "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/dragonfly" "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/flink" "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/grafana" "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/service/influxdb" @@ -141,8 +142,7 @@ func Provider(version string) *schema.Provider { "aiven_clickhouse_user": clickhouse.DatasourceClickhouseUser(), // dragonfly - // TODO: uncomment when dragonfly is supported - //"aiven_dragonfly": dragonfly.DatasourceDragonfly(), + "aiven_dragonfly": dragonfly.DatasourceDragonfly(), }, ResourcesMap: map[string]*schema.Resource{ @@ -247,8 +247,7 @@ func Provider(version string) *schema.Provider { "aiven_clickhouse_grant": clickhouse.ResourceClickhouseGrant(), // dragonfly - // TODO: uncomment when dragonfly is supported - //"aiven_dragonfly": dragonfly.ResourceDragonfly(), + "aiven_dragonfly": dragonfly.ResourceDragonfly(), }, } diff --git a/internal/sdkprovider/service/dragonfly/dragonfly_test.go b/internal/sdkprovider/service/dragonfly/dragonfly_test.go index bc210bb81..4bc26cacd 100644 --- a/internal/sdkprovider/service/dragonfly/dragonfly_test.go +++ b/internal/sdkprovider/service/dragonfly/dragonfly_test.go @@ -14,9 +14,6 @@ import ( ) func TestAccAiven_dragonfly(t *testing.T) { - // TODO: remove this once dragonfly is available - t.Skip("Dragonfly service is not available in Aiven") - resourceName := "aiven_dragonfly.bar" rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) @@ -180,9 +177,6 @@ data "aiven_dragonfly" "common" { // Dragonfly service tests func TestAccAivenService_dragonfly(t *testing.T) { - // TODO: remove this once dragonfly is available - t.Skip("Dragonfly service is not available in Aiven") - resourceName := "aiven_dragonfly.bar" rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) diff --git a/internal/sdkprovider/userconfig/service/dragonfly.go b/internal/sdkprovider/userconfig/service/dragonfly.go new file mode 100644 index 000000000..a67c1f58f --- /dev/null +++ b/internal/sdkprovider/userconfig/service/dragonfly.go @@ -0,0 +1,202 @@ +// Code generated by user config generator. DO NOT EDIT. + +package service + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/aiven/terraform-provider-aiven/internal/sdkprovider/userconfig/diff" +) + +func dragonflyUserConfig() *schema.Schema { + return &schema.Schema{ + Description: "Dragonfly user configurable settings", + DiffSuppressFunc: diff.SuppressUnchanged, + Elem: &schema.Resource{Schema: map[string]*schema.Schema{ + "cache_mode": { + Description: "Evict entries when getting close to maxmemory limit. The default value is `false`.", + Optional: true, + Type: schema.TypeBool, + }, + "dragonfly_ssl": { + Description: "Require SSL to access Dragonfly. The default value is `true`.", + Optional: true, + Type: schema.TypeBool, + }, + "ip_filter": { + Deprecated: "Deprecated. Use `ip_filter_string` instead.", + Description: "Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'.", + Elem: &schema.Schema{ + Description: "CIDR address block, either as a string, or in a dict with an optional description field.", + Type: schema.TypeString, + }, + MaxItems: 1024, + Optional: true, + Type: schema.TypeSet, + }, + "ip_filter_object": { + Description: "Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'", + Elem: &schema.Resource{Schema: map[string]*schema.Schema{ + "description": { + Description: "Description for IP filter list entry.", + Optional: true, + Type: schema.TypeString, + }, + "network": { + Description: "CIDR address block.", + Required: true, + Type: schema.TypeString, + }, + }}, + MaxItems: 1024, + Optional: true, + Type: schema.TypeSet, + }, + "ip_filter_string": { + Description: "Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'.", + Elem: &schema.Schema{ + Description: "CIDR address block, either as a string, or in a dict with an optional description field.", + Type: schema.TypeString, + }, + MaxItems: 1024, + Optional: true, + Type: schema.TypeSet, + }, + "migration": { + Description: "Migrate data from existing server", + Elem: &schema.Resource{Schema: map[string]*schema.Schema{ + "dbname": { + Description: "Database name for bootstrapping the initial connection.", + Optional: true, + Type: schema.TypeString, + }, + "host": { + Description: "Hostname or IP address of the server where to migrate data from.", + Required: true, + Type: schema.TypeString, + }, + "ignore_dbs": { + Description: "Comma-separated list of databases, which should be ignored during migration (supported by MySQL and PostgreSQL only at the moment).", + Optional: true, + Type: schema.TypeString, + }, + "method": { + Description: "The migration method to be used (currently supported only by Redis, Dragonfly, MySQL and PostgreSQL service types).", + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"dump", "replication"}, false), + }, + "password": { + Description: "Password for authentication with the server where to migrate data from.", + Optional: true, + Sensitive: true, + Type: schema.TypeString, + }, + "port": { + Description: "Port number of the server where to migrate data from.", + Required: true, + Type: schema.TypeInt, + }, + "ssl": { + Description: "The server where to migrate data from is secured with SSL. The default value is `true`.", + Optional: true, + Type: schema.TypeBool, + }, + "username": { + Description: "User name for authentication with the server where to migrate data from.", + Optional: true, + Type: schema.TypeString, + }, + }}, + MaxItems: 1, + Optional: true, + Type: schema.TypeList, + }, + "private_access": { + Description: "Allow access to selected service ports from private networks", + Elem: &schema.Resource{Schema: map[string]*schema.Schema{ + "dragonfly": { + Description: "Allow clients to connect to dragonfly with a DNS name that always resolves to the service's private IP addresses. Only available in certain network locations.", + Optional: true, + Type: schema.TypeBool, + }, + "prometheus": { + Description: "Allow clients to connect to prometheus with a DNS name that always resolves to the service's private IP addresses. Only available in certain network locations.", + Optional: true, + Type: schema.TypeBool, + }, + }}, + MaxItems: 1, + Optional: true, + Type: schema.TypeList, + }, + "privatelink_access": { + Description: "Allow access to selected service components through Privatelink", + Elem: &schema.Resource{Schema: map[string]*schema.Schema{ + "dragonfly": { + Description: "Enable dragonfly.", + Optional: true, + Type: schema.TypeBool, + }, + "prometheus": { + Description: "Enable prometheus.", + Optional: true, + Type: schema.TypeBool, + }, + }}, + MaxItems: 1, + Optional: true, + Type: schema.TypeList, + }, + "project_to_fork_from": { + Description: "Name of another project to fork a service from. This has effect only when a new service is being created.", + ForceNew: true, + Optional: true, + Type: schema.TypeString, + }, + "public_access": { + Description: "Allow access to selected service ports from the public Internet", + Elem: &schema.Resource{Schema: map[string]*schema.Schema{ + "dragonfly": { + Description: "Allow clients to connect to dragonfly from the public internet for service nodes that are in a project VPC or another type of private network.", + Optional: true, + Type: schema.TypeBool, + }, + "prometheus": { + Description: "Allow clients to connect to prometheus from the public internet for service nodes that are in a project VPC or another type of private network.", + Optional: true, + Type: schema.TypeBool, + }, + }}, + MaxItems: 1, + Optional: true, + Type: schema.TypeList, + }, + "recovery_basebackup_name": { + Description: "Name of the basebackup to restore in forked service.", + Optional: true, + Type: schema.TypeString, + }, + "service_log": { + Description: "Store logs for the service so that they are available in the HTTP API and console.", + Optional: true, + Type: schema.TypeBool, + }, + "service_to_fork_from": { + Description: "Name of another service to fork from. This has effect only when a new service is being created.", + ForceNew: true, + Optional: true, + Type: schema.TypeString, + }, + "static_ips": { + Description: "Use static public IP addresses.", + Optional: true, + Type: schema.TypeBool, + }, + }}, + MaxItems: 1, + Optional: true, + Type: schema.TypeList, + } +} diff --git a/internal/sdkprovider/userconfig/service/service.go b/internal/sdkprovider/userconfig/service/service.go index a77b9c3fd..66293a2b4 100644 --- a/internal/sdkprovider/userconfig/service/service.go +++ b/internal/sdkprovider/userconfig/service/service.go @@ -10,6 +10,8 @@ func GetUserConfig(kind string) *schema.Schema { return cassandraUserConfig() case "clickhouse": return clickhouseUserConfig() + case "dragonfly": + return dragonflyUserConfig() case "flink": return flinkUserConfig() case "grafana": @@ -39,5 +41,5 @@ func GetUserConfig(kind string) *schema.Schema { } } func UserConfigTypes() []string { - return []string{"cassandra", "clickhouse", "flink", "grafana", "influxdb", "kafka", "kafka_connect", "kafka_mirrormaker", "m3aggregator", "m3db", "mysql", "opensearch", "pg", "redis"} + return []string{"cassandra", "clickhouse", "dragonfly", "flink", "grafana", "influxdb", "kafka", "kafka_connect", "kafka_mirrormaker", "m3aggregator", "m3db", "mysql", "opensearch", "pg", "redis"} } diff --git a/main.go b/main.go index 4d7c58dec..d1fa01e9c 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( ) //go:generate go test -tags userconfig ./internal/schemautil/userconfig -//go:generate go run ./ucgenerator/... --excludeServices elasticsearch,dragonfly +//go:generate go run ./ucgenerator/... --excludeServices elasticsearch // registryPrefix is the registry prefix for the provider. const registryPrefix = "registry.terraform.io/"