Skip to content

Commit 50bc9a3

Browse files
authored
Merge pull request #519 from ttomzhou/master
api gateway
2 parents 04e557e + 726e83f commit 50bc9a3

File tree

72 files changed

+17367
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+17367
-61
lines changed

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
1-
## 1.45.4 (Unreleased)
1+
## 1.46.0 (Unreleased)
2+
3+
FEATURES:
4+
5+
* **New Resource**: `tencentcloud_api_gateway_api`
6+
* **New Resource**: `tencentcloud_api_gateway_service`
7+
* **New Resource**: `tencentcloud_api_gateway_custom_domain`
8+
* **New Resource**: `tencentcloud_api_gateway_usage_plan`
9+
* **New Resource**: `tencentcloud_api_gateway_usage_plan_attachment`
10+
* **New Resource**: `tencentcloud_api_gateway_ip_strategy`
11+
* **New Resource**: `tencentcloud_api_gateway_strategy_attachment`
12+
* **New Resource**: `tencentcloud_api_gateway_api_key`
13+
* **New Resource**: `tencentcloud_api_gateway_api_key_attachment`
14+
* **New Resource**: `tencentcloud_api_gateway_service_release`
15+
* **New Data Source**: `tencentcloud_api_gateway_apis`
16+
* **New Data Source**: `tencentcloud_api_gateway_services`
17+
* **New Data Source**: `tencentcloud_api_gateway_throttling_apis`
18+
* **New Data Source**: `tencentcloud_api_gateway_throttling_services`
19+
* **New Data Source**: `tencentcloud_api_gateway_usage_plans`
20+
* **New Data Source**: `tencentcloud_api_gateway_ip_strategies`
21+
* **New Data Source**: `tencentcloud_api_gateway_customer_domains`
22+
* **New Data Source**: `tencentcloud_api_gateway_usage_plan_environments`
23+
* **New Data Source**: `tencentcloud_api_gateway_api_keys`
24+
225
## 1.45.3 (October 21, 2020)
326

