Skip to content

Commit 276325f

Browse files
committed
fix examples
1 parent 806f1b0 commit 276325f

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ terraform-alicloud-alb-http
2828
```hcl
2929
module "example" {
3030
create = true
31-
source = "../.."
31+
source = "terraform-alicloud-modules/alb-http/alicloud"
3232
vpc_id = alicloud_vpc.default.id
3333
address_type = "Internet"
3434
address_allocated_mode = "Fixed"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ These types of resources are supported:
3232
```hcl
3333
module "example" {
3434
create = true
35-
source = "../.."
35+
source = "terraform-alicloud-modules/alb-http/alicloud"
3636
vpc_id = alicloud_vpc.default.id
3737
address_type = "Internet"
3838
address_allocated_mode = "Fixed"

examples/complete/main.tf

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ resource "alicloud_vswitch" "vswitch_2" {
1919
vswitch_name = var.vswitch_name_2
2020
}
2121

22+
resource "random_integer" "default" {
23+
max = 99999
24+
min = 10000
25+
}
26+
2227
resource "alicloud_log_project" "default" {
23-
name = var.log_project_name
24-
description = "created by terraform"
28+
project_name = "${var.log_project_name}-${random_integer.default.result}"
29+
description = "created by terraform"
2530
}
2631

2732
resource "alicloud_log_store" "default" {
28-
project = alicloud_log_project.default.name
29-
name = var.log_store_name
33+
project_name = alicloud_log_project.default.project_name
34+
logstore_name = "${var.log_store_name}-${random_integer.default.result}"
3035
shard_count = 3
3136
auto_split = true
3237
max_split_shard_count = 60
@@ -42,12 +47,12 @@ module "example" {
4247
address_allocated_mode = "Fixed"
4348
load_balancer_name = "tf_alb_name"
4449
load_balancer_edition = "Basic"
45-
zone_mappings = [
50+
zone_mappings = [
4651
{ vswitch_id = alicloud_vswitch.vswitch_1.id, zone_id = data.alicloud_alb_zones.default.zones.0.id },
4752
{ vswitch_id = alicloud_vswitch.vswitch_2.id, zone_id = data.alicloud_alb_zones.default.zones.1.id }
4853
]
4954
access_log_config = [
50-
{ log_project = alicloud_log_project.default.name, log_store = alicloud_log_store.default.name }
55+
{ log_project = alicloud_log_project.default.project_name, log_store = alicloud_log_store.default.logstore_name }
5156
]
5257
acl_name = "tf_acl_name"
5358
server_group_name = "acl_server_group_name"

main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ resource "alicloud_alb_server_group" "alb_server_group" {
3838
resource_group_id = var.resource_group_id
3939

4040
health_check_config {
41-
health_check_connect_port = lookup(var.health_check_config, "health_check_connect_port", 80)
41+
health_check_connect_port = lookup(var.health_check_config, "health_check_connect_port", 0)
4242
health_check_enabled = lookup(var.health_check_config, "health_check_enabled", "false")
43-
health_check_host = lookup(var.health_check_config, "health_check_host", "")
43+
health_check_host = lookup(var.health_check_config, "health_check_host", null)
4444
health_check_http_version = lookup(var.health_check_config, "health_check_http_version", "HTTP1.1")
4545
health_check_interval = lookup(var.health_check_config, "health_check_interval", "2")
4646
health_check_method = lookup(var.health_check_config, "health_check_method", "HEAD")
47-
health_check_path = lookup(var.health_check_config, "health_check_path", "")
48-
health_check_protocol = lookup(var.health_check_config, "health_check_protocol", "")
47+
health_check_path = lookup(var.health_check_config, "health_check_path", null)
48+
health_check_protocol = lookup(var.health_check_config, "health_check_protocol", null)
4949
health_check_timeout = lookup(var.health_check_config, "health_check_timeout", "5")
5050
healthy_threshold = lookup(var.health_check_config, "healthy_threshold", "3")
5151
unhealthy_threshold = lookup(var.health_check_config, "unhealthy_threshold", "3")
@@ -54,7 +54,7 @@ resource "alicloud_alb_server_group" "alb_server_group" {
5454
sticky_session_config {
5555
sticky_session_enabled = lookup(var.sticky_session_config, "sticky_session_enabled", "false")
5656
cookie = lookup(var.sticky_session_config, "cookie", "")
57-
sticky_session_type = lookup(var.sticky_session_config, "sticky_session_type", "Server")
57+
sticky_session_type = lookup(var.sticky_session_config, "sticky_session_type", "Insert")
5858
}
5959
tags = var.tags
6060
}

0 commit comments

Comments
 (0)