-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/infrastructure setup #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,10 +20,9 @@ terraform { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Remote state — S3 backend (run bootstrap first) | ||||||||||||||||||||||||||||||||||
| backend "s3" { | ||||||||||||||||||||||||||||||||||
| bucket = "serene-stay-tfstate" | ||||||||||||||||||||||||||||||||||
| key = "demo/terraform.tfstate" | ||||||||||||||||||||||||||||||||||
| bucket = "serene-stay-tfstate-ramesh-98" # <- මෙන්න මේ නම විතරක් වෙනස් කරන්න | ||||||||||||||||||||||||||||||||||
| key = "dev/terraform.tfstate" | ||||||||||||||||||||||||||||||||||
| region = "us-east-1" | ||||||||||||||||||||||||||||||||||
| encrypt = true | ||||||||||||||||||||||||||||||||||
| dynamodb_table = "serene-stay-tfstate-lock" | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
22
to
27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed The 🔒 Recommended fix backend "s3" {
bucket = "serene-stay-tfstate-ramesh-98" # <- මෙන්න මේ නම විතරක් වෙනස් කරන්න
key = "dev/terraform.tfstate"
region = "us-east-1"
+ encrypt = true
dynamodb_table = "serene-stay-tfstate-lock"
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,7 @@ resource "aws_db_instance" "main" { | |
| multi_az = false | ||
|
|
||
| # Backups | ||
| backup_retention_period = 3 | ||
| backup_retention_period = 1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Backup retention drop to 1 day weakens recovery guarantees and breaks the documented reliability contract. At Line 78, changing retention to 🤖 Prompt for AI Agents |
||
| backup_window = "03:00-04:00" | ||
| maintenance_window = "Mon:04:00-Mon:05:00" | ||
| copy_tags_to_snapshot = true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,16 +6,15 @@ | |
|
|
||
| locals { | ||
| name_prefix = "${var.project_name}-${var.environment}" | ||
| bucket_name = "${var.project_name}-uploads-${var.environment}" | ||
| } | ||
|
Comment on lines
7
to
9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win Unused The
Consider either removing the module's parameterization entirely (if single-use is intentional) or restoring variable-based naming for proper module reusability. ♻️ Option: Restore variable-based naming resource "aws_s3_bucket" "uploads" {
- bucket = "serene-stay-uploads-demo-ramesh-98"
+ bucket = "${local.name_prefix}-uploads"
tags = {
- Name = "serene-stay-uploads-demo-ramesh-98"
+ Name = "${local.name_prefix}-uploads"
}
}Similar change for Also applies to: 13-18 🤖 Prompt for AI Agents |
||
|
|
||
| # ── S3 Bucket ───────────────────────────────────────────────────────────────── | ||
| # ── S3 Bucket (Uploads) ─────────────────────────────────────────────────────── | ||
|
|
||
| resource "aws_s3_bucket" "uploads" { | ||
| bucket = local.bucket_name | ||
| bucket = "serene-stay-uploads-demo-ramesh-98" | ||
|
|
||
| tags = { | ||
| Name = local.bucket_name | ||
| Name = "serene-stay-uploads-demo-ramesh-98" | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -98,10 +97,10 @@ resource "aws_s3_bucket_cors_configuration" "uploads" { | |
| # ── Access Logging Bucket ───────────────────────────────────────────────────── | ||
|
|
||
| resource "aws_s3_bucket" "access_logs" { | ||
| bucket = "${local.bucket_name}-access-logs" | ||
| bucket = "serene-stay-uploads-demo-access-logs-ramesh-98" | ||
|
|
||
| tags = { | ||
| Name = "${local.bucket_name}-access-logs" | ||
| Name = "serene-stay-uploads-demo-access-logs-ramesh-98" | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -143,4 +142,4 @@ resource "aws_s3_bucket_logging" "uploads" { | |
| bucket = aws_s3_bucket.uploads.id | ||
| target_bucket = aws_s3_bucket.access_logs.id | ||
| target_prefix = "s3-access-logs/" | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provider version constraint is inconsistent with root module.
The bootstrap module specifies
~> 5.100.0whileterraform/main.tfuses~> 5.0. This could cause version drift or unexpected behavior if different provider versions are used between bootstrap and main infrastructure.Consider aligning both constraints, either by using
~> 5.100.0in both files or relaxing this to~> 5.0here as well.🤖 Prompt for AI Agents