Skip to content

Commit bccdd26

Browse files
authored
Feat/example sms (#1978)
* example readjust: tencentcloud_kubernetes_serverless_node_pool * add pre-commit-local * adjust e2e case * update example
1 parent 39dbace commit bccdd26

File tree

11 files changed

+94
-39
lines changed

11 files changed

+94
-39
lines changed

.githooks/pre-commit-local

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
REQUIRED_GO_VERSION="1.18" # use the .go-version later
3+
4+
printf "==> Step 1: Gofmt Check...\n"
5+
make fmt-faster
6+
if [ $? -ne 0 ]; then
7+
printf "COMMIT FAILED\n"
8+
exit 1
9+
fi
10+
11+
printf "==> Step 2: Generating docs...\n"
12+
doc=$(make doc 2>&1)
13+
if [ $? -ne 0 ]; then
14+
echo "$doc" | tail -n 4 | head -n 2
15+
printf "COMMIT FAILED\n"
16+
exit 1
17+
fi
18+
19+
printf "==> Step 2: Generating docs...\n"
20+
go_version=$(go version | awk '{print $3}')
21+
if [ $go_version -ne $REQUIRED_GO_VERSION* ]; then
22+
echo "Go version is not compatible. Expected $REQUIRED_GO_VERSION.x"
23+
printf "COMMIT FAILED\n"
24+
exit 1
25+
fi
26+
27+
printf "COMMIT READY\n"
28+
exit 0

examples/tencentcloud-sms/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "tencentcloud_sms_sign" "example" {
2+
sign_name = "tf_example_sms_sign"
3+
sign_type = 1 # 1:APP, DocumentType can be chosen(0,1,2,3,4)
4+
document_type = 4 # Screenshot of application background management (personally developed APP)
5+
international = 0 # Mainland China SMS
6+
sign_purpose = 0 # personal use
7+
proof_image = "your_proof_image"
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "availability_zone" {
2+
default = "ap-guangzhou-3"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
terraform {
2+
required_version = ">= 0.12"
3+
}

tencentcloud/data_source_tc_tcr_replication_instance_create_tasks_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package tencentcloud
22

33
import (
4+
"fmt"
45
"testing"
56

67
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -13,8 +14,8 @@ func TestAccTencentCloudTcrReplicationInstanceCreateTasksDataSource_basic(t *tes
1314
Providers: testAccProviders,
1415
Steps: []resource.TestStep{
1516
{
16-
// Config: fmt.Sprintf(testAccTcrReplicationInstance_create_tasks_and_sync_status_DataSource, "create-tasks-and-sync-status", time.Now().Nanosecond()),
17-
Config: testAccTcrReplicationInstance_create_tasks_and_sync_status_DataSource,
17+
Config: fmt.Sprintf(testAccTcrReplicationInstance_create_tasks_and_sync_status_DataSource, defaultTCRInstanceId, "tcr-aoz8mxoz-1-kkircm"),
18+
// Config: testAccTcrReplicationInstance_create_tasks_and_sync_status_DataSource,
1819
PreConfig: func() {
1920
testAccStepSetRegion(t, "ap-shanghai")
2021
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
@@ -62,8 +63,8 @@ const testAccTcrReplicationInstance_create_tasks_and_sync_status_DataSource = `
6263
// dst_region_id = tencentcloud_tcr_manage_replication_operation.my_replica.destination_region_id
6364
// }
6465
locals {
65-
src_registry_id = "tcr-800uf6j9"
66-
dst_registry_id = "tcr-800uf6j9-1-cgeafk"
66+
src_registry_id = "%s"
67+
dst_registry_id = "%s"
6768
dst_region_id = 1
6869
}
6970

tencentcloud/resource_tc_ses_template.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/*
2-
Provides a resource to create a ses template
2+
Provides a resource to create a ses template.
33
44
Example Usage
55
6+
Create a ses template instance
7+
68
```hcl
7-
resource "tencentcloud_ses_template" "template" {
8-
template_name = "sesTemplateName"
9+
resource "tencentcloud_ses_template" "example" {
10+
template_name = "tf_example_ses_temp""
911
template_content {
10-
text = "This is the content of the test"
12+
text = "example for the ses template"
1113
}
1214
}
1315
@@ -16,7 +18,7 @@ Import
1618
1719
ses template can be imported using the id, e.g.
1820
```
19-
$ terraform import tencentcloud_ses_template.template template_id
21+
$ terraform import tencentcloud_ses_template.example template_id
2022
```
2123
*/
2224
package tencentcloud

tencentcloud/resource_tc_sms_sign.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ Provides a resource to create a sms sign
33
44
Example Usage
55
6+
Create a sms sign instance
7+
68
```hcl
7-
resource "tencentcloud_sms_sign" "sign" {
8-
sign_name = "terraform"
9-
sign_type = 1
10-
document_type = 4
11-
international = 0
12-
sign_purpose = 0
13-
proof_image = "dGhpcyBpcyBhIGV4YW1wbGU="
9+
resource "tencentcloud_sms_sign" "example" {
10+
sign_name = "tf_example_sms_sign"
11+
sign_type = 1 # 1:APP, DocumentType can be chosen(0,1,2,3,4)
12+
document_type = 4 # Screenshot of application background management (personally developed APP)
13+
international = 0 # Mainland China SMS
14+
sign_purpose = 0 # personal use
15+
proof_image = "your_proof_image"
1416
}
1517
```
1618

tencentcloud/resource_tc_sms_template.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ Provides a resource to create a sms template
33
44
Example Usage
55
6+
Create a sms template
7+
68
```hcl
79
resource "tencentcloud_sms_template" "template" {
8-
template_name = "Template By Terraform"
9-
template_content = "Template Content"
10-
international = 0
11-
sms_type = 0
12-
remark = "terraform test"
10+
template_name = "tf_example_sms_template"
11+
template_content = "example for sms template"
12+
international = 0 # Mainland China SMS
13+
sms_type = 0 # regular SMS
14+
remark = "terraform example"
1315
}
1416
1517
```

website/docs/r/ses_template.html.markdown

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_ses_template"
55
sidebar_current: "docs-tencentcloud-resource-ses_template"
66
description: |-
7-
Provides a resource to create a ses template
7+
Provides a resource to create a ses template.
88
---
99

1010
# tencentcloud_ses_template
1111

12-
Provides a resource to create a ses template
12+
Provides a resource to create a ses template.
1313

1414
## Example Usage
1515

16+
### Create a ses template instance
17+
1618
```hcl
17-
resource "tencentcloud_ses_template" "template" {
18-
template_name = "sesTemplateName"
19+
resource "tencentcloud_ses_template" "example" {
20+
template_name = "tf_example_ses_temp" "
1921
template_content {
20-
text = "This is the content of the test"
22+
text = " example for the ses template "
2123
}
2224
}
2325
```
@@ -46,6 +48,6 @@ In addition to all arguments above, the following attributes are exported:
4648

4749
ses template can be imported using the id, e.g.
4850
```
49-
$ terraform import tencentcloud_ses_template.template template_id
51+
$ terraform import tencentcloud_ses_template.example template_id
5052
```
5153

website/docs/r/sms_sign.html.markdown

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ Provides a resource to create a sms sign
1313

1414
## Example Usage
1515

16+
### Create a sms sign instance
17+
1618
```hcl
17-
resource "tencentcloud_sms_sign" "sign" {
18-
sign_name = "terraform"
19-
sign_type = 1
20-
document_type = 4
21-
international = 0
22-
sign_purpose = 0
23-
proof_image = "dGhpcyBpcyBhIGV4YW1wbGU="
19+
resource "tencentcloud_sms_sign" "example" {
20+
sign_name = "tf_example_sms_sign"
21+
sign_type = 1 # 1:APP, DocumentType can be chosen(0,1,2,3,4)
22+
document_type = 4 # Screenshot of application background management (personally developed APP)
23+
international = 0 # Mainland China SMS
24+
sign_purpose = 0 # personal use
25+
proof_image = "your_proof_image"
2426
}
2527
```
2628

0 commit comments

Comments
 (0)