-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-template.env
More file actions
186 lines (140 loc) · 7.5 KB
/
config-template.env
File metadata and controls
186 lines (140 loc) · 7.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# MongoDB Production → Staging Sync - Configuration Template
#
# This file contains all environment-specific configuration with placeholders.
# Copy this file and replace placeholders with your actual values.
#
# ⚠️ SECURITY WARNING:
# - Never commit actual credentials to version control
# - Use GitHub Secrets for sensitive values in CI/CD
# - Use environment variables or parameter stores for local execution
#
# ============================================================================
# AWS Configuration
# ============================================================================
# AWS Region where your infrastructure is deployed
AWS_REGION=us-west-PLACEHOLDER # Example: us-west-2, us-east-1
# AWS Credentials (NEVER commit real values - use GitHub Secrets)
AWS_ACCESS_KEY_ID=AKIA________________ # 20 characters, starts with AKIA
AWS_SECRET_ACCESS_KEY=________________ # 40 characters
# IAM Role ARN (if using role assumption instead of keys)
AWS_ROLE_ARN=arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME
# ============================================================================
# EC2 Instance Configuration
# ============================================================================
# Production MongoDB Instance
PROD_INSTANCE_ID=i-XXXXXXXXXXXXXXXXX # 17 characters, format: i-0123456789abcdef0
PROD_INSTANCE_NAME=MongoDB-production-PLACEHOLDER
PROD_PRIVATE_IP=10.0.X.X # Private IP address
PROD_AVAILABILITY_ZONE=us-west-2a # Must match AWS_REGION
# Staging MongoDB Instance
STAGING_INSTANCE_ID=i-YYYYYYYYYYYYYYYYY # 17 characters, format: i-0123456789abcdef0
STAGING_INSTANCE_NAME=MongoDB-staging-PLACEHOLDER
STAGING_PRIVATE_IP=10.0.Y.Y # Private IP address
STAGING_AVAILABILITY_ZONE=us-west-2a # Must match AWS_REGION
# ============================================================================
# EBS Volume Configuration
# ============================================================================
# Production Data Volume
PROD_VOLUME_ID=vol-XXXXXXXXXXXXXXXXX # 21 characters, format: vol-0123456789abcdef0
PROD_VOLUME_SIZE=20 # Size in GB
PROD_VOLUME_DEVICE=/dev/sdf # Device name (usually /dev/sdf)
# Staging Data Volume (current/old)
STAGING_VOLUME_ID=vol-YYYYYYYYYYYYYYYYY # Will be replaced during sync
STAGING_VOLUME_SIZE=20 # Should match PROD_VOLUME_SIZE
STAGING_VOLUME_DEVICE=/dev/sdf # Should match PROD_VOLUME_DEVICE
# ============================================================================
# MongoDB Configuration
# ============================================================================
# Database Name
MONGODB_DATABASE=userdb # Main database name
# Collection Name (for verification)
MONGODB_COLLECTION=users # Main collection name
# MongoDB Port
MONGODB_PORT=27017 # Default MongoDB port
# MongoDB Data Directory (on EC2 instances)
MONGODB_DATA_DIR=/data/mongodb # Mount point for EBS volume
# MongoDB User (system user, not DB user)
MONGODB_USER=mongod # Default: mongod
MONGODB_GROUP=mongod # Default: mongod
# ============================================================================
# GitHub Configuration
# ============================================================================
# GitHub Repository
GITHUB_OWNER=ORGANIZATION_OR_USERNAME # Your GitHub username or org name
GITHUB_REPO=REPOSITORY_NAME # Repository name
GITHUB_BRANCH=main # Branch to run workflow from
# GitHub Token (for API access - use GitHub Secrets)
GITHUB_TOKEN=ghp_____________________ # Starts with ghp_, gho_, or ghu_
# Self-Hosted Runner Configuration
RUNNER_LABELS=self-hosted,mongodb-staging # Comma-separated runner labels
RUNNER_NAME=mongodb-staging-runner # Runner display name
RUNNER_WORK_DIR=/home/ec2-user/actions-runner/_work
# ============================================================================
# Workflow Configuration
# ============================================================================
# Enable/Disable PII Anonymization
ANONYMIZE_DATA=true # true or false (default: true)
# Target Environment
TARGET_ENVIRONMENT=staging # staging, dev, qa (default: staging)
# Snapshot Retention
SNAPSHOT_RETENTION_DAYS=7 # Days to keep snapshots (0 = delete immediately)
# ============================================================================
# Script Paths (on staging EC2 instance)
# ============================================================================
# Mount Script
MOUNT_SCRIPT_PATH=/home/ec2-user/mount.sh
# Anonymization Script
ANONYMIZE_SCRIPT_PATH=/home/ec2-user/anonymize_data.js
# Setup Database Script (optional)
SETUP_DB_SCRIPT_PATH=/home/ec2-user/setup_db.js
# ============================================================================
# SSH Configuration (if needed for manual access)
# ============================================================================
# SSH Key Path (local path, not for GitHub Actions)
SSH_KEY_PATH=~/.ssh/id_rsa_aws_PLACEHOLDER.pem
SSH_USER=ec2-user # Default: ec2-user for Amazon Linux
# SSH Bastion Host (if using)
BASTION_HOST=bastion.example.com # Leave empty if direct SSH access
BASTION_PORT=22
# ============================================================================
# Tagging Configuration
# ============================================================================
# Tags applied to created AWS resources
TAG_ENVIRONMENT=staging # Environment tag
TAG_PROJECT=mongodb-replication # Project name
TAG_TEAM=devops # Team responsible
TAG_COST_CENTER=engineering # Cost center for billing
# ============================================================================
# Monitoring & Alerts (optional)
# ============================================================================
# Slack Webhook for notifications (optional)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
# Email for notifications (optional)
NOTIFICATION_EMAIL=devops@example.com
# CloudWatch Log Group
CLOUDWATCH_LOG_GROUP=/aws/ec2/mongodb-sync
# ============================================================================
# Validation & Verification
# ============================================================================
# Expected document count range (for alerting)
MIN_EXPECTED_DOCUMENTS=1 # Minimum documents expected
MAX_EXPECTED_DOCUMENTS=1000000 # Maximum documents expected
# Timeout values (seconds)
SNAPSHOT_TIMEOUT=900 # 15 minutes
VOLUME_ATTACH_TIMEOUT=60 # 1 minute
MONGODB_START_TIMEOUT=120 # 2 minutes
# ============================================================================
# Advanced Options
# ============================================================================
# EBS Volume Type
VOLUME_TYPE=gp3 # gp3, gp2, io1, io2
# EBS Encryption
VOLUME_ENCRYPTED=true # true or false (recommended: true)
# KMS Key ID (if using custom encryption key)
KMS_KEY_ID=arn:aws:kms:REGION:ACCOUNT:key/KEY_ID # Leave empty for default key
# Multi-AZ (if using availability zone failover)
ENABLE_MULTI_AZ=false # true or false
# Terraform Backend Configuration (if using remote state)
TERRAFORM_BACKEND_BUCKET=terraform-state-PLACEHOLDER
TERRAFORM_STATE_KEY=mongodb/staging/terraform.tfstate
TERRAFORM_DYNAMODB_TABLE=terraform-locks-PLACEHOLDER