427
BUG FIXES:
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
resource "tencentcloud_api_gateway_api_key" "test" {
2+
secret_name = var.secret_name
3+
status = var.status
4+
}
5+
6+
resource "tencentcloud_api_gateway_service" "service" {
7+
service_name = var.service_name
8+
protocol = var.protocol
9+
service_desc = var.service_desc
10+
net_type = ["INNER", "OUTER"]
11+
ip_version = var.ip_version
12+
release_limit = 100
13+
pre_limit = 100
14+
test_limit = 100
15+
}
16+
17+
resource "tencentcloud_api_gateway_api" "api" {
18+
service_id = tencentcloud_api_gateway_service.service.id
19+
api_name = var.api_name
20+
api_desc = var.api_desc
21+
auth_type = "SECRET"
22+
protocol = "HTTP"
23+
enable_cors = true
24+
request_config_path = "/user/info"
25+
request_config_method = "POST"
26+
27+
request_parameters {
28+
name = "email"
29+
position = "QUERY"
30+
type = "string"
31+
desc = "your email please?"
32+
default_value = "[email protected]"
33+
required = true
34+
}
35+
service_config_type = "HTTP"
36+
service_config_timeout = 10
37+
service_config_url = "http://www.tencent.com"
38+
service_config_path = "/user"
39+
service_config_method = "POST"
40+
response_type = "XML"
41+
response_success_example = "<note>success</note>"
42+
response_fail_example = "<note>fail</note>"
43+
response_error_codes {
44+
code = 10
45+
msg = "system error"
46+
desc = "system error code"
47+
converted_code = -10
48+
need_convert = true
49+
}
50+
51+
release_limit = 100
52+
pre_limit = 100
53+
test_limit = 100
54+
}
55+
56+
resource "tencentcloud_api_gateway_custom_domain" "foo" {
57+
service_id = "service-ohxqslqe"
58+
sub_domain = "tic-test.dnsv1.com"
59+
protocol = "http"
60+
net_type = "OUTER"
61+
is_default_mapping = "false"
62+
default_domain = "service-ohxqslqe-1259649581.gz.apigw.tencentcs.com"
63+
path_mappings = ["/good#test","/root#release"]
64+
}
65+
66+
resource "tencentcloud_api_gateway_ip_strategy" "test"{
67+
service_id = tencentcloud_api_gateway_service.service.id
68+
strategy_name = var.strategy_name
69+
strategy_type = "BLACK"
70+
strategy_data = "9.9.9.9"
71+
}
72+
73+
resource "tencentcloud_api_gateway_api_key_attachment" "attach" {
74+
api_key_id = tencentcloud_api_gateway_api_key.test.id
75+
usage_plan_id = tencentcloud_api_gateway_usage_plan.plan.id
76+
}
77+
78+
resource "tencentcloud_api_gateway_usage_plan" "plan" {
79+
usage_plan_name = var.usage_plan_name
80+
usage_plan_desc = var.usage_plan_desc
81+
max_request_num = 100
82+
max_request_num_pre_sec = 10
83+
}
84+
85+
resource "tencentcloud_api_gateway_usage_plan_attachment" "attach_service" {
86+
usage_plan_id = tencentcloud_api_gateway_usage_plan.plan.id
87+
service_id = tencentcloud_api_gateway_service.service.id
88+
environment = "test"
89+
bind_type = "SERVICE"
90+
}
91+
92+
resource "tencentcloud_api_gateway_service_release" "service" {
93+
service_id = tencentcloud_api_gateway_api.api.service_id
94+
environment_name = "release"
95+
release_desc = var.release_desc
96+
}
97+
98+
resource "tencentcloud_api_gateway_strategy_attachment" "test"{
99+
service_id = tencentcloud_api_gateway_service_release.service.service_id
100+
strategy_id = tencentcloud_api_gateway_ip_strategy.test.strategy_id
101+
environment_name = "release"
102+
bind_api_id = tencentcloud_api_gateway_api.api.id
103+
}
104+
105+
data "tencentcloud_api_gateway_api_keys" "name" {
106+
secret_name = tencentcloud_api_gateway_api_key.test.secret_name
107+
}
108+
109+
data "tencentcloud_api_gateway_api_keys" "id" {
110+
api_key_id = tencentcloud_api_gateway_api_key.test.id
111+
}
112+
113+
data "tencentcloud_api_gateway_apis" "id" {
114+
service_id = tencentcloud_api_gateway_service.service.id
115+
api_id = tencentcloud_api_gateway_api.api.id
116+
}
117+
118+
data "tencentcloud_api_gateway_apis" "name" {
119+
service_id = tencentcloud_api_gateway_service.service.id
120+
api_name = tencentcloud_api_gateway_api.api.api_name
121+
}
122+
123+
data "tencentcloud_api_gateway_customer_domains" "id" {
124+
service_id = tencentcloud_api_gateway_custom_domain.foo.service_id
125+
}
126+
127+
data "tencentcloud_api_gateway_ip_strategies" "id" {
128+
service_id = tencentcloud_api_gateway_ip_strategy.test.service_id
129+
}
130+
131+
data "tencentcloud_api_gateway_ip_strategies" "name" {
132+
service_id = tencentcloud_api_gateway_ip_strategy.test.service_id
133+
strategy_name = tencentcloud_api_gateway_ip_strategy.test.strategy_name
134+
}
135+
136+
data "tencentcloud_api_gateway_services" "name" {
137+
service_name = tencentcloud_api_gateway_service.service.service_name
138+
}
139+
140+
data "tencentcloud_api_gateway_services" "id" {
141+
service_id = tencentcloud_api_gateway_service.service.id
142+
}
143+
144+
data "tencentcloud_api_gateway_throttling_apis" "id" {
145+
service_id = tencentcloud_api_gateway_service.service.id
146+
}
147+
148+
data "tencentcloud_api_gateway_throttling_apis" "foo" {
149+
service_id = tencentcloud_api_gateway_service.service.id
150+
environment_names = ["release", "test"]
151+
}
152+
153+
data "tencentcloud_api_gateway_throttling_services" "id" {
154+
service_id = tencentcloud_api_gateway_service.service.id
155+
}
156+
157+
data "tencentcloud_api_gateway_usage_plan_environments" "environment_test" {
158+
usage_plan_id = tencentcloud_api_gateway_usage_plan_attachment.attach_service.usage_plan_id
159+
bind_type = "SERVICE"
160+
}
161+
162+
data "tencentcloud_api_gateway_usage_plans" "name" {
163+
usage_plan_name = tencentcloud_api_gateway_usage_plan.plan.usage_plan_name
164+
}
165+
166+
data "tencentcloud_api_gateway_usage_plans" "id" {
167+
usage_plan_id = tencentcloud_api_gateway_usage_plan.plan.id
168+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
variable "secret_name" {
2+
default = "my_api_key"
3+
}
4+
5+
variable "status" {
6+
default = "on"
7+
}
8+
9+
variable "service_name" {
10+
default = "ck"
11+
}
12+
13+
variable "protocol" {
14+
default = "http&https"
15+
}
16+
17+
variable "service_desc" {
18+
default = "your nice service"
19+
}
20+
21+
variable "ip_version" {
22+
default = "IPv4"
23+
}
24+
25+
variable "api_name" {
26+
default = "hello"
27+
}
28+
29+
variable "api_desc" {
30+
default = "my hello api"
31+
}
32+
33+
variable "strategy_name" {
34+
default = "tf_test"
35+
}
36+
37+
variable "usage_plan_name" {
38+
default = "my_plan"
39+
}
40+
41+
variable "usage_plan_desc" {
42+
default = "nice plan"
43+
}
44+
45+
variable "release_desc" {
46+
default = "test service release"
47+
}
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+
}

examples/tencentcloud-vod/version.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
terraform {
2-
required_version = ">= 0.12"
1+
terraform {
2+
required_version = ">= 0.12"
33
}

0 commit comments

Comments
 (0)