Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions terraform/modules/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "aws_instance" "mongodb" {
volume_size = var.mongodb_data_volume_size
volume_type = "gp3"
encrypted = true
delete_on_termination = false
delete_on_termination = true
}

user_data = <<-EOF
Expand Down Expand Up @@ -102,11 +102,11 @@ resource "aws_instance" "mongodb" {
# Set ownership to mongodb user (will be created during installation)
echo "MongoDB data volume mounted at /data/mongodb"

# Add MongoDB repository (using Amazon Linux 2 repo which is compatible)
# Add MongoDB repository (using RHEL 9 repo for Amazon Linux 2023 compatibility)
cat > /etc/yum.repos.d/mongodb-org-7.0.repo <<'REPO'
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/7.0/x86_64/
baseurl=https://repo.mongodb.org/yum/redhat/9/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
Expand Down
Loading