Skip to content

quickstarts: improve the examples #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ data "alicloud_ram_roles" "example" {
resource "alicloud_actiontrail_trail" "example" {
trail_name = var.name
sls_write_role_arn = data.alicloud_ram_roles.example.roles.0.arn
sls_project_arn = "acs:log:${data.alicloud_regions.example.regions.0.id}:${data.alicloud_account.example.id}:project/${alicloud_log_project.example.name}"
sls_project_arn = "acs:log:${data.alicloud_regions.example.regions.0.id}:${data.alicloud_account.example.id}:project/${alicloud_log_project.example.project_name}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ resource "alicloud_key_pair" "default" {
}

resource "alicloud_cs_kubernetes_node_pool" "default" {
name = "desired_size"
node_pool_name = "desired_size"
cluster_id = alicloud_cs_managed_kubernetes.default.id
vswitch_ids = [alicloud_vswitch.vswitch.id]
instance_types = [data.alicloud_instance_types.default.instance_types.0.id]
system_disk_category = "cloud_efficiency"
system_disk_size = 40
key_name = alicloud_key_pair.default.key_name
key_name = alicloud_key_pair.default.key_pair_name
desired_size = 2
}

Expand Down Expand Up @@ -96,4 +96,4 @@ spec:
matchLabels:
app: tomcat
EOF
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ resource "alicloud_cen_transit_router" "example" {
}

resource "alicloud_vpn_customer_gateway" "example" {
name = var.name
ip_address = "42.104.22.210"
asn = "45014"
description = var.name
customer_gateway_name = var.name
ip_address = "42.104.22.210"
asn = "45014"
description = var.name
}

resource "alicloud_vpn_gateway_vpn_attachment" "example" {
Expand Down Expand Up @@ -81,4 +81,4 @@ resource "alicloud_cen_transit_router_vpn_attachment" "example" {
zone {
zone_id = data.alicloud_cen_transit_router_available_resources.default.resources.0.master_zones.0
}
}
}
19 changes: 16 additions & 3 deletions quickstarts/ECS/101-use-case-create-an-ecs-instance/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
variable "region" {
default = "cn-beijing"
}

variable "instance_type" {
default = "ecs.n4.tiny"
}

variable "image_id" {
default = "ubuntu_18_04_64_20G_alibase_20190624.vhd"
}

provider "alicloud" {
region = "cn-beijing"
region = var.region
}

data "alicloud_zones" "default" {
available_disk_category = "cloud_efficiency"
available_resource_creation = "VSwitch"
available_instance_type = var.instance_type
}

resource "alicloud_vpc" "vpc" {
Expand All @@ -28,9 +41,9 @@ resource "alicloud_instance" "instance" {
availability_zone = data.alicloud_zones.default.zones.0.id
security_groups = alicloud_security_group.default.*.id
# series III
instance_type = "ecs.n4.large"
instance_type = var.instance_type
system_disk_category = "cloud_efficiency"
image_id = "ubuntu_18_04_64_20G_alibase_20190624.vhd"
image_id = var.image_id
instance_name = "test_foo"
vswitch_id = alicloud_vswitch.vsw.id
internet_max_bandwidth_out = 10
Expand Down
Loading