Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: aws_rds_cluster_instance unexpected state when configuring enhanced monitoring #1743

Closed
pradeepbhadani opened this issue Sep 25, 2017 · 2 comments · Fixed by #1744

Comments

@pradeepbhadani
Copy link
Contributor

Hi there,
When configuring enhanced monitoring, getting the following error:

aws_rds_cluster_instance.rds-cluster.1: unexpected state 'configuring-enhanced-monitoring', wanted target 'available'. last error: %!s(<nil>)

code

resource "aws_rds_cluster_instance" "rds_instance" {
  identifier = "db-name"
  // ...
  monitoring_interval = "60"
  monitoring_role_arn = "arn:aws:iam::XXXXX:role/rds-monitoring-role"
}

Terraform Version

terraform version
Terraform v0.10.6

Affected Resource(s)

Please list the resources as a list, for example:

  • rds_cluster_instance

Terraform Configuration Files

resource "aws_rds_cluster_instance" "rds_instance" {
  identifier = "db-name"
  // ...
  monitoring_interval = "60"
  monitoring_role_arn = "arn:aws:iam::XXXXX:role/rds-monitoring-role"
}

Expected Behavior

Terraform should exit successfully after configuring enhanced monitoring

Actual Behavior

Terraform initiate enhanced monitoring but exit with an error. After a while, AWS console shows that "Enhanced Monitoring" is enabled.

Steps to Reproduce

  1. Create RDS cluster without monitoring_interval and monitoring_role_arn.
  2. update code to have enable Enhanced monitoring (by introducing monitoring_interval and monitoring_role_arn attribute).
  3. terraform apply fails here

NOTE: If you configure "enahanced monitoring" when you first create cluster, it works well (Probably because "creating" state is in list).

References

hashicorp/terraform#8699
RDS DB status : http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Status.html

@pradeepbhadani
Copy link
Contributor Author

Stacktrace

module.rds-test.aws_rds_cluster.rds-cluster: Modifications complete after 2s (ID: rds-cluster-X-rdstest)
module.rds-test.aws_rds_cluster_instance.rds-cluster[0]: Modifying... (ID: rds-cluster-X-rdstest-0)
  monitoring_interval: "0" => "15"
  monitoring_role_arn: "" => "arn:aws:iam::XXXXXXXXXXX:role/rds-mon-test"
module.rds-test.aws_rds_cluster_instance.rds-cluster[2]: Modifying... (ID: rds-cluster-X-rdstest-2)
  monitoring_interval: "0" => "15"
  monitoring_role_arn: "" => "arn:aws:iam::XXXXXXXXXXX:role/rds-mon-test"
module.rds-test.aws_rds_cluster_instance.rds-cluster[1]: Modifying... (ID: rds-cluster-X-rdstest-1)
  monitoring_interval: "0" => "15"
  monitoring_role_arn: "" => "arn:aws:iam::XXXXXXXXXXX:role/rds-mon-test"
module.rds-test.aws_rds_cluster_instance.rds-cluster.2: Still modifying... (ID: rds-cluster-X-rdstest-2, 10s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.0: Still modifying... (ID: rds-cluster-X-rdstest-0, 10s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.1: Still modifying... (ID: rds-cluster-X-rdstest-1, 10s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.2: Still modifying... (ID: rds-cluster-X-rdstest-2, 20s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.0: Still modifying... (ID: rds-cluster-X-rdstest-0, 20s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.1: Still modifying... (ID: rds-cluster-X-rdstest-1, 20s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.2: Still modifying... (ID: rds-cluster-X-rdstest-2, 30s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.0: Still modifying... (ID: rds-cluster-X-rdstest-0, 30s elapsed)
module.rds-test.aws_rds_cluster_instance.rds-cluster.1: Still modifying... (ID: rds-cluster-X-rdstest-1, 30s elapsed)
Error applying plan:

3 error(s) occurred:

* module.rds-test.aws_rds_cluster_instance.rds-cluster[1]: 1 error(s) occurred:

* aws_rds_cluster_instance.rds-cluster.1: unexpected state 'configuring-enhanced-monitoring', wanted target 'available'. last error: %!s(<nil>)
* module.rds-test.aws_rds_cluster_instance.rds-cluster[2]: 1 error(s) occurred:

* aws_rds_cluster_instance.rds-cluster.2: unexpected state 'configuring-enhanced-monitoring', wanted target 'available'. last error: %!s(<nil>)
* module.rds-test.aws_rds_cluster_instance.rds-cluster[0]: 1 error(s) occurred:

* aws_rds_cluster_instance.rds-cluster.0: unexpected state 'configuring-enhanced-monitoring', wanted target 'available'. last error: %!s(<nil>)

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.

@pradeepbhadani pradeepbhadani changed the title provider/aws: aws_rds_cluster_instance unexpected state when configurating enhanced monitoring provider/aws: aws_rds_cluster_instance unexpected state when configuring enhanced monitoring Sep 25, 2017
@ghost
Copy link

ghost commented Apr 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant