Hi All,
I have a basic "aws_db_instance" resource that I created using a certain instance type. I have since tried to change its instance type and it doesn't seem to be refreshing. Even though the apply output seems to suggest it has been changed.
0.7.2
resource "aws_db_instance" "rds_mysql_database" {
allocated_storage = 10
engine = "mysql"
instance_class = "db.t2.micro"
username = "myadmin"
password = "${var.db_password}"
db_subnet_group_name = "${aws_db_subnet_group.database_subnet_group.id}"
multi_az = "false"
}
The plan:
~ aws_db_instance.rds_mysql_database
instance_class: "db.t1.micro" => "db.t2.micro"
Plan: 0 to add, 1 to change, 0 to destroy.
The apply:
aws_db_instance.rds_mysql_database: Modifying...
instance_class: "db.t1.micro" => "db.t2.micro"
aws_db_instance.rds_mysql_database: Still modifying... (10s elapsed)
aws_db_instance.rds_mysql_database: Still modifying... (20s elapsed)
aws_db_instance.rds_mysql_database: Still modifying... (30s elapsed)
aws_db_instance.rds_mysql_database: Still modifying... (40s elapsed)
aws_db_instance.rds_mysql_database: Still modifying... (50s elapsed)
aws_db_instance.rds_mysql_database: Modifications complete
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.
Hi @bernielomax
please can you tell me if you are using the apply_immediately flag?
Paul
Hey Paul (@stack72)
No I am not actually. Could that be it? The update request has been accepted and its now in the hands of AWS?
Hi @bernielomax
this is almost _Certainly_ the issue. If you do not supply that value, RDS will wait until the next maintenance window to apply the update. Therefore, when Terraform reads the current state of the infrastructure, it will see that it is still showing db.t1.micro and then believe it has to change it to db.t2.micro
Please read the documentation for the notes to be aware of when using apply_immediately
Let me know if this solves your issue
Paul
Hi @bernielomax
I haven't heard back from you on this - I am going to close this out for now. If this is still an issue then please do let me know
Paul
Is the requests queued up in Amazon RDS then? Where can we see this pending change?
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hi @bernielomax
please can you tell me if you are using the
apply_immediatelyflag?Paul