Skip to content

Commit

Permalink
docs: fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shanye997 committed Feb 2, 2024
1 parent fedf359 commit a878239
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 145 deletions.
17 changes: 11 additions & 6 deletions website/docs/r/cdn_domain_config.html.markdown
@@ -1,7 +1,7 @@
---
subcategory: "CDN"
layout: "alicloud"
page_title: "Alicloud: alicloud_cdn_doamin_config"
page_title: "Alicloud: alicloud_cdn_domain_config"
sidebar_current: "docs-alicloud-resource-cdn-domain-config"
description: |-
Provides a Alicloud Cdn domain config Resource.
Expand All @@ -13,16 +13,21 @@ Provides a CDN Accelerated Domain resource.

For information about domain config and how to use it, see [Batch set config](https://www.alibabacloud.com/help/zh/doc-detail/90915.htm)

-> **NOTE:** Available in v1.34.0+.
-> **NOTE:** Available since v1.34.0+.

## Example Usage

Basic Usage

```terraform
resource "random_integer" "default" {
min = 10000
max = 99999
}
# Create a new Domain config.
resource "alicloud_cdn_domain_new" "domain" {
domain_name = "mycdndomain.alicloud-provider.cn"
domain_name = "mycdndomain-${random_integer.default.result}.alicloud-provider.cn"
cdn_type = "web"
scope = "overseas"
sources {
Expand All @@ -49,9 +54,9 @@ The following arguments are supported:

* `domain_name` - (Required) Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix `.sh` and `.tel` are not supported.
* `function_name` - (Required) The name of the domain config.
* `function_args` - (Required, Type: list) The args of the domain config.
* `function_args` - (Required, Type: list) The args of the domain config. See [`function_args`](#function_args) below.

### Block function_args
### `function_args`

The `function_args` block supports the following:

Expand All @@ -69,7 +74,7 @@ The following attributes are exported:
## Import

CDN domain config can be imported using the id, e.g.
```
```shell
terraform import alicloud_cdn_domain_config.example <domain_name>:<function_name>:<config_id>
```

Expand Down
7 changes: 4 additions & 3 deletions website/docs/r/cdn_domain_new.html.markdown
Expand Up @@ -20,13 +20,14 @@ For information about CDN Domain and how to use it, see [What is Domain](https:/
Basic Usage

```terraform
variable "domain_name" {
default = "mycdndomain.alicloud-provider.cn"
resource "random_integer" "default" {
min = 10000
max = 99999
}
resource "alicloud_cdn_domain_new" "default" {
scope = "overseas"
domain_name = var.domain_name
domain_name = "mycdndomain-${random_integer.default.result}.alicloud-provider.cn"
cdn_type = "web"
sources {
type = "ipaddr"
Expand Down
23 changes: 12 additions & 11 deletions website/docs/r/cdn_real_time_log_delivery.html.markdown
Expand Up @@ -20,9 +20,14 @@ For information about CDN Real Time Log Delivery and how to use it, see [What is
Basic Usage

```terraform
resource "random_integer" "default" {
max = 99999
min = 10000
}
resource "alicloud_cdn_domain_new" "default" {
scope = "overseas"
domain_name = "mycdndomain.alicloud-provider.cn"
domain_name = "mycdndomain-${random_integer.default.result}.alicloud-provider.cn"
cdn_type = "web"
sources {
type = "ipaddr"
Expand All @@ -33,19 +38,15 @@ resource "alicloud_cdn_domain_new" "default" {
}
}
resource "random_integer" "default" {
max = 99999
min = 10000
}
resource "alicloud_log_project" "default" {
name = "terraform-example-${random_integer.default.result}"
description = "terraform-example"
project_name = "terraform-example-${random_integer.default.result}"
description = "terraform-example"
}
resource "alicloud_log_store" "default" {
project = alicloud_log_project.default.name
name = "example-store"
project_name = alicloud_log_project.default.name
logstore_name = "example-store"
shard_count = 3
auto_split = true
max_split_shard_count = 60
Expand All @@ -58,8 +59,8 @@ data "alicloud_regions" "default" {
resource "alicloud_cdn_real_time_log_delivery" "default" {
domain = alicloud_cdn_domain_new.default.domain_name
logstore = alicloud_log_project.default.name
project = alicloud_log_store.default.name
logstore = alicloud_log_store.default.logstore_name
project = alicloud_log_project.default.project_name
sls_region = data.alicloud_regions.default.regions.0.id
}
```
Expand Down
7 changes: 3 additions & 4 deletions website/docs/r/dbs_backup_plan.html.markdown
Expand Up @@ -20,6 +20,9 @@ For information about DBS Backup Plan and how to use it, see [What is Backup Pla
Basic Usage

```terraform
provider "alicloud" {
region = "cn-hangzhou"
}
variable "name" {
default = "terraform-example"
}
Expand All @@ -28,10 +31,6 @@ data "alicloud_resource_manager_resource_groups" "default" {
status = "OK"
}
data "alicloud_resource_manager_resource_groups" "default" {
status = "OK"
}
data "alicloud_db_zones" "default" {
engine = "MySQL"
engine_version = "8.0"
Expand Down
11 changes: 8 additions & 3 deletions website/docs/r/dcdn_kv.html.markdown
Expand Up @@ -21,17 +21,22 @@ Basic Usage

```terraform
variable "name" {
default = "tf-example"
default = "terraform-example"
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
resource "alicloud_dcdn_kv_namespace" "default" {
description = var.name
namespace = var.name
namespace = "${var.name}-${random_integer.default.result}"
}
resource "alicloud_dcdn_kv" "default" {
value = "example-value"
key = var.name
key = "${var.name}-${random_integer.default.result}"
namespace = alicloud_dcdn_kv_namespace.default.namespace
}
```
Expand Down
10 changes: 8 additions & 2 deletions website/docs/r/dcdn_kv_namespace.html.markdown
Expand Up @@ -21,11 +21,17 @@ Basic Usage

```terraform
variable "name" {
default = "tf-example"
default = "terraform-example"
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
resource "alicloud_dcdn_kv_namespace" "default" {
description = var.name
namespace = var.name
namespace = "${var.name}-${random_integer.default.result}"
}
```

Expand Down
13 changes: 8 additions & 5 deletions website/docs/r/dcdn_waf_rule.html.markdown
Expand Up @@ -24,9 +24,14 @@ variable "name" {
default = "tf_example"
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
resource "alicloud_dcdn_waf_policy" "example" {
defense_scene = "waf_group"
policy_name = var.name
policy_name = "${var.name}_${random_integer.default.result}"
policy_type = "custom"
status = "on"
}
Expand All @@ -45,10 +50,8 @@ resource "alicloud_dcdn_waf_rule" "example" {
op_value = "eq"
values = "b"
}
status = "on"
cc_status = "on"
action = "monitor"
effect = "rule"
status = "on"
action = "monitor"
rate_limit {
target = "IP"
interval = "5"
Expand Down
7 changes: 4 additions & 3 deletions website/docs/r/direct_mail_domain.html.markdown
Expand Up @@ -20,14 +20,15 @@ For information about Direct Mail Domain and how to use it, see [What is Domain]
Basic Usage

```terraform
variable "domain_name" {
default = "alicloud-provider.online"
resource "random_integer" "default" {
min = 10000
max = 99999
}
provider "alicloud" {
region = "cn-hangzhou"
}
resource "alicloud_direct_mail_domain" "example" {
domain_name = var.domain_name
domain_name = "alicloud-provider-${random_integer.default.result}.online"
}
```

Expand Down
6 changes: 5 additions & 1 deletion website/docs/r/dms_enterprise_proxy.html.markdown
Expand Up @@ -20,6 +20,10 @@ For information about DMS Enterprise Proxy and how to use it, see [What is Proxy
Basic Usage

```terraform
provider "alicloud" {
region = "cn-hangzhou"
}
variable "name" {
default = "tf-example"
}
Expand Down Expand Up @@ -90,7 +94,7 @@ resource "alicloud_db_account" "default" {
resource "alicloud_dms_enterprise_instance" "default" {
tid = data.alicloud_dms_user_tenants.default.ids.0
instance_type = "MySQL"
instance_type = "mysql"
instance_source = "RDS"
network_type = "VPC"
env_type = "dev"
Expand Down
14 changes: 9 additions & 5 deletions website/docs/r/dms_enterprise_proxy_access.html.markdown
Expand Up @@ -13,18 +13,22 @@ Provides a DMS Enterprise Proxy Access resource.

For information about DMS Enterprise Proxy Access and how to use it, see [What is Proxy Access](https://next.api.alibabacloud.com/document/dms-enterprise/2018-11-01/CreateProxyAccess).

-> **NOTE:** Available in v1.195.0+.
-> **NOTE:** Available since v1.195.0+.

## Example Usage

Basic Usage

```terraform
data "alicloud_dms_enterprise_users" "dms_enterprise_users_ds" {
role = "USER"
status = "NORMAL"
}
data "alicloud_dms_enterprise_proxies" "ids" {}
resource "alicloud_dms_enterprise_proxy_access" "default" {
indep_password = "PASSWORD-DEMO"
proxy_id = 1881
indep_account = "dmstest"
user_id = 104442
proxy_id = data.alicloud_dms_enterprise_proxies.ids.proxies.0.id
user_id = data.alicloud_dms_enterprise_users.dms_enterprise_users_ds.users.0.user_id
}
```

Expand Down
7 changes: 6 additions & 1 deletion website/docs/r/ecs_key_pair_attachment.html.markdown
Expand Up @@ -62,8 +62,13 @@ resource "alicloud_instance" "example" {
vswitch_id = alicloud_vswitch.example.id
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
resource "alicloud_ecs_key_pair" "example" {
key_pair_name = "tf-example"
key_pair_name = "tf-example-${random_integer.default.result}"
}
resource "alicloud_ecs_key_pair_attachment" "example" {
Expand Down
9 changes: 7 additions & 2 deletions website/docs/r/ess_scheduled_task.html.markdown
Expand Up @@ -22,6 +22,11 @@ variable "name" {
default = "terraform-example"
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
data "alicloud_zones" "default" {
available_disk_category = "cloud_efficiency"
available_resource_creation = "VSwitch"
Expand Down Expand Up @@ -70,7 +75,7 @@ resource "alicloud_security_group_rule" "default" {
resource "alicloud_ess_scaling_group" "default" {
min_size = 1
max_size = 1
scaling_group_name = var.name
scaling_group_name = "${var.name}-${random_integer.default.result}"
vswitch_ids = [alicloud_vswitch.default.id]
removal_policies = ["OldestInstance", "NewestInstance"]
}
Expand All @@ -93,7 +98,7 @@ resource "alicloud_ess_scaling_rule" "default" {
resource "alicloud_ess_scheduled_task" "default" {
scheduled_action = alicloud_ess_scaling_rule.default.ari
launch_time = formatdate("YYYY-MM-DD'T'hh:mm'Z'", timeadd(timestamp(), "24h"))
scheduled_task_name = var.name
scheduled_task_name = "${var.name}-${random_integer.default.result}"
}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/event_bridge_rule.html.markdown
Expand Up @@ -88,7 +88,7 @@ The param_list supports the following:

-> **NOTE:** There exists a potential diff error that the backend service will return a default param as following:

```terraform
```
param_list {
resource_key = "IsBase64Encode"
form = "CONSTANT"
Expand Down
8 changes: 6 additions & 2 deletions website/docs/r/fnf_execution.html.markdown
Expand Up @@ -7,19 +7,23 @@ description: |-
Provides a Alicloud Serverless Workflow Execution resource.
---

# alicloud\_fnf\_execution
# alicloud_fnf_execution

Provides a Serverless Workflow Execution resource.

For information about Serverless Workflow Execution and how to use it, see [What is Execution](https://www.alibabacloud.com/help/en/doc-detail/122628.html).

-> **NOTE:** Available in v1.149.0+.
-> **NOTE:** Available since v1.149.0+.

## Example Usage

Basic Usage

```terraform
provider "alicloud" {
region = "cn-shanghai"
}
variable "name" {
default = "tf-testacc-fnfflow"
}
Expand Down
8 changes: 6 additions & 2 deletions website/docs/r/fnf_flow.html.markdown
Expand Up @@ -7,19 +7,23 @@ description: |-
Provides a Alicloud Serverless Workflow Flow resource.
---

# alicloud\_fnf\_flow
# alicloud_fnf_flow

Provides a Serverless Workflow Flow resource.

For information about Serverless Workflow Flow and how to use it, see [What is Flow](https://www.alibabacloud.com/help/en/doc-detail/123079.htm).

-> **NOTE:** Available in v1.105.0+.
-> **NOTE:** Available since v1.105.0+.

## Example Usage

Basic Usage

```terraform
provider "alicloud" {
region = "cn-shanghai"
}
resource "alicloud_ram_role" "default" {
name = "tf-testacc-fnfflow"
document = <<EOF
Expand Down

0 comments on commit a878239

Please sign in to comment.