Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(iotda/data_flow_control_policy): support data flow control policy resource #5852

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions docs/resources/iotda_data_flow_control_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
subcategory: "IoT Device Access (IoTDA)"
layout: "huaweicloud"
page_title: "HuaweiCloud: huaweicloud_iotda_data_flow_control_policy"
description: |-
Manages an IoTDA data flow control policy resource within HuaweiCloud.
---

# huaweicloud_iotda_data_flow_control_policy

Manages an IoTDA data flow control policy resource within HuaweiCloud.

-> Currently, data flow control policy resources are only supported on IoTDA **standard** or **enterprise** edition
instance. When accessing an IoTDA **standard** or **enterprise** edition instance, you need to specify
the IoTDA service endpoint in `provider` block.
You can login to the IoTDA console, choose the instance **Overview** and click **Access Details**
to view the HTTPS application access address. An example of the access address might be
*9bc34xxxxx.st1.iotda-app.ap-southeast-1.myhuaweicloud.com*, then you need to configure the
`provider` block as follows:

```hcl
provider "huaweicloud" {
endpoints = {
iotda = "https://9bc34xxxxx.st1.iotda-app.ap-southeast-1.myhuaweicloud.com"
}
}
```

## Example Usage

```hcl
variable "name" {}
variable "scope" {}

resource "huaweicloud_iotda_data_flow_control_policy" "test" {
name = var.name
scope = var.scope
}
```

## Argument Reference

The following arguments are supported:

* `region` - (Optional, String, ForceNew) Specifies the region in which to create the resource.
If omitted, the provider-level region will be used. Changing this parameter will create a new resource.

* `name` - (Optional, String) Specifies the name of the data flow control policy. The length must not exceed `256`, and
only Chinese characters, letters, numbers, and the following characters are allowed: `_?'#().,&%@!-**`.

* `description` - (Optional, String) Specifies the description of the data flow control policy. The length must not
exceed `256`, and only Chinese characters, letters, numbers, and the following characters are allowed: `_?'#().,&%@!-**`.

* `scope` - (Optional, String, ForceNew) Specifies the scope of the data flow control policy. Changing this parameter
will create a new resource.
The valid values are as follows:
+ **USER**: Tenant level flow control strategy.
+ **CHANNEL**: Forwarding channel level flow control strategy.
+ **RULE**: Forwarding rule level flow control strategy.
+ **ACTION**: Forwarding action level flow control strategy.

If omitted, defaults to **USER**.

* `scope_value` - (Optional, String, ForceNew) Specifies the scope add value of the data flow control policy. Changing
this parameter will create a new resource.
+ If the `scope` is set to **USER**, this field does not need to be set.
+ If the `scope` is set to **CHANNEL**, the valid values are **HTTP_FORWARDING**, **DIS_FORWARDING**,
**OBS_FORWARDING**, **AMQP_FORWARDING**, and **DMS_KAFKA_FORWARDING**.
+ If the `scope` is set to **RULE**, the value of this field is the corresponding data forwarding rule ID.
+ If the `scope` is set to **ACTION**, the value of this field is the corresponding data forwarding rule action ID.

* `limit` - (Optional, Int) Specifies the size of the data forwarding flow control, in tps. Integers with valid values
ranging from `1` to `1,000`. Defaults to `1,000`.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The resource ID.

## Import

The data flow control policy can be imported using the `id`, e.g.

```bash
$ terraform import huaweicloud_iotda_data_flow_control_policy.test <id>
```
27 changes: 14 additions & 13 deletions huaweicloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1720,19 +1720,20 @@ func Provider() *schema.Provider {
"huaweicloud_images_image_share": ims.ResourceImsImageShare(),
"huaweicloud_images_image_share_accepter": ims.ResourceImsImageShareAccepter(),

"huaweicloud_iotda_access_credential": iotda.ResourceAccessCredential(),
"huaweicloud_iotda_amqp": iotda.ResourceAmqp(),
"huaweicloud_iotda_batchtask": iotda.ResourceBatchTask(),
"huaweicloud_iotda_dataforwarding_rule": iotda.ResourceDataForwardingRule(),
"huaweicloud_iotda_device": iotda.ResourceDevice(),
"huaweicloud_iotda_device_async_command": iotda.ResourceDeviceAsyncCommand(),
"huaweicloud_iotda_device_certificate": iotda.ResourceDeviceCertificate(),
"huaweicloud_iotda_device_group": iotda.ResourceDeviceGroup(),
"huaweicloud_iotda_device_linkage_rule": iotda.ResourceDeviceLinkageRule(),
"huaweicloud_iotda_device_proxy": iotda.ResourceDeviceProxy(),
"huaweicloud_iotda_product": iotda.ResourceProduct(),
"huaweicloud_iotda_space": iotda.ResourceSpace(),
"huaweicloud_iotda_upgrade_package": iotda.ResourceUpgradePackage(),
"huaweicloud_iotda_access_credential": iotda.ResourceAccessCredential(),
"huaweicloud_iotda_amqp": iotda.ResourceAmqp(),
"huaweicloud_iotda_batchtask": iotda.ResourceBatchTask(),
"huaweicloud_iotda_dataforwarding_rule": iotda.ResourceDataForwardingRule(),
"huaweicloud_iotda_data_flow_control_policy": iotda.ResourceDataFlowControlPolicy(),
"huaweicloud_iotda_device": iotda.ResourceDevice(),
"huaweicloud_iotda_device_async_command": iotda.ResourceDeviceAsyncCommand(),
"huaweicloud_iotda_device_certificate": iotda.ResourceDeviceCertificate(),
"huaweicloud_iotda_device_group": iotda.ResourceDeviceGroup(),
"huaweicloud_iotda_device_linkage_rule": iotda.ResourceDeviceLinkageRule(),
"huaweicloud_iotda_device_proxy": iotda.ResourceDeviceProxy(),
"huaweicloud_iotda_product": iotda.ResourceProduct(),
"huaweicloud_iotda_space": iotda.ResourceSpace(),
"huaweicloud_iotda_upgrade_package": iotda.ResourceUpgradePackage(),

"huaweicloud_kms_data_encrypt_decrypt": dew.ResourceKmsDataEncryptDecrypt(),
"huaweicloud_kms_key": dew.ResourceKmsKey(),
Expand Down
Loading
Loading