31 lines
949 B
Terraform
31 lines
949 B
Terraform
|
# ---------------------------
|
|||
|
# 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"
|
|||
|
}
|