Skip to content

Commit

Permalink
Fix rewource to only create if enabled and attempt to fix a dependenc…
Browse files Browse the repository at this point in the history
…y issue
  • Loading branch information
snemetz committed Jun 1, 2022
1 parent 4630107 commit a861e64
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data "aws_s3_bucket" "landing" {

resource "aws_transfer_server" "default" {
count = local.enabled ? 1 : 0
depends_on = [aws_eip.sftp]

identity_provider_type = "SERVICE_MANAGED"
protocols = ["SFTP"]
Expand Down Expand Up @@ -149,6 +150,7 @@ module "logging_label" {

resource "aws_cloudwatch_log_group" "transfer_server" {
#checkov:skip=CKV_AWS_158:Log encryption not needed
count = local.enabled ? 1 : 0
name = "/aws/transfer/${aws_transfer_server.default[0].id}"
retention_in_days = var.log_retention
tags = module.logging_label.tags
Expand Down

0 comments on commit a861e64

Please sign in to comment.