Open fatedier opened 3 years ago
Your feedback has been received. We will process it as soon as possible. Thank you for your trust and support of Alibaba Cloud!
@tiankai66 Could you confirm this is a bug?
Hello, I make a test in my env. it works fine. You make some mistake in the json: "route_name" "route_name", two route_name here and missing "," in the format. Thanks and best regards,
@tiankai66 It's just a copy mistake, not the root casuse. I will edit it to the correct one.
Any information i can provide to help you investigate this problem?
Sample code(default setting and using your json, result: success): resource "alicloud_log_project" "example" { name = "test-tf" description = "create by terraform" }
resource "alicloud_log_store" "example" { project = alicloud_log_project.example.name name = "tf-test-logstore" retention_period = 3650 shard_count = 3 auto_split = true max_split_shard_count = 60 append_meta = true }
resource "alicloud_logtail_config" "example" { project = alicloud_log_project.example.name logstore = alicloud_log_store.example.name input_type = "plugin" name = "ingress_istio" output_type = "LogService" input_detail = file("config.json") }
input_detail = file("config.json")
I'm not sure if this difference will affect the result?
Do you modify some content and update it? I also create success but update failed.
hi. nothing changes. if you want to fill the json in the input, full code as follow, works fine: resource "alicloud_log_project" "example" { name = "test-tf" description = "create by terraform" }
resource "alicloud_log_store" "example" { project = alicloud_log_project.example.name name = "tf-test-logstore" retention_period = 3650 shard_count = 3 auto_split = true max_split_shard_count = 60 append_meta = true }
resource "alicloud_logtail_config" "example" { project = alicloud_log_project.example.name logstore = alicloud_log_store.example.name input_type = "plugin" name = "ingress_istio" output_type = "LogService" input_detail = " { "plugin": { "inputs": [ { "detail": { "Stderr": true, "IncludeLabel": { "io.kubernetes.container.name": "istio-proxy" }, "Stdout": true }, "type": "service_docker_stdout" } ], "processors": [ { "detail": { "KeepSource": false, "NoMatchError": false, "Keys": [ "time_local", "method", "uri", "protocol", "response_code", "response_flags", "response_code_details", "connect_termination_details", "upstream_transport_fail_reason", "bytes_received", "bytes_sent", "duration", "upstream_service_time", "x_forwarder_for", "user_agent", "x_request_id", "host", "upstream_addr", "upstream_cluster", "upstream_local_addr", "downstream_local_addr", "downstream_remote_addr", "server_name", "route_name", "grpc_status" ], "SourceKey": "content", "Regex": "\[([^\s]+)\]\s+\"([^\s]+)\s+([^\s]+)\s+([^\s]+)\"\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+\"([^\"]+)\"\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+\"([^\"]+)\"\s+\"([^\"]+)\"\s+\"([^\"]+)\"\s+\"([^\"]+)\"\s+\"([^\"]+)\"\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s([^\s]+)\s+\"([^\"]+)\".*", "NoKeyError": true }, "type": "processor_regex" } ] } } " }
@tiankai66 Hi, i fixed this bug in https://github.com/aliyun/terraform-provider-alicloud/pull/3866, you can review it now.
@fatedier The input_detail format is wrong, the correct one should be
{ "inputs": [ { "detail": { "Stderr": true, "IncludeLabel": { "io.kubernetes.container.name": "istio-proxy" }, "Stdout": true }, "type": "service_docker_stdout" } ], "processors": [ { "detail": { "KeepSource": false, "NoMatchError": false, "Keys": [ "time_local", "method", "uri", "protocol", "response_code", "response_flags", "response_code_details", "connect_termination_details", "upstream_transport_fail_reason", "bytes_received", "bytes_sent", "duration", "upstream_service_time", "x_forwarder_for", "user_agent", "x_request_id", "host", "upstream_addr", "upstream_cluster", "upstream_local_addr", "downstream_local_addr", "downstream_remote_addr", "server_name", "route_name", "grpc_status" ], "SourceKey": "content", "Regex": "\\[([^\\s]+)\\]\\s+\"([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\"\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+\"([^\"]+)\"\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+\"([^\"]+)\"\\s+\"([^\"]+)\"\\s+\"([^\"]+)\"\\s+\"([^\"]+)\"\\s+\"([^\"]+)\"\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s([^\\s]+)\\s+\"([^\"]+)\".*", "NoKeyError": true }, "type": "processor_regex" } ] }
@HuiJing-C I'm not sure if it's wrong since i can create it successfully.
We should focus on why creating success but updating failed. I fixed this problem in #3866 and test it in my environment, it works fine.
@fatedier Okay, we will help fix the bug
@fatedier we have fixed in 1.133.0
@HuiJing-C Thanks for your feedback.
However, i'm really confused if this is an open source repo or just a place to store source codes. Why my fix PR hasn't been reviewed and you just fix it using same code as i write? This may be not polite.
Do you just keep your codes in an internal company repo and sync to github periodically. If so, you'd better describe it clearly in README, so other people won't misunderstand.
Terraform Version
v1.0.0
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
Update success.
Actual Behavior
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
to create a new alicloud_logtail_config.terraform plan
with no error.terraform apply
return the 400 error.