본문 바로가기

개발하자

테라폼이 rds 클러스터의 매개변수 그룹을 계속 업데이트하는 이유는 무엇입니까?

반응형

테라폼이 rds 클러스터의 매개변수 그룹을 계속 업데이트하는 이유는 무엇입니까?

테라폼 0.13과 최신 AWS 제공자 버전을 사용하고 있는데 각 플랜마다 aws_rds_cluster_parameter_group 리소스를 업데이트하고 적용합니다. 왜 그런지 알아?

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place
Terraform will perform the following actions:
  # aws_rds_cluster_parameter_group.data_db_parameters will be updated in-place
  ~ resource "aws_rds_cluster_parameter_group" "data_db_parameters" {
        arn         = "arn:aws:rds:ap-southeast-2:111111111111:cluster-pg:dev1-data-persistence-rds-pg"
        description = "Managed by Terraform"
        family      = "aurora-postgresql13"
        id          = "dev1-data-persistence-rds-pg"
        name        = "dev1-data-persistence-rds-pg"
        tags        = {}
        tags_all    = {}
        parameter {
            apply_method = "immediate"
            name         = "rds.force_ssl"
            value        = "1"
        }
      + parameter {
          + apply_method = "immediate"
          + name         = "ssl"
          + value        = "1"
        }
    }
Plan: 0 to add, 1 to change, 0 to destroy.



이러한 고스트 업데이트는 해결책이 없는 GH에 대해 아직 공개되지 않은 3년 된 문제에서 입증되듯이 알려진 오랜 문제입니다.

0.13은 매우 오래된 버전이므로 TF 업데이트를 시도할 수 있습니다. 도움이 될 경우 설정하고 시도할 수도 있습니다. 아무 것도 효과가 없다면, 그것에 대해 당신이 할 수 있는 것은 많지 않다. AWS 공급자 및/또는 TF 내부 문제입니다.




Aurora mysql을 5.6에서 5.7로 업그레이드할 때 비슷한 일이 발생했습니다. 모든 계획 출력에 다시 나타납니다.

그러나 기본 매개 변수 그룹의 구성 값이 5.6에서 5.7(TABLE에서 FILE로)로 변경되었습니다. 변경사항이 없어 AWS API가 빈 상태로 돌아오고 TF 상태가 업데이트되지 않아 계속 반복합니다.

따라서: 이 경우 TF 코드에서 매개 변수를 제거하고 기본값으로 유지하는 것이 해결책이었습니다.

    # plan output example
    + parameter {
          + apply_method = "immediate"
          + name         = "log_output"
          + value        = "FILE"
        }

반응형