From a4a8ae6dfc74bdbf90d1dcf700b67681361c734c Mon Sep 17 00:00:00 2001 From: Christian Carlsson Date: Tue, 12 Nov 2024 19:05:49 +0000 Subject: [PATCH] remove count --- infra/db.tf | 1 - infra/s3.tf | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/infra/db.tf b/infra/db.tf index 34861fd8..a61f450c 100644 --- a/infra/db.tf +++ b/infra/db.tf @@ -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 diff --git a/infra/s3.tf b/infra/s3.tf index fe1cab80..12b3d52d 100644 --- a/infra/s3.tf +++ b/infra/s3.tf @@ -1,6 +1,5 @@ resource "aws_s3_bucket" "vue_js_bucket" { bucket = var.bucket_name - count = 1 lifecycle { prevent_destroy = true @@ -8,7 +7,7 @@ resource "aws_s3_bucket" "vue_js_bucket" { } 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" @@ -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", @@ -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 }