CMDB-Server/ec2-user/mysql/rds.tf

31 lines
949 B
Terraform
Raw Permalink Normal View History

2025-07-03 17:24:43 +09:00
# ---------------------------
# RDS
# ---------------------------
# RDSインスタンスの作成
resource "aws_db_instance" "ansible_rds" {
identifier = "ansible-rds"
# インスタンスクラス、ストレージサイズの指定
instance_class = "db.t3.micro"
allocated_storage = 20
# DBサブネットグループの指定
db_subnet_group_name = "jenkins-db-subnet-group"
# セキュリティグループの指定
vpc_security_group_ids = [
"sg-007ef3c5be8c5e086"
]
# DBエンジンの指定
engine = "mysql"
engine_version = "8.0.35"
# DB情報の設定
db_name = "mysql"
username = "admin"
password = "passw0rd!"
# 設定変更の即時反映
apply_immediately = true
# DB削除時にスナップショットを作成しない
skip_final_snapshot = true
# バックアップ保持期間0に設定すると自動バックアップ無効
backup_retention_period = "10"
}