Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic to handle access_logs=false #280

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Logic to handle access_logs=false #280

merged 1 commit into from
Oct 31, 2023

Conversation

pavmoj
Copy link
Contributor

@pavmoj pavmoj commented Oct 31, 2023

If access_logs is assigned false, module users experience the following errors.
Extra conditionals have been added to the PR to address this.

│ Error: Invalid index
│ 
│   on .terraform/modules/baseline.lb/main.tf line 315, in data "aws_iam_policy_document" "lb_glue_crawler":
│  315:     resources = [var.existing_bucket_name != "" ? "arn:aws:s3:::${var.existing_bucket_name}/${var.application_name}/AWSLogs/${var.account_number}/*" : "${module.s3-bucket[0].bucket.arn}/${var.application_name}/AWSLogs/${var.account_number}/*"]
│     ├────────────────
│     │ module.s3-bucket is empty tuple
│ 
│ The given key does not identify an element in this collection value: the
│ collection has no elements.

│ Error: Invalid index
│ 
│   on .terraform/modules/baseline.lb/main.tf line 333, in resource "aws_glue_crawler" "ssm_resource_sync":
│  333:   database_name = aws_athena_database.lb-access-logs[0].name
│     ├────────────────
│     │ aws_athena_database.lb-access-logs is empty tuple
│ 
│ The given key does not identify an element in this collection value: the
│ collection has no elements.

@pavmoj pavmoj requested a review from a team as a code owner October 31, 2023 14:35
Copy link
Contributor

TFSEC Scan Success

Show Output
*****************************

TFSEC will check the following folders:
.

*****************************

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018

======================================================
tfsec is joining the Trivy family

tfsec will continue to remain available 
for the time being, although our engineering 
attention will be directed at Trivy going forward.

You can read more here: 
https://github.com/aquasecurity/tfsec/discussions/1994
======================================================
  timings
  ──────────────────────────────────────────
  disk i/o             374.711µs
  parsing              835.696804ms
  adaptation           424.014µs
  checks               10.808053ms
  total                847.303582ms

  counts
  ──────────────────────────────────────────
  modules downloaded   1
  modules processed    2
  blocks processed     82
  files read           8

  results
  ──────────────────────────────────────────
  passed               10
  ignored              5
  critical             0
  high                 0
  medium               0
  low                  0


No problems detected!

tfsec_exitcode=0

Checkov Scan Success

Show Output
*****************************

Checkov will check the following folders:
.

*****************************

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-10-31 14:38:51,452 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=8688bc15a08fbf5a4f4eef9b7433c5a417df8df1:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 61, Failed checks: 0, Skipped checks: 3

github_actions scan results:

Passed checks: 176, Failed checks: 0, Skipped checks: 0


checkov_exitcode=0

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing `terraform` plugin...
Installed `terraform` (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.2.1)
tflint will check the following folders:
.

*****************************

Running tflint in .
tflint_exitcode=0

@ep-93 ep-93 merged commit 23f3315 into main Oct 31, 2023
5 checks passed
@ep-93 ep-93 deleted the bugfix/DSO-2309 branch October 31, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants