Skip to content

Commit ad2928f

Browse files
lsy1968shanye997
authored andcommitted
201-use-case-cdn-accelerate-resource-from-ecs
1 parent 915ec0b commit ad2928f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

quickstarts/CDN/201-use-case-cdn-accelerate-resource-from-ecs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ No modules.
4141
| Name | Description | Type | Default | Required |
4242
|------|-------------|------|---------|:--------:|
4343
| <a name="input_creater_ecs"></a> [creater\_ecs](#input\_creater\_ecs) | Do you want to create a ECS instance | `bool` | `true` | no |
44-
| <a name="input_domain_home"></a> [domain\_home](#input\_domain\_home) | your domain name | `string` | `"Change to your domain name"` | no |
45-
| <a name="input_existed_ecs_address"></a> [existed\_ecs\_address](#input\_existed\_ecs\_address) | The address of your existed ecs | `string` | `""` | no |
46-
| <a name="input_existed_ecs_port"></a> [existed\_ecs\_port](#input\_existed\_ecs\_port) | The port of your existed ecs | `string` | `""` | no |
44+
| <a name="input_domain_home"></a> [domain\_home](#input\_domain\_home) | your domain name | `string` | `"tf-example.com"` | no |
45+
| <a name="input_existed_ecs_ip"></a> [existed\_ecs\_ip](#input\_existed\_ecs\_ip) | The ip of your existed ecs | `string` | `""` | no |
46+
| <a name="input_host_record"></a> [host\_record](#input\_host\_record) | Host Record,like image | `string` | `"image"` | no |
4747
| <a name="input_region"></a> [region](#input\_region) | n/a | `string` | `"cn-beijing"` | no |
4848
<!-- END_TF_DOCS -->
4949

quickstarts/CDN/201-use-case-cdn-accelerate-resource-from-ecs/main.tf

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ variable "region" {
44

55
# 域名(改为您的域名)
66
variable "domain_home" {
7-
default = "Change to your domain name"
7+
default = "tf-example.com"
88
description = "your domain name"
99
}
1010

11+
# 主机记录
12+
variable "host_record" {
13+
type = string
14+
default = "image"
15+
description = "Host Record,like image"
16+
}
17+
1118
# 是否创建ECS
1219
variable "creater_ecs" {
1320
default = true
1421
type = bool
1522
description = "Do you want to create a ECS instance"
1623
}
1724

18-
# ECS地址
19-
variable "existed_ecs_address" {
20-
default = ""
21-
type = string
22-
description = "The address of your existed ecs "
23-
}
24-
25-
# ECS端口
26-
variable "existed_ecs_port" {
25+
# 已有ECS地址
26+
variable "existed_ecs_ip" {
2727
default = ""
2828
type = string
29-
description = "The port of your existed ecs "
29+
description = "The ip of your existed ecs "
3030
}
3131

3232
locals {
@@ -61,7 +61,7 @@ resource "alicloud_vpc" "vpc" {
6161

6262
resource "alicloud_security_group" "group" {
6363
count = var.creater_ecs ? 1 : 0
64-
security_group_name = "test_${random_integer.default.result}"
64+
security_group_name = "tf_test_${random_integer.default.result}"
6565
vpc_id = alicloud_vpc.vpc.0.id
6666
}
6767

@@ -109,7 +109,7 @@ resource "alicloud_cdn_domain_new" "example" {
109109
cdn_type = "web"
110110
scope = "overseas"
111111
sources {
112-
content = var.creater_ecs ? alicloud_instance.instance.0.public_ip : var.existed_ecs_address
112+
content = var.creater_ecs ? alicloud_instance.instance.0.public_ip : var.existed_ecs_ip
113113
type = "ipaddr"
114114
priority = "20"
115115
port = 80
@@ -120,7 +120,7 @@ resource "alicloud_cdn_domain_new" "example" {
120120
resource "alicloud_alidns_record" "example" {
121121
domain_name = var.domain_home
122122
type = "CNAME"
123-
rr = "image"
123+
rr = var.host_record
124124
value = alicloud_cdn_domain_new.example.cname
125125
ttl = 600
126126
}

0 commit comments

Comments
 (0)