Skip to content

Commit 1446844

Browse files
author
iru
authored
fix: cloudtrail creation conditional (#129)
after the `existing_cloudtrail_config` refactor the `deploy_cloudtrail` flag was not correctly setup <!-- Thank you for your contribution! ## General recommendations Check contribution guidelines at https://github.com/sysdiglabs/terraform-aws-secure-for-cloud/blob/master/CONTRIBUTE.md#contribution-checklist For a cleaner PR make sure you follow these recommendations: - Review modified files and delete small changes that were not intended and maybe slip the commit. - Use Pull Request Drafts for visibility on Work-In-Progress branches and use them on daily mob/pairing for team review - Unless an external revision is desired, in order to validate or gather some feedback, you are free to merge as long as **validation checks are green-lighted** ## Checklist - [ ] If `test/fixtures/*/main.tf` files are modified. I have updated: - [ ] the snippets in the README.md file under root folder. - [ ] the snippets in the README.md file for the corresponding example. - [ ] If `examples` folder are modified. I have updated: - [ ] README.md file with pertinent changes. - [ ] `test/fixtures/*/main.tf` in case the snippet needs modifications. - [ ] If any architectural change has been made, I have updated the diagrams. -->
1 parent 6b94477 commit 1446844

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/organizational/cloudtrail.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
2-
deploy_cloudtrail = var.existing_cloudtrail_config == null || var.existing_cloudtrail_config.cloudtrail_sns_arn == "create" || var.existing_cloudtrail_config.cloudtrail_sns_arn == null
2+
deploy_cloudtrail = var.existing_cloudtrail_config == null || (var.existing_cloudtrail_config != null && var.existing_cloudtrail_config.cloudtrail_sns_arn == "create" && var.existing_cloudtrail_config.cloudtrail_s3_sns_sqs_arn == null)
3+
34
cloudtrail_sns_arn = local.deploy_cloudtrail ? module.cloudtrail[0].cloudtrail_sns_arn : var.existing_cloudtrail_config.cloudtrail_sns_arn
45
cloudtrail_s3_arn = local.deploy_cloudtrail ? module.cloudtrail[0].s3_bucket_arn : var.existing_cloudtrail_config.cloudtrail_s3_arn
56
}

0 commit comments

Comments
 (0)