Skip to content

Commit

Permalink
Fix outputs validation and s3 bucket logic (#4)
Browse files Browse the repository at this point in the history
* small doc changes

* Fixing outputs validation and s3_log_bucket logic

* Auto Format

* Update outputs.tf

Co-authored-by: nitrocode <[email protected]>

* Update outputs.tf

Co-authored-by: nitrocode <[email protected]>

Co-authored-by: cloudpossebot <[email protected]>
Co-authored-by: nitrocode <[email protected]>
  • Loading branch information
3 people authored Jul 12, 2021
1 parent 7ed1b14 commit 50808b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output "ssm_patch_log_s3_bucket_id" {
description = "SSM Patch Manager s3 log bucket ID"
value = module.ssm_patch_log_s3_bucket[0].bucket_id
value = local.create_log_bucket ? join("", module.ssm_patch_log_s3_bucket.*.bucket_id) : ""
}

output "ssm_patch_log_s3_bucket_arn" {
description = "SSM Patch Manager s3 log bucket ARN"
value = module.ssm_patch_log_s3_bucket[0].bucket_arn
value = local.create_log_bucket ? join("", module.ssm_patch_log_s3_bucket.*.bucket_arn) : ""
}

output "scan_maintenance_window_task_id" {
Expand Down
2 changes: 1 addition & 1 deletion ssm_log_bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
account_id = data.aws_caller_identity.current.account_id
create_log_bucket = local.enabled && var.bucket_id == null
bucket_id = var.bucket_id != null ? var.bucket_id : module.ssm_patch_log_s3_bucket_label.id
bucket_policy = var.ssm_bucket_policy != null ? var.ssm_bucket_policy : data.aws_iam_policy_document.bucket_policy[0].json
bucket_policy = var.ssm_bucket_policy != null ? var.ssm_bucket_policy : try(data.aws_iam_policy_document.bucket_policy[0].json, "")
}


Expand Down

0 comments on commit 50808b5

Please sign in to comment.