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

Terraform Static Code Analysis - scheduled scan of all directories is failing #5890

Closed
ewastempel opened this issue Dec 29, 2023 · 2 comments · Fixed by #5891
Closed

Terraform Static Code Analysis - scheduled scan of all directories is failing #5890

ewastempel opened this issue Dec 29, 2023 · 2 comments · Fixed by #5891
Assignees
Labels
bug Something isn't working

Comments

@ewastempel
Copy link
Contributor

ewastempel commented Dec 29, 2023

Expected Behavior

The daily SCA scan of all directories should run clean, like in this instance from about a week ago.

Errors:

Error: Invalid index

  on terraform/environments/core-vpc/transit-gateway-attachment.tf line 35, in module "vpc_attachment":
  35:   for_each = toset(keys(local.vpcs[terraform.workspace]))

with local.vpcs as object with 5 attributes,
     terraform.workspace as "default".

The given key does not identify an element in this collection value.

Actual Behavior

The daily SCA scan of all directories fails for tflint in the modernisation-platform/terraform/environments/core-vpc directory, like in this instance from today,

Steps to Reproduce the Problem

The workflow runs daily on schedule, see the failing alert generated daily in slack.

NOTE, the scheduled workflow run clean a week ago, so this is a new bug.

Version

for a failing workflow:
github.com/terraform-linters/tflint-ruleset-terraform, version: 0.2.1
tflint version installed on docker image in github-actions: 0.50.0

for a successful workflow:
github.com/terraform-linters/tflint-ruleset-terraform, version: 0.2.1
tflint version installed on docker image in github-actions: 0.49.0

Modules

No response

Account

No response

@ewastempel
Copy link
Contributor Author

Tflint version 0.50.0 had breaking changes and introduced a bug in our terraform code, as now by default tf modules are run if they are local.
It can be turned off by setting --call-module-type=none, but the changes to allow it, must be made in the github-actions code, before this can be implemented in our GH workflows.

@ewastempel
Copy link
Contributor Author

Created a PR to fix the issue in the github-actions repo: ministryofjustice/github-actions#226

@ewastempel ewastempel moved this from To Do to In Progress in Modernisation Platform Dec 29, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Modernisation Platform Dec 29, 2023
@ewastempel ewastempel moved this from Done to Blocked in Modernisation Platform Jan 5, 2024
@ewastempel ewastempel moved this from Blocked to In Progress in Modernisation Platform Jan 5, 2024
@ewastempel ewastempel moved this from In Progress to Blocked in Modernisation Platform Jan 5, 2024
@ewastempel ewastempel reopened this Jan 5, 2024
@github-project-automation github-project-automation bot moved this from Blocked to To Do in Modernisation Platform Jan 5, 2024
@ewastempel ewastempel moved this from To Do to Blocked in Modernisation Platform Jan 5, 2024
@ewastempel ewastempel moved this from Blocked to Done in Modernisation Platform Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant