Skip to content

Commit

Permalink
Merge pull request #14 from QuiNovas/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
vchinnakotla authored Dec 9, 2021
2 parents 5708e8d + 6b79438 commit e724519
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
locals {
s3_log_bucket_name = "${var.name_postfix}" == "" ? "${var.name_prefix}-log" : "${var.name_prefix}-log-${var.name_postfix}"
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_s3_bucket" "log" {
acl = "log-delivery-write"
bucket = "${var.name_prefix}-log"
bucket = local.s3_log_bucket_name
lifecycle {
prevent_destroy = true
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ variable "tags" {
description = "(Optional) A mapping of tags to assign to the resources"
type = map(string)
default = {}
}

variable "name_postfix" {
default = ""
description = "The name postfix to use when creating resource names"
type = string
}

0 comments on commit e724519

Please sign in to comment.