Skip to content

Commit 0c1228b

Browse files
sync examples from Provider v1.248.0
1 parent 40e6f44 commit 0c1228b

File tree

44 files changed

+927
-205
lines changed

Some content is hidden

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

44 files changed

+927
-205
lines changed

quickstarts/Cloud_SSO/101-cloud-sso-directory-docs-Example/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ No modules.
1818
| Name | Type |
1919
|------|------|
2020
| [alicloud_cloud_sso_directory.default](https://registry.terraform.io/providers/aliyun/alicloud/latest/docs/resources/cloud_sso_directory) | resource |
21-
| [alicloud_cloud_sso_directories.default](https://registry.terraform.io/providers/aliyun/alicloud/latest/docs/data-sources/cloud_sso_directories) | data source |
2221

2322
## Inputs
2423

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
variable "name" {
22
default = "tf-example"
33
}
4+
45
provider "alicloud" {
56
region = "cn-shanghai"
67
}
7-
data "alicloud_cloud_sso_directories" "default" {}
88

99
resource "alicloud_cloud_sso_directory" "default" {
10-
count = length(data.alicloud_cloud_sso_directories.default.ids) > 0 ? 0 : 1
1110
directory_name = var.name
1211
}

quickstarts/Container_Service_for_Kubernetes(ACK)/101-cs-edge-kubernetes-docs-Example-01/main.tf

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@ resource "alicloud_vswitch" "default" {
2323
}
2424

2525
resource "alicloud_cs_edge_kubernetes" "default" {
26-
name_prefix = var.name
27-
worker_vswitch_ids = [alicloud_vswitch.default.id]
28-
worker_instance_types = [data.alicloud_instance_types.default.instance_types.0.id]
29-
version = "1.26.3-aliyun.1"
30-
worker_number = "1"
31-
password = "Test12345"
32-
pod_cidr = "10.99.0.0/16"
33-
service_cidr = "172.16.0.0/16"
34-
worker_instance_charge_type = "PostPaid"
35-
new_nat_gateway = "true"
36-
node_cidr_mask = "24"
37-
install_cloud_monitor = "true"
38-
slb_internet_enabled = "true"
39-
is_enterprise_security_group = "true"
26+
name_prefix = var.name
27+
worker_vswitch_ids = [alicloud_vswitch.default.id]
28+
worker_instance_types = [data.alicloud_instance_types.default.instance_types.0.id]
29+
version = "1.26.3-aliyun.1"
30+
worker_number = 1
31+
password = "Test12345"
32+
pod_cidr = "10.99.0.0/16"
33+
service_cidr = "172.16.0.0/16"
34+
worker_instance_charge_type = "PostPaid"
35+
new_nat_gateway = true
36+
node_cidr_mask = 24
37+
install_cloud_monitor = true
38+
slb_internet_enabled = true
39+
is_enterprise_security_group = true
40+
skip_set_certificate_authority = true
41+
4042
worker_data_disks {
4143
category = "cloud_ssd"
4244
size = "200"

quickstarts/Container_Service_for_Kubernetes(ACK)/101-cs-edge-kubernetes-docs-Example-02/main.tf

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,22 @@ resource "alicloud_vswitch" "default" {
2323
}
2424

2525
resource "alicloud_cs_edge_kubernetes" "default" {
26-
name_prefix = var.name
27-
worker_vswitch_ids = [alicloud_vswitch.default.id]
28-
worker_instance_types = [data.alicloud_instance_types.default.instance_types.0.id]
29-
cluster_spec = "ack.pro.small"
30-
worker_number = "1"
31-
password = "Test12345"
32-
pod_cidr = "10.99.0.0/16"
33-
service_cidr = "172.16.0.0/16"
34-
worker_instance_charge_type = "PostPaid"
35-
new_nat_gateway = "true"
36-
node_cidr_mask = "24"
37-
load_balancer_spec = "slb.s2.small"
38-
install_cloud_monitor = "true"
39-
slb_internet_enabled = "true"
40-
is_enterprise_security_group = "true"
26+
name_prefix = var.name
27+
worker_vswitch_ids = [alicloud_vswitch.default.id]
28+
worker_instance_types = [data.alicloud_instance_types.default.instance_types.0.id]
29+
cluster_spec = "ack.pro.small"
30+
worker_number = 1
31+
password = "Test12345"
32+
pod_cidr = "10.99.0.0/16"
33+
service_cidr = "172.16.0.0/16"
34+
worker_instance_charge_type = "PostPaid"
35+
new_nat_gateway = true
36+
node_cidr_mask = 24
37+
load_balancer_spec = "slb.s2.small"
38+
install_cloud_monitor = true
39+
slb_internet_enabled = true
40+
is_enterprise_security_group = true
41+
skip_set_certificate_authority = true
4142

4243
worker_data_disks {
4344
category = "cloud_ssd"

quickstarts/Container_Service_for_Kubernetes(ACK)/101-cs-kubernetes-docs-Example/main.tf

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,23 @@ data "alicloud_instance_types" "cloud_essd" {
120120
}
121121

122122
resource "alicloud_cs_kubernetes" "default" {
123-
master_vswitch_ids = length(var.vswitch_ids) > 0 ? split(",", join(",", var.vswitch_ids)) : length(var.vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.vswitches.*.id))
124-
pod_vswitch_ids = length(var.terway_vswitch_ids) > 0 ? split(",", join(",", var.terway_vswitch_ids)) : length(var.terway_vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.terway_vswitches.*.id))
125-
master_instance_types = [data.alicloud_instance_types.cloud_essd.0.instance_types.0.id, data.alicloud_instance_types.cloud_essd.1.instance_types.0.id, data.alicloud_instance_types.cloud_essd.2.instance_types.0.id]
126-
master_disk_category = "cloud_essd"
127-
password = "Yourpassword1234"
128-
service_cidr = "172.18.0.0/16"
129-
install_cloud_monitor = "true"
130-
resource_group_id = data.alicloud_resource_manager_resource_groups.default.groups.0.id
131-
deletion_protection = "false"
132-
timezone = "Asia/Shanghai"
133-
os_type = "Linux"
134-
platform = "AliyunLinux3"
135-
cluster_domain = "cluster.local"
136-
proxy_mode = "ipvs"
137-
custom_san = "www.terraform.io"
138-
new_nat_gateway = "true"
123+
master_vswitch_ids = length(var.vswitch_ids) > 0 ? split(",", join(",", var.vswitch_ids)) : length(var.vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.vswitches.*.id))
124+
pod_vswitch_ids = length(var.terway_vswitch_ids) > 0 ? split(",", join(",", var.terway_vswitch_ids)) : length(var.terway_vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.terway_vswitches.*.id))
125+
master_instance_types = [data.alicloud_instance_types.cloud_essd.0.instance_types.0.id, data.alicloud_instance_types.cloud_essd.1.instance_types.0.id, data.alicloud_instance_types.cloud_essd.2.instance_types.0.id]
126+
master_disk_category = "cloud_essd"
127+
password = "Yourpassword1234"
128+
service_cidr = "172.18.0.0/16"
129+
install_cloud_monitor = true
130+
resource_group_id = data.alicloud_resource_manager_resource_groups.default.groups.0.id
131+
deletion_protection = false
132+
timezone = "Asia/Shanghai"
133+
os_type = "Linux"
134+
platform = "AliyunLinux3"
135+
cluster_domain = "cluster.local"
136+
proxy_mode = "ipvs"
137+
custom_san = "www.terraform.io"
138+
new_nat_gateway = true
139+
skip_set_certificate_authority = true
139140
dynamic "addons" {
140141
for_each = var.cluster_addons
141142
content {

quickstarts/Container_Service_for_Kubernetes(ACK)/101-cs-kubernetes-node-pool-docs-Example/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resource "alicloud_vswitch" "default" {
3232
resource "alicloud_cs_managed_kubernetes" "default" {
3333
name_prefix = "terraform-example-${random_integer.default.result}"
3434
cluster_spec = "ack.pro.small"
35-
worker_vswitch_ids = [alicloud_vswitch.default.id]
35+
vswitch_ids = [alicloud_vswitch.default.id]
3636
new_nat_gateway = true
3737
pod_cidr = cidrsubnet("10.0.0.0/8", 8, 36)
3838
service_cidr = cidrsubnet("172.16.0.0/16", 4, 7)
@@ -140,7 +140,7 @@ resource "alicloud_cs_kubernetes_node_pool" "spot_instance" {
140140
key_name = alicloud_key_pair.default.key_pair_name
141141

142142
# you need to specify the number of nodes in the node pool, which can be 0
143-
desired_size = 1
143+
desired_size = 0
144144

145145
# spot config
146146
spot_strategy = "SpotWithPriceLimit"

quickstarts/Container_Service_for_Kubernetes(ACK)/101-cs-managed-kubernetes-docs-Example/main.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,14 @@ resource "alicloud_cs_managed_kubernetes" "k8s" {
8484
name = var.name
8585
cluster_spec = "ack.pro.small"
8686
# version can not be defined in variables.tf.
87-
# version = "1.26.3-aliyun.1"
88-
vswitch_ids = length(var.vswitch_ids) > 0 ? split(",", join(",", var.vswitch_ids)) : length(var.vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.vswitches.*.id))
89-
pod_vswitch_ids = length(var.terway_vswitch_ids) > 0 ? split(",", join(",", var.terway_vswitch_ids)) : length(var.terway_vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.terway_vswitches.*.id))
90-
new_nat_gateway = true
91-
node_cidr_mask = var.node_cidr_mask
92-
proxy_mode = var.proxy_mode
93-
service_cidr = var.service_cidr
87+
# version = "1.26.3-aliyun.1"
88+
vswitch_ids = length(var.vswitch_ids) > 0 ? split(",", join(",", var.vswitch_ids)) : length(var.vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.vswitches.*.id))
89+
pod_vswitch_ids = length(var.terway_vswitch_ids) > 0 ? split(",", join(",", var.terway_vswitch_ids)) : length(var.terway_vswitch_cidrs) < 1 ? [] : split(",", join(",", alicloud_vswitch.terway_vswitches.*.id))
90+
new_nat_gateway = true
91+
node_cidr_mask = var.node_cidr_mask
92+
proxy_mode = var.proxy_mode
93+
service_cidr = var.service_cidr
94+
skip_set_certificate_authority = true
9495

9596
addons {
9697
name = "terway-eniip"

quickstarts/Container_Service_for_Kubernetes(ACK)/101-cs-serverless-kubernetes-docs-Example/main.tf

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,12 @@ resource "alicloud_cs_serverless_kubernetes" "serverless" {
2626
new_nat_gateway = true
2727
endpoint_public_access_enabled = true
2828
deletion_protection = false
29-
30-
load_balancer_spec = "slb.s2.small"
31-
time_zone = "Asia/Shanghai"
32-
service_cidr = "172.21.0.0/20"
33-
service_discovery_types = ["PrivateZone"]
34-
# Enable log service, A project named k8s-log-{ClusterID} will be automatically created
35-
logging_type = "SLS"
29+
time_zone = "Asia/Shanghai"
30+
service_cidr = "172.21.0.0/20"
3631

3732
# tags
3833
tags = {
3934
"k-aa" = "v-aa"
40-
"k-bb" = "v-aa"
41-
}
42-
43-
# addons
44-
addons {
45-
# ALB Ingress
46-
name = "alb-ingress-controller"
47-
}
48-
addons {
49-
name = "metrics-server"
50-
}
51-
addons {
52-
name = "knative"
53-
}
54-
addons {
55-
name = "arms-prometheus"
35+
"k-bb" = "v-bb"
5636
}
5737
}

quickstarts/ECS/101-security-group-rule-docs-Example/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
resource "alicloud_security_group" "default" {
2-
name = "default"
2+
security_group_name = "default"
33
}
44
resource "alicloud_security_group_rule" "allow_all_tcp" {
55
type = "ingress"
66
ip_protocol = "tcp"
7-
nic_type = "internet"
7+
nic_type = "intranet"
88
policy = "accept"
99
port_range = "1/65535"
1010
priority = 1

quickstarts/ENS/101-ens-eip-docs-Example/main.tf

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ variable "name" {
33
}
44

55
resource "alicloud_ens_eip" "default" {
6-
description = "EipDescription_autotest"
7-
bandwidth = "5"
8-
isp = "cmcc"
9-
payment_type = "PayAsYouGo"
10-
ens_region_id = "cn-chenzhou-telecom_unicom_cmcc"
11-
eip_name = var.name
12-
6+
description = "EipDescription_autotest"
7+
bandwidth = "5"
8+
isp = "cmcc"
9+
payment_type = "PayAsYouGo"
10+
ens_region_id = "cn-chenzhou-telecom_unicom_cmcc"
11+
eip_name = var.name
1312
internet_charge_type = "95BandwidthByMonth"
1413
}

0 commit comments

Comments
 (0)