Skip to content

Commit

Permalink
DMS: fix documentation for dedicated instans & add deprecation warning (
Browse files Browse the repository at this point in the history
#2750)

DMS: fix documentation for dedicated instans & add deprecation warning

Summary of the Pull Request

Added example for opentelekomcloud_dms_dedicated_instance_v2
Added deprecation warning for opentelekomcloud_dms_instance_v2

PR Checklist

 Refers to: #2681
 Tests added/passed.
 Documentation updated.
 Schema updated.
 Release notes added.

Reviewed-by: Muneeb H. Jan <[email protected]>
Reviewed-by: Anton Sidelnikov
  • Loading branch information
artem-lifshits authored Nov 27, 2024
1 parent 6a0360d commit 43185f9
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
54 changes: 51 additions & 3 deletions docs/resources/dms_dedicated_instance_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Up-to-date reference of API arguments for DMS instance you can get at
Manages a DMS instance in the OpenTelekomCloud DMS Service (Kafka Premium/Platinum).
## Example Usage

### Create a Kafka instance using flavor ID
### Create a cluster Kafka instance

```hcl
variable "vpc_id" {}
Expand Down Expand Up @@ -55,6 +55,54 @@ resource "opentelekomcloud_dms_dedicated_instance_v2" "test" {
}
```

### Create a single-node Kafka instance with floating ip

```hcl
variable "vpc_id" {}
variable "subnet_id" {}
variable "security_group_id" {}
variable "access_password" {}
data "opentelekomcloud_dms_az_v1" "az_1" {}
data "opentelekomcloud_dms_flavor_v2" "test" {
type = "single"
flavor_id = "s6.2u4g.single.small"
}
locals {
flavor = data.opentelekomcloud_dms_flavor_v2.test.flavors[0]
}
resource "opentelekomcloud_networking_floatingip_v2" "fip_1" {
}
resource "opentelekomcloud_dms_dedicated_instance_v2" "instance_1" {
name = "kafka-single-node"
vpc_id = var.vpc_ip
network_id = var.subnet_id
security_group_id = var.security_group_id
flavor_id = local.flavor.id
storage_spec_code = local.flavor.ios[0].storage_spec_code
available_zones = [data.opentelekomcloud_dms_az_v1.az_1.id]
engine_version = "2.7"
storage_space = 300
broker_num = 1
ssl_enable = true
access_user = "user"
password = var.access_password
maintain_begin = "02:00"
maintain_end = "06:00"
retention_policy = "time_base"
enable_publicip = true
publicip_id = [opentelekomcloud_networking_floatingip_v2.fip_1.id]
}
```

## Argument Reference

The following arguments are supported:
Expand All @@ -65,8 +113,8 @@ The following arguments are supported:
* `description` - (Optional, String) Specifies the description of the DMS Kafka instance. It is a character string
containing not more than 1,024 characters.

* `flavor_id` - (Optional, String) Specifies the Kafka [flavor ID](https://docs.otc.t-systems.com/distributed-message-service/api-ref/apis_v2_recommended/other_apis/querying_product_specifications_list.html#listengineproducts,
e.g. **c6.2u4g.cluster**. This parameter and `product_id` are alternative.
* `flavor_id` - (Required, String, ForceNew) Specifies the Kafka [flavor ID](https://docs.otc.t-systems.com/distributed-message-service/api-ref/apis_v2_recommended/other_apis/querying_product_specifications_list.html#listengineproducts,
e.g. **c6.2u4g.cluster**.

* `engine_version` - (Required, String, ForceNew) Specifies the version of the Kafka engine,
such as 1.1.0, 2.3.0, 2.7 or other supported versions. Changing this creates a new instance resource.
Expand Down
3 changes: 3 additions & 0 deletions docs/resources/dms_instance_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Up-to-date reference of API arguments for DMS instance you can get at

Manages a DMS instance in the OpenTelekomCloud DMS Service (Kafka Premium/Platinum).

~>
Deprecated, use `opentelekomcloud_dms_dedicated_instance_v2` resource instead

## Example Usage

### Automatically detect the correct network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func ResourceDmsInstancesV2() *schema.Resource {
Update: schema.DefaultTimeout(50 * time.Minute),
Delete: schema.DefaultTimeout(15 * time.Minute),
},
DeprecationMessage: "Please use `opentelekomcloud_dms_dedicated_instance_v2` resource instead",

Schema: map[string]*schema.Schema{
"name": {
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/dmsd_doc_fix-503b4b9f0f568ad1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
other:
|
**[DMS]** Added deprecation warning for ``resource/opentelekomcloud_dms_instance_v2`` (`#2750 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/issues/2750>`_)
|
**[DMS]** Documentation fix for ``resource/opentelekomcloud_dms_dedicated_instance_v2`` (`#2750 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/issues/2750>`_)

0 comments on commit 43185f9

Please sign in to comment.