terraform-provider-alicloud: RDS Alarms Error
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Run terraform -v
to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
→ terraform -v Terraform v0.11.11
Affected Resource(s)
Please list the resources as a list, for example:
- alicloud_cms_alarm
If this issue appears to affect multiple resources, it may be an issue with Terraform’s core, so please mention this.
Terraform Configuration Files
provider "alicloud" {
access_key = "**********"
secret_key = "**********"
region = "eu-central-1"
version = "1.30"
}
resource "alicloud_vpc" "vpc" {
name = "test"
cidr_block = "10.0.0.0/8"
}
resource "alicloud_vswitch" "vsw" {
vpc_id = "${alicloud_vpc.vpc.id}"
cidr_block = "10.0.0.0/24"
availability_zone = "eu-central-1a"
name = "rds_subnet"
}
resource "alicloud_db_instance" "my_postgres" {
engine = "PostgreSQL"
engine_version = "10.0"
instance_type = "rds.pg.t1.small"
instance_storage = "20"
instance_name = "test_postgres"
zone_id = "eu-central-1MAZ1(a,b)" // in multi zones, the vswitch must be in one of the zones
vswitch_id = "${alicloud_vswitch.vsw.id}" // in multi zones, the vswitch must be in one of the zones
security_ips = ["${alicloud_vswitch.dmz.cidr_block}"]
}
//credentials for accessing the db
resource "alicloud_db_account" "my_postgres_account" {
instance_id = "${alicloud_db_instance.my_postgres.id}"
name = "blabla" //the account name cannot have capital letters
password = "*********"
description = "creds"
}
//backup policy
resource "alicloud_db_backup_policy" "default" {
instance_id = "${alicloud_db_instance.my_postgres.id}"
retention_period = 7
log_backup = true
log_retention_period = 7
}
resource "alicloud_cms_alarm" "cpu_alarm" {
name = "some_name"
project = "acs_rds_dashboard"
metric = "CpuUsage"
dimensions = {
instanceId = "${alicloud_db_instance.my_postgres.id}"
}
statistics ="Average"
period = 300
operator = ">"
threshold = 90
triggered_count = 1
contact_groups = ["some_group"]
notify_type = 0
enabled = true
}
resource "alicloud_vswitch" "dmz" {
vpc_id = "${alicloud_vpc.vpc.id}"
cidr_block = "10.0.1.0/24"
availability_zone = "eu-central-1b"
name = "dmz_subnet"
}
Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
This is not an issue with terraform itself. It is an issue with the provider.
Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log
.
There is no crash!
Expected Behavior
What should have happened? I shouldn’t get an error if I apply the same terraform script more than once! I shouldn’t get any changes in the plan if the resources did not change in the IAAS and my scripts did not change. This is not the case with: ‘notify_type’
Actual Behavior
What actually happened? Applying the same script more than once yields the following error:
* alicloud_cms_alarm.cpu_alarm: Updating alarm got an error: &errors.ServerError{httpStatus:400, requestId:"B0D06D44-77FC-4881-A2DD-C4F2D846B6FA", hostId:"metrics.cn-hangzhou.aliyuncs.com", errorCode:"MissingComparisonOperator", recommend:"https://error-center.aliyun.com/status/search?Keyword=MissingComparisonOperator&source=PopGw", message:"ComparisonOperator is mandatory for this action.", comment:""}
In addition, the result of plan after applying the script is not clean (without making any changes to the terraform code). The plan result will be something like:
alicloud_cms_alarm.cpu_alarm: Modifying... (ID: ************************)
notify_type: "1" => "0"
Although the notify_type was not changed…!
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform apply
again!
Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs? Running in a domestic Alicloud account.
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: NO
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 25 (8 by maintainers)
HI @philippthun The bug2 is related to product design and it need more time to fix. Please be patient. Thanks a lot.
HI @KrisPetkov This issue has been fixed and you can check it.