Skip to content

Commit

Permalink
use existing bucket for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tkjwa committed Jan 13, 2023
1 parent 2e08b68 commit 28c222b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 36 deletions.
4 changes: 4 additions & 0 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ data "aws_subnets" "private_apps" {
}
}

data "aws_s3_bucket" "aws_bucket" {
bucket = var.aws_bucket_id
}

data "aws_region" "current" {}

data "aws_caller_identity" "current" {}
Expand Down
34 changes: 0 additions & 34 deletions logs-bucket.tf

This file was deleted.

2 changes: 1 addition & 1 deletion security-groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "aws_security_group" "beanstalk_instances_security_group" {
vpc_id = var.vpc_id

tags = {
Name = "${terraform.workspace}-beanstalk-instances"
Name = "${var.env_name}-beanstalk-instances"
}
}

Expand Down
2 changes: 1 addition & 1 deletion settings.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ locals {
{
namespace = "aws:elbv2:loadbalancer"
name = "AccessLogsS3Bucket"
value = aws_s3_bucket.aws_logs_bucket.id
value = data.aws_s3_bucket.aws_bucket.id
},
{
namespace = "aws:elbv2:loadbalancer"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ variable "instance_type" {
description = "An AWS instance type to use for the environment. Defaults to t4g.small for production environments and t4g.micro for non-production environments"
default = null
}

variable "aws_bucket_id" {
type = string
description = "Name of the S3 Bucket where AWS artifacts (mainly logs) can be written"
}

0 comments on commit 28c222b

Please sign in to comment.