Skip to content

Commit

Permalink
Adding parameter group to set utf8 character sets
Browse files Browse the repository at this point in the history
  • Loading branch information
twerthi committed Aug 19, 2022
1 parent f8540fd commit 05b85de
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions octopus-samples-instances/aws-base-infrastructure-terraform/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ resource "aws_db_subnet_group" "samples_rds_subnet_group" {
subnet_ids = aws_subnet.solutions-public-sb.*.id
}

resource "aws_db_parameter_group" "solutions_mariadb" {
name = "solutions_mariadb"
family = "mariadb10.6"
parameter {
name = "character_set_server"
value = "utf8"
}

parameter {
name = "character_set_client"
value = "utf8"
}
}

resource "aws_db_instance" "mariadb_rds_instance" {
allocated_storage = 10
Expand All @@ -15,6 +28,21 @@ resource "aws_db_instance" "mariadb_rds_instance" {
skip_final_snapshot = true
db_subnet_group_name = aws_db_subnet_group.samples_rds_subnet_group.name
vpc_security_group_ids = [aws_security_group.samples_security_group.id]
parameter_group_name = aws_db_parameter_group.solutions_mariadb.name
}

resource "aws_db_parameter_group" "solutions_mysql" {
name = "solutions_mysql"
family = "mysql8.0"
parameter {
name = "character_set_server"
value = "utf8"
}

parameter {
name = "character_set_client"
value = "utf8"
}
}

resource "aws_db_instance" "mysql_rds_instance" {
Expand All @@ -28,6 +56,21 @@ resource "aws_db_instance" "mysql_rds_instance" {
skip_final_snapshot = true
db_subnet_group_name = aws_db_subnet_group.samples_rds_subnet_group.name
vpc_security_group_ids = [aws_security_group.samples_security_group.id]
parameter_group_name = aws_db_parameter_group.solutions_mysql.name
}

resource "aws_db_parameter_group" "solutions_postgresql" {
name = "solutions_postgresql"
family = "postgres14"
parameter {
name = "character_set_server"
value = "utf8"
}

parameter {
name = "character_set_client"
value = "utf8"
}
}

resource "aws_db_instance" "postgresql_rds_instance" {
Expand All @@ -41,6 +84,7 @@ resource "aws_db_instance" "postgresql_rds_instance" {
skip_final_snapshot = true
db_subnet_group_name = aws_db_subnet_group.samples_rds_subnet_group.name
vpc_security_group_ids = [aws_security_group.samples_security_group.id]
parameter_group_name = aws_db_parameter_group.solutions_postgresql.name
}

resource "aws_db_instance" "mssql_rds_instance" {
Expand Down

0 comments on commit 05b85de

Please sign in to comment.