Terraform 不接受allow_major_version_upgrade

问题描述 投票:0回答:2

我有以下rds定义:

resource "aws_db_instance" "my-rds" {
  allocated_storage    = 20
  engine               = "mysql"
  engine_version       = "5.5.57"
  instance_class       = "db.t2.micro"
  identifier           = "my-db"
  name                 = "somename"
  username             = "${var.RDS_USERNAME}"   # username
  password             = "${var.RDS_PASSWORD}" # password
  db_subnet_group_name = "${aws_db_subnet_group.some-subnet-group.name}"
  parameter_group_name = "${aws_db_parameter_group.some-rds-parameter-group.name}"
  multi_az             = "false"
  vpc_security_group_ids = ["${aws_security_group.some-sg.id}"]
  storage_type         = "gp2"
  skip_final_snapshot = true
  backup_retention_period = 30    # how long we re going to keep your backups
  availability_zone = "${aws_subnet.some-private-1.availability_zone}"
  tags {
      Name = "some-tag-name"
  }

}

所以我只是补充:

allow_major_version_upgrade = true

...并且得到

Error: Error applying plan:

1 error(s) occurred:

* aws_db_instance.my-rds: 1 error(s) occurred:

* aws_db_instance.my-rds: Error modifying DB Instance my-db: InvalidParameterCombination: No modifications were requested
    status code: 400, request id: 2aed626f-6063-4b69-ac37-654bd783fd37

amazon-rds terraform
2个回答
3
投票

这可能与 this github 问题或 this 一个或其他类似问题有关。待修改与立即应用相比似乎存在问题。例如,如果我像您的问题一样设置一个数据库并尝试设置

allow_major_version_upgrade = true
,它会在第一次运行时失败并出现相同的错误,但更改发生并且再次运行应用没有挂起的更改。但是,如果我还设置了
apply_immediately = true
,它可以在第一次运行时正常运行,不会出现错误。

此外,当尝试重现此问题时,我注意到无效参数也会产生此错误,例如在更改

engine_version
时尝试指定不存在的引擎版本。


0
投票

对于新的主要发布版本升级,您需要使用新的参数组和选项组 资源“aws_db_parameter_group”“这个” 资源“aws_db_option_group”“这个”

© www.soinside.com 2019 - 2024. All rights reserved.