Reputation: 1456
I have Terraform invoked from GitHub workflow, and one of the steps in the same is an RDS update. The backend for the state is an S3 bucket. Terraform correctly reflects the status of updates (see log below), but the changes to the RDS Database instance are not reflected at all.
Below is the output of the terraform apply operation -
I also noticed the state file is not updated back to S3. Interestingly, if I change the name of the instance, which forces destroy and re-create, terraform does its work as expected.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_db_instance.app_db will be updated in-place
~ resource "aws_db_instance" "app_db" {
id = "app-tf-rds"
~ instance_class = "db.t3.medium" -> "db.t3.small"
name = "myappdb"
# (57 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
aws_db_instance.app_db: Modifying... [id=app-tf-rds]
aws_db_instance.app_db: Still modifying... [id=app-tf-rds, 10s elapsed]
aws_db_instance.app_db: Still modifying... [id=app-tf-rds, 20s elapsed]
aws_db_instance.app_db: Still modifying... [id=app-tf-rds, 31s elapsed]
aws_db_instance.app_db: Modifications complete after 32s [id=app-tf-rds]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
Any recommendations on what's going here are helpful!
Upvotes: 3
Views: 2783
Reputation: 16775
aws_db_instance
resource has a optional attribute named apply_immediately
. The default value of this is set to false
. In order for your changes to be applied immediately, you should set this to true
. Otherwise, the changes for the database will be applied only during the next maintenance window.
Upvotes: 9