Невозможно обновить aurora-postgresql с 9.6.9 до 10.7 - PullRequest
0 голосов
/ 03 июня 2019

Я использую кластер AWS Aurora PostgreSQL с ядром aurora-postgresql 9.6.9 в одном экземпляре db.r4.large. Теперь я хочу обновить Aurora Postgresql до двигателя 10.7.

https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Upgrading.html

Документация AWS предполагает, что после модификации кластер БД должен выполнить свою задачу для обновления. Однако в выпадающем списке нет PostgreSQL, совместимого с 10.x.

Terraform: при изменении версии движка с 9.6.9 на 10.7 удаляет только текущий экземпляр 9.6.9 дБ из кластера, но не создает новый экземпляр 10.7 дБ.

resource "aws_rds_cluster" "test" {
...
  engine            = "aurora-postgresql"
  engine_version    = "10.7" # old 9.6.9
...

}
resource "aws_rds_cluster_instance" "test_cluster_instances" {
  count = 1
  cluster_identifier           = "${aws_rds_cluster.test.id}"
  instance_class               = "db.r4.large"
  engine                       = "aurora-postgresql"
  engine_version               = "10.7" # old 9.6.9
...
}

Терраформный план:

  ~ update in-place  
-/+ destroy and then create replacement  

Terraform will perform the following actions:  

  ~ aws_rds_cluster.test  
      engine_version:                  "9.6.9" => "10.7"  

-/+ aws_rds_cluster_instance.test_cluster_instances (new resource required)  
      id:                              "test-0" => <computed> (forces new resource)  
      apply_immediately:               "true" => "true"  
      arn:                             "arn:aws:rds:us-east-1:xxxxxx:db:test-0" => <computed>  
      auto_minor_version_upgrade:      "false" => "false"  
      availability_zone:               "us-east-1a" => <computed>  
      cluster_identifier:              "test" => "test"  
      copy_tags_to_snapshot:           "true" => "true"  
      db_parameter_group_name:         "default.aurora-postgresql9.6" <computed>  
      db_subnet_group_name:            "test_db" => "test_db"  
      dbi_resource_id:                 "db-QDIHAS6J2MLMVKHVUENDTFWQJE" => <computed>   
      endpoint:                        "xxxxx.us-east-1.rds.amazonaws.com" => <computed>  
      engine:                          "aurora-postgresql" => "aurora-postgresql"  
      engine_version:                  "9.6.9" => "10.7" (forces new resource)  
      identifier:                      "test-0" => "test-0"  
      identifier_prefix:               "" => <computed>  
      instance_class:                  "db.r4.large" => "db.r4.large"  
      kms_key_id:                      "" => <computed>  
      monitoring_interval:             "0" => "0"  
      monitoring_role_arn:             "" => <computed>  
      performance_insights_enabled:    "false" => "false"  
      performance_insights_kms_key_id: "" => <computed>  
      port:                            "5432" => <computed>  
      preferred_backup_window:         "03:00-04:00" => <computed>  
      preferred_maintenance_window:    "sun:03:00-sun:04:00" => "sun:03:00-sun:04:00"  
      promotion_tier:                  "0" => "0"  
      publicly_accessible:             "true" => "true"  
      storage_encrypted:               "false" => <computed>  
      tags.%:                          "1" => "1"  
      tags.instance:                   "test-0" => "test-0"  
      writer:                          "true" => <computed>  


Plan: 1 to add, 1 to change, 1 to destroy.  

При запуске terraform apply появились следующие ошибки:

aws_rds_cluster.test: Modifying... (ID: test)
  engine_version: "9.6.9" => "10.7"
aws_rds_cluster_instance.test_cluster_instances: Still destroying... (ID: test-0, 10s elapsed)
aws_rds_cluster_instance.test_cluster_instances: Still destroying... (ID: test-0, 3m40s elapsed)
aws_rds_cluster_instance.test_cluster_instances: Still destroying... (ID: test-0, 3m50s elapsed)
...
...
aws_rds_cluster_instance.test_cluster_instances: Destruction complete after 3m54s


Error: Error applying plan:

1 error(s) occurred:


* aws_rds_cluster.test: 1 error(s) occurred:

* aws_rds_cluster.test: Failed to modify RDS Cluster (test): InvalidParameterCombination: Cannot upgrade aurora-postgresql from 9.6.9 to 10.7
    status code: 400, request id: c24c4c06-3d98-4ca3-ae95-bf3fd4150959
...