add test plan
This commit is contained in:
parent
b8f09f22f8
commit
3f49b8491b
@ -1,3 +1,7 @@
|
|||||||
### install
|
### install
|
||||||
wget https://releases.hashicorp.com/terraform/0.12.5/terraform_0.12.5_linux_amd64.zip
|
wget https://releases.hashicorp.com/terraform/0.12.5/terraform_0.12.5_linux_amd64.zip
|
||||||
### other
|
### config
|
||||||
|
vim /etc/profile.d/terraform.sh
|
||||||
|
$ export TENCENTCLOUD_SECRET_ID="your_fancy_accessid"
|
||||||
|
$ export TENCENTCLOUD_SECRET_KEY="your_fancy_accesskey"
|
||||||
|
$ export TENCENTCLOUD_REGION="ap-hongkong"
|
1
test/cos/provider.tf
Normal file
1
test/cos/provider.tf
Normal file
@ -0,0 +1 @@
|
|||||||
|
provider "tencentcloud" {}
|
16
test/cvm/cvm.tf
Normal file
16
test/cvm/cvm.tf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
resource "tencentcloud_instance" "cvm_test" {
|
||||||
|
instance_name = "cvm-test"
|
||||||
|
availability_zone = "ap-hongkong-1"
|
||||||
|
image_id = "img-pi0ii46r"
|
||||||
|
instance_type = "S2.SMALL1"
|
||||||
|
system_disk_type = "CLOUD_PREMIUM"
|
||||||
|
|
||||||
|
security_groups = [
|
||||||
|
"${tencentcloud_security_group.sg_test.id}"
|
||||||
|
]
|
||||||
|
|
||||||
|
vpc_id = "${tencentcloud_vpc.vpc_test.id}"
|
||||||
|
subnet_id = "${tencentcloud_subnet.subnet_test.id}"
|
||||||
|
internet_max_bandwidth_out = 10
|
||||||
|
count = 1
|
||||||
|
}
|
3
test/cvm/provider.tf
Normal file
3
test/cvm/provider.tf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
provider "tencentcloud" {
|
||||||
|
region = "ap-hongkong"
|
||||||
|
}
|
5
test/cvm/route_table.tf
Normal file
5
test/cvm/route_table.tf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// Create a route table
|
||||||
|
resource "tencentcloud_route_table" "rtb_test" {
|
||||||
|
name = "rtb-test"
|
||||||
|
vpc_id = "${tencentcloud_vpc.vpc_test.id}"
|
||||||
|
}
|
13
test/cvm/security_group.tf
Normal file
13
test/cvm/security_group.tf
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Create a security group and rule
|
||||||
|
resource "tencentcloud_security_group" "sg_test" {
|
||||||
|
name = "sg-test"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "tencentcloud_security_group_rule" "sg_rule_test" {
|
||||||
|
security_group_id = "${tencentcloud_security_group.sg_test.id}"
|
||||||
|
type = "ingress"
|
||||||
|
cidr_ip = "0.0.0.0/0"
|
||||||
|
ip_protocol = "tcp"
|
||||||
|
port_range = "22,80"
|
||||||
|
policy = "accept"
|
||||||
|
}
|
8
test/cvm/subnet.tf
Normal file
8
test/cvm/subnet.tf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Create a subnet
|
||||||
|
resource "tencentcloud_subnet" "subnet_test" {
|
||||||
|
name = "subnet-test"
|
||||||
|
cidr_block = "10.0.1.0/24"
|
||||||
|
availability_zone = "ap-hongkong-1"
|
||||||
|
vpc_id = "${tencentcloud_vpc.vpc_test.id}"
|
||||||
|
route_table_id = "${tencentcloud_route_table.rtb_test.id}"
|
||||||
|
}
|
5
test/cvm/vpc.tf
Normal file
5
test/cvm/vpc.tf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// Create a vpc
|
||||||
|
resource "tencentcloud_vpc" "vpc_test" {
|
||||||
|
name = "vpc-test"
|
||||||
|
cidr_block = "10.0.0.0/16"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user