create s3 bucket for backups of db.dev

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-07-31 15:23:31 -04:00
parent c895c1a4a6
commit 002cfd4ef2
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 11 additions and 1 deletions

View File

@ -33,6 +33,6 @@ mongodb_backup_db_user: '{{ mongodb_users[0].name }}'
mongodb_backup_db_pass: '{{ mongodb_users[0].password }}'
# backup uploads to S3
mongodb_backup_bucket_name: 's3://dev-dap-ps-mongodb-backups'
mongodb_backup_bucket_name: 's3://dev-dap-ps-db-backups'
mongodb_backup_access_key: '{{lookup("passwordstore", "cloud/aws/s3/mongodb-backups/access-key")}}'
mongodb_backup_secret_key: '{{lookup("passwordstore", "cloud/aws/s3/mongodb-backups/secret-key")}}'

6
dev.tf
View File

@ -27,6 +27,12 @@ locals {
}
}
module "dev_db_bucket" {
source = "./modules/aws-s3-bucket"
bucket_name = "dev-dap-ps-db-backups"
description = "Bucket for MongoDB backups on db.dev"
}
module "dev_db" {
source = "./modules/aws-ec2-instance"
groups = ["mongodb"]

View File

@ -20,6 +20,10 @@ resource "aws_s3_bucket" "main" {
Desc = var.description
}
lifecycle {
prevent_destroy = true
}
policy = <<EOF
{
"Version": "2012-10-17",