tencentcloudstack / terraform-provider-tencentcloud Goto Github PK
View Code? Open in Web Editor NEWTerraform Tencent Cloud Provider
Home Page: https://www.terraform.io/docs/providers/tencentcloud/
License: Mozilla Public License 2.0
Terraform Tencent Cloud Provider
Home Page: https://www.terraform.io/docs/providers/tencentcloud/
License: Mozilla Public License 2.0
steps to reproduce:
terraform apply
and input yes
terraform apply
again, it will prompt to re-create these security group rules.Now in both tencentcloud_kubernetes_cluster
and tencentcloud_kubernetes_scale_worker
, the worker instance_charge_type is hardcode with POSTPAID_BY_HOUR
.
Is there any plan to add instance_charge_type
as configurable option, support both POSTPAID_BY_HOUR
and PREPAID
, to keep consistence with web console?
when I write a image query like this:
data "tencentcloud_image" "my_favorate_image" {
image_name_regex = "[c|C]."
}
the result is :
"data.tencentcloud_image.my_favorate_image": {
"type": "tencentcloud_image",
"depends_on": [],
"primary": {
"id": "978916566",
"attributes": {
"id": "978916566",
"image_id": "img-9in0zslb",
"image_name_regex": "[c|C]."
},
"meta": {},
"tainted": false
},
"deposed": [],
"provider": "provider.tencentcloud"
}
Currently LB is not useable.
Crash log here: https://gist.github.com/memory/ffa2fb7b66fc10b0e92240f63d5975ea
Config we were attempting to apply:
provider "tencentcloud" {
region = "na-ashburn"
}
resource "tencentcloud_vpc" "virginia" {
name = "virginia vpc"
cidr_block = "10.0.0.0/16"
}
resource "tencentcloud_route_table" "virginia" {
name = "virginia route table"
vpc_id = "${tencentcloud_vpc.virginia.id}"
}
resource "tencentcloud_subnet" "virginia-a" {
name = "virginia A subnet"
cidr_block = "10.0.1.0/24"
availability_zone = "na-ashburn-1"
vpc_id = "${tencentcloud_vpc.virginia.id}"
route_table_id = "${tencentcloud_route_table.virginia.id}"
}
data "tencentcloud_image" "main" {
os_name = "ubuntu"
filter {
name = "image-type"
values = ["PUBLIC_IMAGE"]
}
}
data "tencentcloud_availability_zones" "main" {}
resource "tencentcloud_security_group" "proxy" {
name = "squid proxies"
description = "security group for squids"
}
resource "tencentcloud_security_group_rule" "web" {
security_group_id = "${tencentcloud_security_group.proxy.id}"
type = "ingress"
cidr_ip = "0.0.0.0/0"
ip_protocol = "tcp"
port_range = "433"
policy = "accept"
}
resource "tencentcloud_security_group_rule" "ssh" {
security_group_id = "${tencentcloud_security_group.proxy.id}"
type = "ingress"
cidr_ip = "172.254.230.94/32"
ip_protocol = "tcp"
port_range = "22"
policy = "accept"
}
resource "tencentcloud_instance" "squid" {
instance_name = "squid"
availability_zone = "${data.tencentcloud_availability_zones.main.zones.0.name}"
image_id = "${data.tencentcloud_image.main.image_id}"
instance_type = "s2.small1"
key_name = "skey-fzp930db"
security_groups = [
"${tencentcloud_security_group.proxy.id}",
]
vpc_id = "${tencentcloud_vpc.virginia.id}"
subnet_id = "${tencentcloud_subnet.virginia-a.id}"
internet_max_bandwidth_out = 20
count = 1
}
plugin version: 1.11
Thanks for adding CCN support!
Two issues maybe needed to fix:
resource tencentcloud_ccn main
should be
resource "tencentcloud_ccn" "main"
1.2 missing id attribute in tencentcloud_ccn resource (https://www.terraform.io/docs/providers/tencentcloud/r/ccn.html#attributes-reference)
Error: Error applying plan:
6 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_eu[2]: 1 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_eu.2: [TencentCloudSDKError] Code=UnsupportedOperation.CcnAttached, Message=实例 `vpc-9ley7qeh` 已关联云联网。, RequestId=512ab4f8-189f-412d-82df-dad36411b222
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_cn[0]: 1 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_cn.0: [TencentCloudSDKError] Code=UnsupportedOperation.CcnAttached, Message=实例 `vpc-oqq3xg74` 已关联云联网。, RequestId=c7c35982-57ec-475b-910b-220e247fb3fc
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_eu[1]: 1 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_eu.1: [TencentCloudSDKError] Code=UnsupportedOperation.CcnAttached, Message=实例 `vpc-co7qfpkz` 已关联云联网。, RequestId=84002e68-7cd2-4707-a032-939344263b62
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_cn[1]: 1 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_cn.1: [TencentCloudSDKError] Code=UnsupportedOperation.CcnAttached, Message=实例 `vpc-kcei9pl0` 已关联云联网。, RequestId=55d1f3da-dc48-4bc1-a8f6-9b44b6e64237
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_eu[0]: 1 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_eu.0: [TencentCloudSDKError] Code=UnsupportedOperation.CcnAttached, Message=实例 `vpc-3sbfh9lx` 已关联云联网。, RequestId=577977fc-b22d-4390-91fe-4c52480eeb18
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_cn[2]: 1 error(s) occurred:
* tencentcloud_ccn_attachment.tct_ccn_attach_vpc_cn.2: [TencentCloudSDKError] Code=UnsupportedOperation.CcnAttached, Message=实例 `vpc-ebwdztig` 已关联云联网。, RequestId=c9a211a7-7b98-48f8-a382-03fb4b9fa681
EDIT:
looks like retry action is already there:
https://github.com/terraform-providers/terraform-provider-tencentcloud/blob/master/tencentcloud/resource_tc_ccn_attachment.go#L205
but why it is not working?
You can reproduce this by change the resource name, e.g.
change resource "tencentcloud_ccn_attachment" "at1"
to resource "tencentcloud_ccn_attachment" "at2"
and re-run terraform apply.
EDIT2:
by looking at terraform output, looks resource creation and destruction started at the same time because of name changes, so maybe this is not the issue from provider, ignore this please.
provider version: 1.12
when image_id changed, instances should be re-created instead of "modify":
~ tencentcloud_instance.test_vm_tct_cn[0]
image_id: "img-mzbr88cf" => "img-axq9idj1"
~ tencentcloud_instance.test_vm_tct_cn[1]
image_id: "img-mzbr88cf" => "img-axq9idj1"
~ tencentcloud_instance.test_vm_tct_cn[2]
image_id: "img-mzbr88cf" => "img-axq9idj1"
~ tencentcloud_instance.test_vm_tct_eu[0]
image_id: "img-o77dd2jn" => "img-pi1pale7"
~ tencentcloud_instance.test_vm_tct_eu[1]
image_id: "img-o77dd2jn" => "img-pi1pale7"
~ tencentcloud_instance.test_vm_tct_eu[2]
image_id: "img-o77dd2jn" => "img-pi1pale7"
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
tencentcloud_instance.test_vm_tct_cn[0]: Modifying... (ID: ins-1vv9a7er)
image_id: "img-mzbr88cf" => "img-axq9idj1"
tencentcloud_instance.test_vm_tct_eu[2]: Modifying... (ID: ins-003b1pf2)
image_id: "img-o77dd2jn" => "img-pi1pale7"
tencentcloud_instance.test_vm_tct_eu[0]: Modifying... (ID: ins-09od6vhg)
image_id: "img-o77dd2jn" => "img-pi1pale7"
tencentcloud_instance.test_vm_tct_eu[1]: Modifying... (ID: ins-o9wbotcw)
image_id: "img-o77dd2jn" => "img-pi1pale7"
tencentcloud_instance.test_vm_tct_cn[1]: Modifying... (ID: ins-ac71rjd5)
image_id: "img-mzbr88cf" => "img-axq9idj1"
tencentcloud_instance.test_vm_tct_cn[2]: Modifying... (ID: ins-7kbqea89)
image_id: "img-mzbr88cf" => "img-axq9idj1"
env:
Terraform v0.12.6
code:
resource "tencentcloud_instance" "http_proxy" {
instance_name = "http-proxy-test"
availability_zone = "${data.tencentcloud_availability_zones.shanghai_3.name}"
instance_type = "${data.tencentcloud_instance_types.http-proxy.instance_types.0.instance_type}"
image_id = "${data.tencentcloud_image.default_image.image_id}"
project_id = 0
security_groups = ["${data.tencentcloud_security_groups.httpproxy.security_group_id}"]
vpc_id = "${data.tencentcloud_vpc_instances.ivankaprod.vpc_id}"
subnet_id = "${data.tencentcloud_vpc_subnets.nonat_sh3.subnet_id}"
internet_max_bandwidth_out = 100
count = 1
system_disk_size = 50
system_disk_type = "CLOUD_BASIC"
allocate_public_ip = true
instance_charge_type = "PREPAID"
instance_charge_type_prepaid_period = 1
}
Issues on GitHub are intended to be related to bugs or feature requests with provider codebase,
so we recommend using our other community resources instead of asking here 👍.
If you have a support request or question please submit them to one of these resources:
While attempting to reprovision (due to #18), the following error was seen:
* tencentcloud_instance.default.1: tencentcloud_instance update on data_disks is not supported yet
The only way to get past this error once it's appeared is to destroy and re-apply from scratch.
Hi,
When define a private ip to instance resource, if the instance is being re-creating, the new instance will be created immediately after previous one was destroyed, it will cause issue because the private IP may need a short time to be released, so there will be error message like "vpc ip is in use", please help to guide a solution or workaround, thanks.
Please support vpn, thanks.
provider version: 1.12
We experience this issue 2~3 times in Frankfurt, timeout of creating instance is now 1 minute, which is too short, this will lead problems:
Sometimes
instances in Frankfurt take more than 1 minute to be created, the final status is successful (from UI),
But,
Terraform reports timeout error at 1 minute, which means, resource tencentcloud_instance.test_vm_xxx below will be NULL
in terraform state, so next time people run terraform apply
, it will try to create these instances again, but actually these instances are already there.
So, I suggest to increase the timeout to 5 minutes or a better value you think.
tencentcloud_instance.test_vm_eu.2: Still creating... (1m10s elapsed)
tencentcloud_instance.test_vm_eu.0: Still creating... (1m10s elapsed)
tencentcloud_instance.test_vm_eu.1: Still creating... (1m10s elapsed)
tencentcloud_instance.test_vm_eu.2: Still creating... (1m20s elapsed)
tencentcloud_instance.test_vm_eu.0: Still creating... (1m20s elapsed)
tencentcloud_instance.test_vm_eu.1: Still creating... (1m20s elapsed)
Error: Error applying plan:
3 error(s) occurred:
* tencentcloud_instance.test_vm_eu[2]: 1 error(s) occurred:
* tencentcloud_instance.test_vm_eu.2: timeout while waiting for state to become 'success' (timeout: 1m0s)
* tencentcloud_instance.test_vm_eu[0]: 1 error(s) occurred:
* tencentcloud_instance.test_vm_eu.0: timeout while waiting for state to become 'success' (timeout: 1m0s)
* tencentcloud_instance.test_vm_eu[1]: 1 error(s) occurred:
* tencentcloud_instance.test_vm_eu.1: timeout while waiting for state to become 'success' (timeout: 1m0s)
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Because of problems with resource tencentcloud_cbs_storage (see issue #2), I tried instead using an array of data disks, and got the following error:
* tencentcloud_instance.default: tencentcloud_instance currently only one data disk is supported during instance creation
In the Tencent console however, I am able to create up to eight data disks during instance creation.
Example:
resource "tencentcloud_instance" "default" {
. . .
data_disks = [
{
data_disk_type = "CLOUD_BASIC""
data_disk_size = "60"
},
{
data_disk_type = "CLOUD_BASIC""
data_disk_size = "60"
}
]
. . .
}
0.12.13
1.23
tencentcloud_kubernetes_cluster
In web-console, the OS of TKE cluster already supports Ubuntu 18.04 and CentOS 7.6. According to source code, in terraform it only accepts Ubuntu 16.04 and CentOS 7.2.
Hi,
Looks like terraform can only bind a loadbalancer for now, can you please add support for CRUD? This is a very important component in a Cloud provider, thanks.
目前TF不支持腾讯云DNS,这是非常基础的功能。
When instances were deleted manually, tencentcloud_eip_association will try to unbind a non-existing instances id from eip, so it will stuck till timeout, any solutions?
tencentcloud_eip_association.eip_tct_eu_assoc.2: Still destroying... (ID: eip-h6zvvaaq::ins-bnc8fsck, 50s elapsed)
tencentcloud_eip_association.eip_tct_eu_assoc.1: Still destroying... (ID: eip-m41t20x6::ins-4z5p73pk, 50s elapsed)
tencentcloud_eip_association.eip_tct_eu_assoc.0: Still destroying... (ID: eip-bhhoetfu::ins-gvytdt64, 50s elapsed)
tencentcloud_eip_association.eip_tct_cn_assoc.2: Still destroying... (ID: eip-7o6tunrb::ins-leqq7pop, 50s elapsed)
tencentcloud_eip_association.eip_tct_cn_assoc.1: Still destroying... (ID: eip-8ubh5hu5::ins-o8fpgoyp, 50s elapsed)
tencentcloud_eip_association.eip_tct_cn_assoc.0: Still destroying... (ID: eip-5x30nf2d::ins-ijieuuht, 50s elapsed)
tencentcloud_eip_association.eip_tct_eu_assoc.2: Still destroying... (ID: eip-h6zvvaaq::ins-bnc8fsck, 1m0s elapsed)
tencentcloud_eip_association.eip_tct_eu_assoc.1: Still destroying... (ID: eip-m41t20x6::ins-4z5p73pk, 1m0s elapsed)
tencentcloud_eip_association.eip_tct_eu_assoc.0: Still destroying... (ID: eip-bhhoetfu::ins-gvytdt64, 1m0s elapsed)
tencentcloud_eip_association.eip_tct_cn_assoc.2: Still destroying... (ID: eip-7o6tunrb::ins-leqq7pop, 1m0s elapsed)
tencentcloud_eip_association.eip_tct_cn_assoc.1: Still destroying... (ID: eip-8ubh5hu5::ins-o8fpgoyp, 1m0s elapsed)
tencentcloud_eip_association.eip_tct_cn_assoc.0: Still destroying... (ID: eip-5x30nf2d::ins-ijieuuht, 1m0s elapsed)
......
Error: Error applying plan:
6 error(s) occurred:
* tencentcloud_eip_association.eip_tct_cn_assoc[1] (destroy): 1 error(s) occurred:
* tencentcloud_eip_association.eip_tct_cn_assoc.1: eip still unbinding
* tencentcloud_eip_association.eip_tct_cn_assoc[0] (destroy): 1 error(s) occurred:
* tencentcloud_eip_association.eip_tct_cn_assoc.0: eip still unbinding
* tencentcloud_eip_association.eip_tct_eu_assoc[2] (destroy): 1 error(s) occurred:
* tencentcloud_eip_association.eip_tct_eu_assoc.2: eip still unbinding
* tencentcloud_eip_association.eip_tct_cn_assoc[2] (destroy): 1 error(s) occurred:
* tencentcloud_eip_association.eip_tct_cn_assoc.2: eip still unbinding
* tencentcloud_eip_association.eip_tct_eu_assoc[1] (destroy): 1 error(s) occurred:
* tencentcloud_eip_association.eip_tct_eu_assoc.1: eip still unbinding
* tencentcloud_eip_association.eip_tct_eu_assoc[0] (destroy): 1 error(s) occurred:
* tencentcloud_eip_association.eip_tct_eu_assoc.0: eip still unbinding
I got this error when creating security group resource using terraform plugin
tencentcloud_security_group.alauda_int_group: json: cannot unmarshal string into Go struct field .code of type int
resource "tencentcloud_security_group" "alauda_int_group" {
name = "web accessibility"
description = "make it accessable for both production and stage ports"
}
It seems that I don't have access to creating security group
当internet_max_bandwidth_out改变时需要ForceNew,重建VM,但是在Console中修改时,对VM并不影响,Terraform中可以支持update 带宽么?
internet_max_bandwidth_out - (Optional, ForceNew) Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). If this value is not specified, then automatically sets it to 0 Mbps.
[1] https://www.terraform.io/docs/providers/tencentcloud/r/instance.html#internet_max_bandwidth_out
As part of the preparation for Terraform v0.12, we would like to migrate all providers to use Go Modules. We plan to continue checking dependencies into vendor/ to remain compatible with existing tooling/CI for a period of time, however go modules will be used for management. Go Modules is the official solution for the go programming language, we understand some providers might not want this change yet, however we encourage providers to begin looking towards the switch as this is how we will be managing all Go projects in the future. Would maintainers please react with 👍 for support, or 👎 if you wish to have this provider omitted from the first wave of pull requests. If your provider is in support, we would ask that you avoid merging any pull requests that mutate the dependencies while the Go Modules PR is open (in fact a total codefreeze would be even more helpful), otherwise we will need to close that PR and re-run go mod init
. Once merged, dependencies can be added or updated as follows:
$ GO111MODULE=on go get github.com/some/module@master
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor
GO111MODULE=on might be unnecessary depending on your environment, this example will fetch a module @ master and record it in your project's go.mod and go.sum files. It's a good idea to tidy up afterward and then copy the dependencies into vendor/. To remove dependencies from your project, simply remove all usage from your codebase and run:
$ GO111MODULE=on go mody tidy
$ GO111MODULE=on go mod vendor
Thank you sincerely for all your time, contributions, and cooperation!
Is there any plan to support auto-scaling group in TKE?
背景:
想要使用Terraform在腾讯云实现虚拟机级别“不可变基础设施”的想法,场景如下:
当需要升级应用时,创建新的VM,部署新的APP,将流量切换到新的VM,确认没有问题后,删除老的VM。
使用Terraform本身可以实现,但是这样就无法享受到腾讯云包月的优惠(删除老的包月VM,就基本按照按需收费了)。腾讯云目前如果不支持类似AWS的RI灵活计费,或者类似阿里云的RI实例券 [1], 这种情况下使用Terraform频繁增删变更VM就变的非常尴尬,这种情况下仅能使用按需计费。
腾讯云目前是否有什么best practice支持Terraform使用这种case?
是否有计划支持灵活计费?
When creating user_policy_attachment, the attachment is created indeed, but terraform doesn't exist correctly, and the attachment state is not refreshed correctly.
v0.12.13
This is just copied from the unit test.
provider "tencentcloud" {}
resource "tencentcloud_cam_user" "test_user" {
name = "test-user"
remark = "test"
console_login = true
use_api = true
need_reset_password = true
password = "Gail@1234"
phone_num = "13631555963"
country_code = "86"
email = "[email protected]"
}
resource "tencentcloud_cam_policy" "test-policy" {
name = "test-policy"
document = "{\"version\":\"2.0\",\"statement\":[{\"action\":[\"name/sts:AssumeRole\"],\"effect\":\"allow\",\"resource\":[\"*\"]}]}"
description = "test"
}
resource "tencentcloud_cam_user_policy_attachment" "user_policy_attachment_basic" {
user_id = "${tencentcloud_cam_user.test_user.id}"
policy_id = "${tencentcloud_cam_policy.test-policy.id}"
}
[TencentCloudSDKError] Code=ClientError.ParseJsonError, Message=Fail to parse json content: {"Response":{"List":[{"PolicyId":28234817,"PolicyName":"osp-cos-cn-qa-readonly-access","AddTime":"2019-11-12 18:24:09","CreateMode":2,"Remark":"Data read access for OSP COS bucket.","OperateOwnerUin":"100009609937","OperateUin":"100009675879","OperateUinType":0,"PolicyType":""},{"PolicyId":28230226,"PolicyName":"rsp-cos-cn-qa-readwrite-access","AddTime":"2019-11-12 16:41:29","CreateMode":2,"Remark":"Data read write access for RSP COS bucket.","OperateOwnerUin":"100009609937","OperateUin":"100009675879","OperateUinType":0,"PolicyType":""}],"TotalNum":2,"RequestId":"54083b98-a843-4a33-9452-0b919d9b83ba"}}, because: json: cannot unmarshal string into Go struct field AttachPolicyInfo.Response.List.OperateOwnerUin of type uint64, RequestId=
user_policy_attachment being created and state being refreshed.
user_policy_attachment is created, but not exit normally and the user_policy_attachment is not
terraform apply
Not sure if it is because the OperateOwnerUin is string in http response, and it is expected to put in a unit64 field.
provider version: 1.11
issue:
tencentcloud_eip_association completed successfully but actually eip was not bind to instance.
tencentcloud_eip_association.test: Creation complete after 4s (ID: eip-m41t20x6::ins-g1y9urdw)
Should "create" function check bind status after bind request submitted in https://github.com/terraform-providers/terraform-provider-tencentcloud/blob/master/tencentcloud/resource_tc_eip_association.go#L83-L96
? It should be async action.
I get issue when I run terraform destroy, in the case I have two vms with sshkey.
# terraform -v
Terraform v0.12.13
+ provider.tencentcloud v1.22.0
create two CVM with sshkey, then run terraform destroy
Destroy success.
CVM can be destroy, but sshkey destroy failed with the following error:
Error: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-imyqycsv', 'ins-2o89fojz']` is not found., RequestId=457cd512-2d34-45e9-99df-376c67f9ad8b
if you run terraform destroy again, it can success.
Write a tf which create 2 CVM with sshkey, then terraform apply, terraform destroy can 100% reproduce this issue.
There is work around which can avoid this issue with limit parallelism to 1 when destroy.
The issue seems like when the code in destroy key pair try to unbind with CVM, but the VM has been deleted. Seems like something wrong here:
https://github.com/terraform-providers/terraform-provider-tencentcloud/blob/master/tencentcloud/resource_tc_key_pair.go#L185-L196
When I use terraform to boot spot vm, it get the following error, I can use the same size/image to boot in the same az on console:
Error: [TencentCloudSDKError] Code=InvalidInstanceChargeType.OnlySupportedForSpot, Message=The instance charge type SPOTPAID is only supported for spot user., RequestId=9c115e8d-c9c6-4c26-89c2-8197647c5d9e
Any plan to support terraform module? AliCloud, AWS, Azure, Google has support some, any plan?
provider version: 1.11
no matter true
or false
of allocate_public_ip defined in tencentcloud_instance, after instance created, and execute terraform apply again, it will update allocate_public_ip: "true" => "false"
, and it cannot be updated.
~ tencentcloud_instance.test
allocate_public_ip: "true" => "false"
* tencentcloud_instance.test: 1 error(s) occurred:
* tencentcloud_instance.test: tencentcloud_instance update on allocate_public_ip is not supported yet
Additional information: my instance has eip associated after created, I'm not sure if provider detected this as public_ip?
from @zqfan :
when acc test fail it might cause resource not be deleted correctly, hence it will block subsequential acc test, we need to clean them in a right manner
from:https://github.com/tencentyun/terraform-provider-tencentcloud/issues/39
With 16 or more tencentcloud_security_group_rule defined, all attempts at apply result in the following error:
Error: Error applying plan:
1 error(s) occurred:
* tencentcloud_instance.default: 1 error(s) occurred:
* tencentcloud_instance.default: tencentcloud_instance got error, code:InternalError, message:An internal error has occurred. Retry your request, but if the problem persists, contact us with details by posting a message on the Tencent cloud forums.
This limit includes inactive rules with count = 0
.
tf.json配置文件:
{
"provider": {
"tencentcloud": {
"region": "ap-shanghai",
"secret_id": "xxxx",
"secret_key": "xxxxx"
}
},
"resource": {
"tencentcloud_instance": {
"test": {
"allocate_public_ip": "true",
"availability_zone": "ap-shanghai-2",
"count": "1",
"data_disks": [
{
"data_disk_size": "50",
"data_disk_type": "CLOUD_PREMIUM"
}
],
"image_id": "img-6ns5om13",
"instance_charge_type": "PREPAID",
"instance_charge_type_prepaid_period": 1,
"instance_name": "test",
"instance_type": "S2.SMALL1",
"internet_charge_type": "TRAFFIC_POSTPAID_BY_HOUR",
"internet_max_bandwidth_out": 200,
"password": "xxxxxxx",
"project_id": "xxxxx",
"security_groups": [
"xxxxxx"
],
"system_disk_size": "50",
"system_disk_type": "CLOUD_PREMIUM"
}
}
}
创建服务器后发现没有自动续费,查看文档后发现了“instance_charge_type_prepaid_renew_flag”这个参数,配置文件加上"instance_charge_type_prepaid_renew_flag : "true"或者"instance_charge_type_prepaid_renew_flag : "enabled""后报错,错误信息:
Error: invalid instance_charge_type_prepaid_period: true
请问如何设置自动续费呢?
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp
terraform apply
Currently only EIPs created in the Tencent Console allow enabling anycast, there's no option in terraform
Error: tencentcloud_instance.k8s-worker-streaming[0]: not found instance_type_family: S4
TF provider代码中限制了数据盘大小为50G-16000G,但是腾讯官网console中可以创建10G的磁盘,
云硬盘的容量,规格大小如下:
普通云硬盘:10GB - 16000GB
高性能云硬盘:10GB - 16000GB
SSD 云硬盘:100GB - 16000GB
https://cloud.tencent.com/document/product/362/5744
terraform-provider-tencentcloud/tencentcloud/resource_tc_instance.go
"data_disk_size": {
Type: schema.TypeInt,
Required: true,
ValidateFunc: validateIntegerInRange(50, 16000),
Description: "Size of the system disk. Value range: [50, 16000], and unit is GB.",
},
The parameter instance_charge_type_prepaid_renew_flag describes not detailed
instance_charge_type_prepaid_renew_flag - (Optional) When enabled, the CVM instance will be renew automatically when it reach the end of the prepaid tenancy, Valid values are NOTIFY_AND_AUTO_RENEW, NOTIFY_AND_MANUAL_RENEW,DISABLE_NOTIFY_AND_MANUAL_RENEW NOTE: it only works when instance_charge_type is set to PREPAID,if the parameter is specified as NOTIFY_AND_AUTO_RENEW, if the account balance is sufficient, the instance will be automatically renewed on a monthly basis after the instance expires.
from @balboah :
When specifying an tencentcloud_container_cluster_instance resource, you can set the instance_type.
This per definition also defines which CPU and RAM resources the instance will have, it should not be required to also specify that as an attribute.
Also when specified like cpu = 4 and instance_type = I2.LARGE16, it will result in terraform detecting a change since the api will return a new value of cpu = 3920 at next apply.
The documentation for tencentcloud_clb_listener_rule attribute health_check_httpd_code is unclear:
health_check_http_code - (Optional) HTTP Status Code. The default is 31 and value range is 1-31. '0b0001' means the return value '1xx' is health. '0b0010' means the return value '2xx' is health. '0b0100' means the return value '3xx' is health. '0b1000' means the return value '4xx' is health. 0b10000 means the return value '5xx' is health. If you want multiple return codes to indicate health, need to add the corresponding values. NOTES: The 'HTTP' health check of the 'TCP' listener only supports specifying one health check status code. NOTES: Only supports listeners of 'HTTP' and 'HTTPS' protocol.
Error: Incorrect attribute value type
on ../../ICM/etc/Terraform/Tencent/Instance/infrastructure.tf line 500, in resource "tencentcloud_clb_listener_rule" "default":
500: health_check_http_code = "http_1xx"Inappropriate value for attribute "health_check_http_code": a number is
required.
Please support GAAP.
https://cloud.tencent.com/product/gaap
I can only configure GAAP on the console, and I feel very inconvenient.
It may be difficult because I can not find the GAAP tccli
or SDK or API.
By @lubars:
Upgraded Terraform and Tencentcloud plugin:
Terraform v0.12.5
- provider.null v2.1.2
- provider.tencentcloud v1.14.0
Still getting internal errors on roughly 25% of calls to terraform apply (this succeeded on the third try):
Error: [TencentCloudSDKError] Code=InternalError, Message=(bd6d22a359eb)An internal error has occurred. Retry your request, but if the problem persists, contact us with details by posting a message on the Tencent cloud forums., RequestId=5498c37c-ff95-4231-ab6c-bd6d22a359eb
on infrastructure.tf line 372, in resource "tencentcloud_cbs_storage" "data":
372: resource "tencentcloud_cbs_storage" "data" {
Still seeing errors on calls to terraform destroy as well:
Error: [TencentCloudSDKError] Code=ResourceBusy, Message=656e6c70-be4a-4657-aed1-95964abc0b7b,ins-ruv3rbzm is busy, please retry later (0afe54a64aa6), RequestId=a7e786f4-5c73-47e6-8d37-0afe54a64aa6
Please support CCN, thanks.
Support HAVIP in Terraform.
now user data should input base64 encrypted string, which is not convinent, considering aws implementation user user_data as raw user data input and user_data_64 as encrypted (which is oppoiste to API definition), we should support raw user data input as well
maybe support user_data_file for advanced users?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.