Open djluo opened 2 years ago
Can anyone on the Terraform team check this? I believe this bug still exists.
@djluo thx for your feedback. The provider always stores egress and ingress configs after “apply” operation unless the config is without a port.
So...the root cause is your egress/ingress protocol specified by ALL with no port. The provider will not store the egress/ingress in that case.
Workaround: Using the specified protocol and port. eg: ingress = [ "ACCEPT#192.168.1.0/24#80#TCP", "ACCEPT#192.168.1.0/24#80-90#TCP", ] egress = [ "ACCEPT#192.168.1.0/24#80#TCP", "ACCEPT#192.168.1.0/24#80-90#TCP", ]
We will evaluate removing this port constraint in this scenario.
@lyu571 That would be great if the constraint could be removed. The extra output always makes a lot of noise in many senses.
After a quick glance, we found that the vpc query interface return two default configs every time, which will cause the diff in tf plan/apply operation. So, the constraint of the port is used to filter these configs and then avoid this unexpected diff.
In other words, this constraint will be retained until an effective method to filter these default configs. Or, optimization from the vpc interface(Tencent cloud SDK).
Community Note
Terraform Version
Terraform v1.2.2 on darwin_amd64 provider registry.terraform.io/tencentcloudstack/tencentcloud v1.72.7
Affected Resource(s)
Terraform Configuration Files
Plan Always output
Panic Output
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform apply
terraform plan
terraform apply
terraform plan
猜测
egress、ingress规则并没有保存到 terraform.tfstate中。 plan、apply就一直重复操作它了。