Skip to content

Commit

Permalink
feat(apig): add apig_groups data source
Browse files Browse the repository at this point in the history
  • Loading branch information
Zippo-Wang authored and liwanting0517 committed Dec 25, 2023
1 parent 77df0f2 commit df9b5a3
Show file tree
Hide file tree
Showing 12 changed files with 1,452 additions and 7 deletions.
123 changes: 123 additions & 0 deletions docs/data-sources/apig_groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
subcategory: "API Gateway (Dedicated APIG)"
---

# flexibleengine_apig_groups

Use this data source to query and filter the group list under the APIG instance within Flexibleengine.

## Example Usage

```hcl
variable "instance_id" {}
variable "group_name" {}
data "flexibleengine_apig_groups" "test" {
instance_id = var.instance_id
name = var.group_name
}
```

## Argument Reference

The following arguments are supported:

* `region` - (Optional, String) Specifies the region in which to query the API group list.
If omitted, the provider-level region will be used.

* `instance_id` - (Required, String) Specifies an ID of the APIG dedicated instance to which the API group belongs.

* `group_id` - (Optional, String) Specifies the API group ID used to query.

* `name` - (Optional, String) Specifies the API group name used to query.

## Attribute Reference

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

* `id` - Data source ID.

* `groups` - All groups that match the filter parameters.
The [groups](#APIG_Groups) structure is documented below.

<a name="APIG_Groups"></a>
The `groups` block supports:

* `id` - The API group ID.

* `name` - The API group name.

* `status` - The current status of the API group.
The valid values are as follows:
+ **1**: Normal.

* `sl_domain` - The subdomain name assigned by the system by default.

* `created_at` - The creation time of the API group.

* `updated_at` - The latest update time of the API group.

* `on_sell_status` - Whether it has been listed on the cloud store.
The valid values are as follows:
+ **1**: Listed.
+ **2**: Not listed.
+ **3**: Under review.

* `url_domains` - List of independent domains bound on the API group.
The [url_domains](#APIG_Groups_urlDomains) structure is documented below.

* `sl_domains` - List of subdomain names assigned by the system by default.

* `description` - The description of the API group.

* `is_default` - Indicates whether the API group is the default group.

* `environment` - The array of one or more environments of the API group.
The [environment](#APIG_Groups_environment_attr) structure is documented below.

<a name="APIG_Groups_urlDomains"></a>
The `url_domains` block supports:

* `id` - The domain ID.

* `name` - The domain name.

* `cname_status` - CNAME resolution status of the domain name.
The valid values are as follows:
+ **1**: Not resolved.
+ **2**: Resolving.
+ **3**: Resolved.
+ **4**: Resolution failed.

* `ssl_id` - The SSL certificate ID.

* `ssl_name` - The SSL certificate name.

* `min_ssl_version` - Minimum SSL version. The default is **TLSv1.1**.
The valid values are as follows:
+ **TLSv1.1**
+ **TLSv1.2**

* `verified_client_certificate_enabled` - Whether to enable client certificate verification.
This parameter is available only when a certificate is bound. It is enabled by default if trusted_root_ca exists,
and disabled if trusted_root_ca does not exist. The default is **false**.

* `is_has_trusted_root_ca` - Whether a trusted root certificate (CA) exists. The value is true
if trusted_root_ca exists in the bound certificate. The default is **false**.

<a name="APIG_Groups_environment_attr"></a>
The `environment` block supports:

* `variable` - The array of one or more environment variables.
The [variable](#APIG_Groups_environment_variable_attr) structure is documented below.

* `environment_id` - The ID of the environment to which the variables belong.

<a name="APIG_Groups_environment_variable_attr"></a>
The `variable` block supports:

* `name` - The variable name.

* `value` - The variable value.

* `id` - The variable ID.
116 changes: 116 additions & 0 deletions docs/data-sources/dds_instances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
subcategory: "Document Database Service (DDS)"
---

# flexibleengine_dds_instances

Use this data source to get the list of DDS instances.

## Example Usage

```hcl
variable "vpc_id" {}
variable "subnet_id" {}
data "flexibleengine_dds_instances" "test" {
name = "test_name"
mode = "Sharding"
vpc_id = var.vpc_id
subnet_id = var.subnet_id
}
```

## Argument Reference

The following arguments are supported:

* `region` - (Optional, String) Specifies the region in which to query the data source. If omitted, the provider-level
region will be used.

* `name` - (Optional, String) Specifies the DB instance name.

* `mode` - (Optional, String) Specifies the mode of the database instance.

* `vpc_id` - (Optional, String) Specifies the VPC ID.

* `subnet_id` - (Optional, String) Specifies the subnet Network ID.

## Attribute Reference

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

* `id` - The resource ID.

* `instances` - Indicates the list of DDS instances.
The [instances](#dds_instances) object structure is documented below.

<a name="dds_instances"></a>
The `instances` block supports:

* `id` - Indicates the ID of the instance.

* `name` - Indicates the DB instance name.

* `ssl` - Indicates whether to enable or disable SSL.

* `port` - Indicates the database port number. The port range is 2100 to 9500.

* `datastore` - Indicates database information.
The [datastore](#dds_datastore) object structure is documented below.

* `backup_strategy` - Indicates backup strategy.
The [backup_strategy](#dds_backup_strategy) object structure is documented below.

* `vpc_id` - Indicates the VPC ID.

* `subnet_id` - Indicates the subnet Network ID.

* `security_group_id` - Indicates the security group ID of the DDS instance.

* `disk_encryption_id` - Indicates the disk encryption ID of the instance.

* `mode` - Specifies the mode of the database instance.

* `db_username` - Indicates the DB Administrator name.

* `status` - Indicates the DB instance status.

* `enterprise_project_id` - Indicates the enterprise project id of the dds instance.

* `nodes` - Indicates the instance nodes information.
The [nodes](#dds_nodes) object structure is documented below.

* `tags` - Indicates the key/value pairs to associate with the DDS instance.

<a name="dds_datastore"></a>
The `datastore` block supports:

* `type` - Indicates the DB engine.

* `version` - Indicates the DB instance version.

* `storage_engine` - Indicates the storage engine of the DB instance.

<a name="dds_backup_strategy"></a>
The `backup_strategy` block supports:

* `start_time` - Indicates the backup time window.

* `keep_days` - Indicates the number of days to retain the generated backup files.

<a name="dds_nodes"></a>
The `nodes` block supports:

* `id` - Indicates the node ID.

* `name` - Indicates the node name.

* `role` - Indicates the node role.

* `type` - Indicates the node type.

* `private_ip` - Indicates the private IP address of a node.

* `public_ip` - Indicates the EIP that has been bound on a node.

* `status` - Indicates the node status.
62 changes: 62 additions & 0 deletions docs/resources/dds_audit_log_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
subcategory: "Document Database Service (DDS)"
---

# flexibleengine_dds_audit_log_policy

Manages a DDS audit log policy resource within FlexibleEngine.

## Example Usage

```hcl
variable "instance_id" {}
variable "keep_days" {}
resource "flexibleengine_dds_audit_log_policy" "test"{
instance_id = var.instance_id
keep_days = var.keep_days
}
```

## 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.

* `instance_id` - (Required, String, ForceNew) Specifies the ID of the DDS instance.

Changing this parameter will create a new resource.

* `keep_days` - (Required, Int) Specifies the number of days for storing audit logs. The value ranges from 7 to 732.

* `audit_scope` - (Optional, String) Specifies the audit scope.
If this parameter is left blank or set to **all**, all audit log policies are enabled.
You can enter the database or collection name. Use commas (,) to separate multiple databases
or collections. If the name contains a comma (,), add a dollar sign ($) before the comma
to distinguish it from the separators. Enter a maximum of 1024 characters. The value
cannot contain spaces or the following special characters "[]{}():? The dollar sign ($)
can be used only in escape mode.

* `audit_types` - (Optional, List) Specifies the audit type. The value is **auth**, **insert**, **delete**, **update**,
**query** or **command**.

* `reserve_auditlogs` - (Optional, String) Specifies whether the historical audit logs are
retained when SQL audit is disabled.
+ **true**: indicates that historical audit logs are retained when SQL audit is disabled.(default value)
+ **false**: indicates that existing historical audit logs are deleted when SQL audit is disabled.

## Attribute Reference

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

* `id` - The resource ID.

## Import

The DDS audit log policy can be imported using the instance ID, e.g.:

```shell
terraform import flexibleengine_dds_audit_log_policy.test <instance_id>
```
85 changes: 85 additions & 0 deletions docs/resources/dds_backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
subcategory: "Document Database Service (DDS)"
---

# flexibleengine_dds_backup

Manages a DDS backup resource within FlexibleEngine.

## Example Usage

```hcl
variable "dds_instance_id" {}
variable "name" {}
resource "flexibleengine_dds_backup" "test"{
instance_id = var.dds_instance_id
name = var.name
}
```

## 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.

* `instance_id` - (Required, String, ForceNew) Specifies the ID of a DDS instance.
Changing this parameter will create a new resource.

* `name` - (Required, String, ForceNew) Specifies the manual backup name.
The value must be 4 to 64 characters in length and start with a letter (from A to Z or from a to z).
It is case-sensitive and can contain only letters, digits (from 0 to 9), hyphens (-), and underscores (_).
Changing this parameter will create a new resource.

* `description` - (Optional, String, ForceNew) Specifies the manual backup description.
Changing this parameter will create a new resource.

## Attribute Reference

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

* `id` - The resource ID.

* `instance_name` - Indicates the name of a DDS instance.

* `datastore` - Indicates the database version.
The [datastore](#dds_datastore) object structure is documented below.

* `type` - Indicates the backup type. Valid value:
+ **Manual**: indicates manual full backup.

* `begin_time` - Indicates the start time of the backup. The format is yyyy-mm-dd hh:mm:ss. The value is in UTC format.

* `end_time` - Indicates the end time of the backup. The format is yyyy-mm-dd hh:mm:ss. The value is in UTC format.

* `status` - Indicates the backup status. Valid value:
+ **BUILDING**: Backup in progress.
+ **COMPLETED**: Backup completed.
+ **FAILED**: Backup failed.
+ **DISABLED**: Backup being deleted.

* `size` - Indicates the backup size in KB.

<a name="dds_datastore"></a>
The `datastore` block supports:

* `type` - Indicates the DB engine.

* `version` - Indicates the database version. The value can be **4.2**, **4.0**, or **3.4**.

## Timeouts

This resource provides the following timeouts configuration options:

* `create` - Default is 30 minutes.
* `delete` - Default is 10 minutes.

## Import

The DDS backup can be imported using the instance ID and the backup ID separated by a slash, e.g.:

```shell
terraform import flexibleengine_dds_backup.test 6fb8b99944c7459da32f751f0edea756br02/0ce123456a00f2591fabc00385ff1234
```
Loading

0 comments on commit df9b5a3

Please sign in to comment.