1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
| # cat yunduan.tf
resource "alicloud_instance" "test999" {
# (resource arguments)
}
#
# terraform import alicloud_instance.test999 i-bp1etiv4002h9q27lb97
alicloud_instance.test999: Importing from ID "i-bp1etiv4002h9q27lb97"...
alicloud_instance.test999: Import prepared!
Prepared alicloud_instance for import
alicloud_instance.test999: Refreshing state... [id=i-bp1etiv4002h9q27lb97]
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
# cat terraform.tfstate
{
"version": 4,
"terraform_version": "0.14.3",
"serial": 1,
"lineage": "779fad5e-b076-8cfd-6041-f6eef8c88b8a",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "alicloud_instance",
"name": "test999",
"provider": "provider[\"registry.terraform.io/aliyun/alicloud\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"allocate_public_ip": null,
"auto_release_time": "",
"auto_renew_period": null,
"availability_zone": "cn-hangzhou-i",
"credit_specification": "",
"data_disks": [],
"deletion_protection": false,
"description": "",
"dry_run": null,
"force_delete": null,
"host_name": "iZbp1etiv4002h9q27lb97Z",
"id": "i-bp1etiv4002h9q27lb97",
"image_id": "ubuntu_18_04_64_20G_alibase_20190624.vhd",
"include_data_disks": null,
"instance_charge_type": "PostPaid",
"instance_name": "wanzi_tf001",
"instance_type": "ecs.s6-c1m2.small",
"internet_charge_type": "PayByTraffic",
"internet_max_bandwidth_in": -1,
"internet_max_bandwidth_out": 0,
"io_optimized": null,
"is_outdated": null,
"key_name": "",
"kms_encrypted_password": null,
"kms_encryption_context": null,
"password": "",
"period": null,
"period_unit": null,
"private_ip": "10.100.0.169",
"public_ip": "",
"renewal_status": null,
"resource_group_id": "",
"role_name": "",
"security_enhancement_strategy": null,
"security_groups": [
"sg-bp14pij6g7sjmn9bz92a"
],
"spot_price_limit": 0,
"spot_strategy": "NoSpot",
"status": "Running",
"subnet_id": "vsw-bp1c966jdtiw1qwh2tng8",
"system_disk_auto_snapshot_policy_id": "",
"system_disk_category": "cloud_efficiency",
"system_disk_description": null,
"system_disk_name": null,
"system_disk_performance_level": "",
"system_disk_size": 40,
"tags": {},
"timeouts": {
"create": null,
"delete": null,
"update": null
},
"user_data": "",
"volume_tags": {},
"vswitch_id": "vsw-bp1c966jdtiw1qwh2tng8"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjAifQ=="
}
]
}
]
}
# terraform show
# alicloud_instance.test999:
resource "alicloud_instance" "test999" {
availability_zone = "cn-hangzhou-i"
deletion_protection = false
host_name = "iZbp1etiv4002h9q27lb97Z"
id = "i-bp1etiv4002h9q27lb97"
image_id = "ubuntu_18_04_64_20G_alibase_20190624.vhd"
instance_charge_type = "PostPaid"
instance_name = "wanzi_tf001"
instance_type = "ecs.s6-c1m2.small"
internet_charge_type = "PayByTraffic"
internet_max_bandwidth_in = -1
internet_max_bandwidth_out = 0
private_ip = "10.100.0.169"
security_groups = [
"sg-bp14pij6g7sjmn9bz92a",
]
spot_price_limit = 0
spot_strategy = "NoSpot"
status = "Running"
subnet_id = "vsw-bp1c966jdtiw1qwh2tng8"
system_disk_category = "cloud_efficiency"
system_disk_size = 40
tags = {}
volume_tags = {}
vswitch_id = "vsw-bp1c966jdtiw1qwh2tng8"
timeouts {}
}
|