Skip to content

Commit

Permalink
remove count
Browse files Browse the repository at this point in the history
  • Loading branch information
crlssn committed Nov 12, 2024
1 parent aaff6cc commit a4a8ae6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion infra/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ resource "aws_db_instance" "db" {
password = var.db_password # Master password
parameter_group_name = "default.postgres16" # Parameter group for PostgreSQL 16
skip_final_snapshot = true # Skips the final snapshot on deletion
count = 1

# VPC & Subnet group settings
db_subnet_group_name = aws_db_subnet_group.default.name
Expand Down
11 changes: 5 additions & 6 deletions infra/s3.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
resource "aws_s3_bucket" "vue_js_bucket" {
bucket = var.bucket_name
count = 1

lifecycle {
prevent_destroy = true
}
}

resource "aws_s3_bucket_website_configuration" "vue_js_bucket" {
bucket = aws_s3_bucket.vue_js_bucket[0].id
bucket = aws_s3_bucket.vue_js_bucket.id

index_document {
suffix = "index.html"
Expand All @@ -20,7 +19,7 @@ resource "aws_s3_bucket_website_configuration" "vue_js_bucket" {
}

resource "aws_s3_bucket_policy" "public_access" {
bucket = aws_s3_bucket.vue_js_bucket[0].id
bucket = aws_s3_bucket.vue_js_bucket.id

policy = jsonencode({
Version = "2012-10-17",
Expand All @@ -29,16 +28,16 @@ resource "aws_s3_bucket_policy" "public_access" {
Effect = "Allow"
Principal = "*"
Action = ["s3:GetObject"]
Resource = ["${aws_s3_bucket.vue_js_bucket[0].arn}/*"]
Resource = ["${aws_s3_bucket.vue_js_bucket.arn}/*"]
}
]
})
}

output "bucket_name" {
value = aws_s3_bucket.vue_js_bucket[0].bucket
value = aws_s3_bucket.vue_js_bucket.bucket
}

output "bucket_website_endpoint" {
value = aws_s3_bucket.vue_js_bucket[0].website_endpoint
value = aws_s3_bucket.vue_js_bucket.website_endpoint
}

0 comments on commit a4a8ae6

Please sign in to comment.