sample .tf file
# Create parameter group for mariadb
resource "aws_db_parameter_group" "db-pg" {
name = "test-mariadb10-1"
family = "mariadb10.1"
description = "mariadb parameter group for test project"
parameter {
name = "character-set-client-handshake"
value = "0"
}
parameter {
name = "character_set_client"
value = "utf8"
}
parameter {
name = "character_set_connection"
value = "utf8"
}
parameter {
name = "character_set_database"
value = "utf8"
}
parameter {
name = "character_set_results"
value = "utf8"
}
parameter {
name = "character_set_server"
value = "utf8"
}
parameter {
name = "log_bin_trust_function_creators"
value = "1"
}
parameter {
name = "max_allowed_packet"
value = "10240000"
}
parameter {
name = "skip-character-set-client-handshake"
value = "1"
}
}
terraform apply error
Error modifying DB Parameter Group: InvalidParameterCombination: cannot use immediate apply method for static parameter status code: 400
原因
DB再起動しないと適用できないパラメータの場合は、すぐ適用できないため、失敗する解決策
apply_methodの値をpending-rebootに設定する。デフォルトではImmediateになっている# Create parameter group for mariadb
resource "aws_db_parameter_group" "gmaridb-pg" {
name = "test-mariadb10-1"
family = "mariadb10.1"
description = "mariadb parameter group for test project"
parameter {
name = "character-set-client-handshake"
value = "0"
//default is immediate
apply_method = "pending-reboot"
}
parameter {
name = "character_set_client"
value = "utf8"
apply_method = "pending-reboot"
}
parameter {
name = "character_set_connection"
value = "utf8"
apply_method = "pending-reboot"
}
parameter {
name = "character_set_database"
value = "utf8"
apply_method = "pending-reboot"
}
parameter {
name = "character_set_results"
value = "utf8"
apply_method = "pending-reboot"
}
parameter {
name = "character_set_server"
value = "utf8"
apply_method = "pending-reboot"
}
parameter {
name = "log_bin_trust_function_creators"
value = "1"
apply_method = "pending-reboot"
}
parameter {
name = "max_allowed_packet"
value = "10240000"
apply_method = "pending-reboot"
}
parameter {
name = "skip-character-set-client-handshake"
value = "1"
apply_method = "pending-reboot"
}
}
この記事がお役にたちましたらシェアをお願いします:)
0 件のコメント:
コメントを投稿