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

add optional target group #139

Merged
merged 25 commits into from
Jun 8, 2023
Merged

add optional target group #139

merged 25 commits into from
Jun 8, 2023

Conversation

wullub
Copy link
Contributor

@wullub wullub commented May 18, 2023

add optional target group

@wullub wullub requested a review from a team as a code owner May 18, 2023 10:55
@github-actions
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
  timings
  ──────────────────────────────────────────
  disk i/o             233.902µs
  parsing              754.096503ms
  adaptation           317.804µs
  checks               19.046622ms
  total                773.694831ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-05-18 10:58:28,906 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 27, Failed checks: 0, Skipped checks: 2

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
tflint_exitcode=0

@github-actions
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
  timings
  ──────────────────────────────────────────
  disk i/o             134.401µs
  parsing              5.500924ms
  adaptation           169.201µs
  checks               11.839051ms
  total                17.643577ms

  counts
  ──────────────────────────────────────────
  modules downloaded   0
  modules processed    1
  blocks processed     29
  files read           4

  results
  ──────────────────────────────────────────
  passed               6
  ignored              1
  critical             0
  high                 0
  medium               0
  low                  0


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
terraform scan results:

Passed checks: 26, Failed checks: 1, Skipped checks: 2

Check: CKV_AWS_91: "Ensure the ELBv2 (Application/Network) has access logging enabled"
	FAILED for resource: module.lb_access_logs_enabled.aws_lb.loadbalancer
	File: /main.tf:122-146
	Calling File: /test/unit-test/main.tf:60-78
	Guide: https://docs.bridgecrew.io/docs/bc_aws_logging_22

		122 | resource "aws_lb" "loadbalancer" {
		123 |   #checkov:skip=CKV_AWS_150:preventing destroy can be controlled outside of the module
		124 |   #checkov:skip=CKV2_AWS_28:WAF is configured outside of the module for more flexibility
		125 |   name                       = "${var.application_name}-lb"
		126 |   internal                   = var.internal_lb
		127 |   load_balancer_type         = var.load_balancer_type
		128 |   security_groups            = length(aws_security_group.lb) > 0 ? [aws_security_group.lb[0].id] : var.security_groups
		129 |   subnets                    = [var.public_subnets[0], var.public_subnets[1], var.public_subnets[2]]
		130 |   enable_deletion_protection = var.enable_deletion_protection
		131 |   idle_timeout               = var.idle_timeout
		132 |   drop_invalid_header_fields = true
		133 | 
		134 |   # access_logs {
		135 |   #   bucket  = var.existing_bucket_name != "" ? var.existing_bucket_name : module.s3-bucket[0].bucket.id
		136 |   #   prefix  = var.application_name
		137 |   #   enabled = true
		138 |   # }
		139 | 
		140 |   tags = merge(
		141 |     var.tags,
		142 |     {
		143 |       Name = "${var.application_name}-lb"
		144 |     },
		145 |   )
		146 | }

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

CTFLint Scan Failed

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
2 issue(s) found:

Warning: data "aws_iam_policy_document" "bucket_policy" is declared but not used (terraform_unused_declarations)

  on github/workspace/main.tf line 65:
  65: data "aws_iam_policy_document" "bucket_policy" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "force_destroy_bucket" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 68:
  68: variable "force_destroy_bucket" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

tflint_exitcode=2

@wullub wullub force-pushed the add-optional-target-group branch from a33dcff to 6fad759 Compare June 6, 2023 15:32
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             116µs
  parsing              2.205806ms
  adaptation           119.4µs
  checks               8.635828ms
  total                11.077034ms

  counts
  ──────────────────────────────────────────
  modules downloaded   0
  modules processed    1
  blocks processed     29
  files read           4

  results
  ──────────────────────────────────────────
  passed               6
  ignored              1
  critical             0
  high                 0
  medium               0
  low                  0


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
terraform scan results:

Passed checks: 27, Failed checks: 1, Skipped checks: 2

Check: CKV_AWS_91: "Ensure the ELBv2 (Application/Network) has access logging enabled"
	FAILED for resource: module.lb_access_logs_enabled.aws_lb.loadbalancer
	File: /main.tf:122-146
	Calling File: /test/unit-test/main.tf:60-78
	Guide: https://docs.bridgecrew.io/docs/bc_aws_logging_22

		122 | resource "aws_lb" "loadbalancer" {
		123 |   #checkov:skip=CKV_AWS_150:preventing destroy can be controlled outside of the module
		124 |   #checkov:skip=CKV2_AWS_28:WAF is configured outside of the module for more flexibility
		125 |   name                       = "${var.application_name}-lb"
		126 |   internal                   = var.internal_lb
		127 |   load_balancer_type         = var.load_balancer_type
		128 |   security_groups            = length(aws_security_group.lb) > 0 ? [aws_security_group.lb[0].id] : var.security_groups
		129 |   subnets                    = [var.public_subnets[0], var.public_subnets[1], var.public_subnets[2]]
		130 |   enable_deletion_protection = var.enable_deletion_protection
		131 |   idle_timeout               = var.idle_timeout
		132 |   drop_invalid_header_fields = true
		133 | 
		134 |   # access_logs {
		135 |   #   bucket  = var.existing_bucket_name != "" ? var.existing_bucket_name : module.s3-bucket[0].bucket.id
		136 |   #   prefix  = var.application_name
		137 |   #   enabled = true
		138 |   # }
		139 | 
		140 |   tags = merge(
		141 |     var.tags,
		142 |     {
		143 |       Name = "${var.application_name}-lb"
		144 |     },
		145 |   )
		146 | }

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

CTFLint Scan Failed

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
2 issue(s) found:

Warning: data "aws_iam_policy_document" "bucket_policy" is declared but not used (terraform_unused_declarations)

  on github/workspace/main.tf line 65:
  65: data "aws_iam_policy_document" "bucket_policy" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "force_destroy_bucket" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 68:
  68: variable "force_destroy_bucket" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

tflint_exitcode=2

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             108.501µs
  parsing              1.671805ms
  adaptation           98.2µs
  checks               7.743824ms
  total                9.62233ms

  counts
  ──────────────────────────────────────────
  modules downloaded   0
  modules processed    1
  blocks processed     25
  files read           4

  results
  ──────────────────────────────────────────
  passed               4
  ignored              1
  critical             0
  high                 0
  medium               0
  low                  0


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
terraform scan results:

Passed checks: 14, Failed checks: 1, Skipped checks: 2

Check: CKV_AWS_91: "Ensure the ELBv2 (Application/Network) has access logging enabled"
	FAILED for resource: module.lb_access_logs_enabled.aws_lb.loadbalancer
	File: /main.tf:122-146
	Calling File: /test/unit-test/main.tf:60-78
	Guide: https://docs.bridgecrew.io/docs/bc_aws_logging_22

		122 | resource "aws_lb" "loadbalancer" {
		123 |   #checkov:skip=CKV_AWS_150:preventing destroy can be controlled outside of the module
		124 |   #checkov:skip=CKV2_AWS_28:WAF is configured outside of the module for more flexibility
		125 |   name                       = "${var.application_name}-lb"
		126 |   internal                   = var.internal_lb
		127 |   load_balancer_type         = var.load_balancer_type
		128 |   security_groups            = length(aws_security_group.lb) > 0 ? [aws_security_group.lb[0].id] : var.security_groups
		129 |   subnets                    = [var.public_subnets[0], var.public_subnets[1], var.public_subnets[2]]
		130 |   enable_deletion_protection = var.enable_deletion_protection
		131 |   idle_timeout               = var.idle_timeout
		132 |   drop_invalid_header_fields = true
		133 | 
		134 |   # access_logs {
		135 |   #   bucket  = var.existing_bucket_name != "" ? var.existing_bucket_name : module.s3-bucket[0].bucket.id
		136 |   #   prefix  = var.application_name
		137 |   #   enabled = true
		138 |   # }
		139 | 
		140 |   tags = merge(
		141 |     var.tags,
		142 |     {
		143 |       Name = "${var.application_name}-lb"
		144 |     },
		145 |   )
		146 | }

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

CTFLint Scan Failed

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
5 issue(s) found:

Warning: data "aws_elb_service_account" "default" is declared but not used (terraform_unused_declarations)

  on github/workspace/main.tf line 119:
 119: data "aws_elb_service_account" "default" {}

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "account_number" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 1:
   1: variable "account_number" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "region" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 55:
  55: variable "region" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "existing_bucket_name" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 63:
  63: variable "existing_bucket_name" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "force_destroy_bucket" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 68:
  68: variable "force_destroy_bucket" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

tflint_exitcode=2

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             136.408µs
  parsing              1.99372ms
  adaptation           116.206µs
  checks               18.85962ms
  total                21.105954ms

  counts
  ──────────────────────────────────────────
  modules downloaded   0
  modules processed    1
  blocks processed     24
  files read           4

  results
  ──────────────────────────────────────────
  passed               4
  ignored              1
  critical             0
  high                 0
  medium               0
  low                  0


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
terraform scan results:

Passed checks: 14, Failed checks: 1, Skipped checks: 2

Check: CKV_AWS_91: "Ensure the ELBv2 (Application/Network) has access logging enabled"
	FAILED for resource: module.lb_access_logs_enabled.aws_lb.loadbalancer
	File: /main.tf:122-146
	Calling File: /test/unit-test/main.tf:60-78
	Guide: https://docs.bridgecrew.io/docs/bc_aws_logging_22

		122 | resource "aws_lb" "loadbalancer" {
		123 |   #checkov:skip=CKV_AWS_150:preventing destroy can be controlled outside of the module
		124 |   #checkov:skip=CKV2_AWS_28:WAF is configured outside of the module for more flexibility
		125 |   name                       = "${var.application_name}-lb"
		126 |   internal                   = var.internal_lb
		127 |   load_balancer_type         = var.load_balancer_type
		128 |   security_groups            = length(aws_security_group.lb) > 0 ? [aws_security_group.lb[0].id] : var.security_groups
		129 |   subnets                    = [var.public_subnets[0], var.public_subnets[1], var.public_subnets[2]]
		130 |   enable_deletion_protection = var.enable_deletion_protection
		131 |   idle_timeout               = var.idle_timeout
		132 |   drop_invalid_header_fields = true
		133 | 
		134 |   # access_logs {
		135 |   #   bucket  = var.existing_bucket_name != "" ? var.existing_bucket_name : module.s3-bucket[0].bucket.id
		136 |   #   prefix  = var.application_name
		137 |   #   enabled = true
		138 |   # }
		139 | 
		140 |   tags = merge(
		141 |     var.tags,
		142 |     {
		143 |       Name = "${var.application_name}-lb"
		144 |     },
		145 |   )
		146 | }

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

CTFLint Scan Failed

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
5 issue(s) found:

Warning: data "aws_elb_service_account" "default" is declared but not used (terraform_unused_declarations)

  on github/workspace/main.tf line 119:
 119: data "aws_elb_service_account" "default" {}

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "account_number" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 1:
   1: variable "account_number" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "region" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 55:
  55: variable "region" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "existing_bucket_name" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 63:
  63: variable "existing_bucket_name" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "force_destroy_bucket" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 68:
  68: variable "force_destroy_bucket" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

tflint_exitcode=2

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             244.205µs
  parsing              588.420357ms
  adaptation           319.104µs
  checks               23.157027ms
  total                612.140693ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 12:06:55,390 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 14, Failed checks: 1, Skipped checks: 2

Check: CKV_AWS_91: "Ensure the ELBv2 (Application/Network) has access logging enabled"
	FAILED for resource: module.lb_access_logs_enabled.aws_lb.loadbalancer
	File: /main.tf:122-146
	Calling File: /test/unit-test/main.tf:60-78
	Guide: https://docs.bridgecrew.io/docs/bc_aws_logging_22

		122 | resource "aws_lb" "loadbalancer" {
		123 |   #checkov:skip=CKV_AWS_150:preventing destroy can be controlled outside of the module
		124 |   #checkov:skip=CKV2_AWS_28:WAF is configured outside of the module for more flexibility
		125 |   name                       = "${var.application_name}-lb"
		126 |   internal                   = var.internal_lb
		127 |   load_balancer_type         = var.load_balancer_type
		128 |   security_groups            = length(aws_security_group.lb) > 0 ? [aws_security_group.lb[0].id] : var.security_groups
		129 |   subnets                    = [var.public_subnets[0], var.public_subnets[1], var.public_subnets[2]]
		130 |   enable_deletion_protection = var.enable_deletion_protection
		131 |   idle_timeout               = var.idle_timeout
		132 |   drop_invalid_header_fields = true
		133 | 
		134 |   # access_logs {
		135 |   #   bucket  = var.existing_bucket_name != "" ? var.existing_bucket_name : module.s3-bucket[0].bucket.id
		136 |   #   prefix  = var.application_name
		137 |   #   enabled = true
		138 |   # }
		139 | 
		140 |   tags = merge(
		141 |     var.tags,
		142 |     {
		143 |       Name = "${var.application_name}-lb"
		144 |     },
		145 |   )
		146 | }

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

CTFLint Scan Failed

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
3 issue(s) found:

Warning: data "aws_elb_service_account" "default" is declared but not used (terraform_unused_declarations)

  on github/workspace/main.tf line 119:
 119: data "aws_elb_service_account" "default" {}

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "account_number" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 1:
   1: variable "account_number" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "region" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 55:
  55: variable "region" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

tflint_exitcode=2

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             271.114µs
  parsing              625.178347ms
  adaptation           321.117µs
  checks               21.291463ms
  total                647.062041ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 12:10:46,057 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 14, Failed checks: 1, Skipped checks: 2

Check: CKV_AWS_91: "Ensure the ELBv2 (Application/Network) has access logging enabled"
	FAILED for resource: module.lb_access_logs_enabled.aws_lb.loadbalancer
	File: /main.tf:122-146
	Calling File: /test/unit-test/main.tf:60-78
	Guide: https://docs.bridgecrew.io/docs/bc_aws_logging_22

		122 | resource "aws_lb" "loadbalancer" {
		123 |   #checkov:skip=CKV_AWS_150:preventing destroy can be controlled outside of the module
		124 |   #checkov:skip=CKV2_AWS_28:WAF is configured outside of the module for more flexibility
		125 |   name                       = "${var.application_name}-lb"
		126 |   internal                   = var.internal_lb
		127 |   load_balancer_type         = var.load_balancer_type
		128 |   security_groups            = length(aws_security_group.lb) > 0 ? [aws_security_group.lb[0].id] : var.security_groups
		129 |   subnets                    = [var.public_subnets[0], var.public_subnets[1], var.public_subnets[2]]
		130 |   enable_deletion_protection = var.enable_deletion_protection
		131 |   idle_timeout               = var.idle_timeout
		132 |   drop_invalid_header_fields = true
		133 | 
		134 |   # access_logs {
		135 |   #   bucket  = var.existing_bucket_name != "" ? var.existing_bucket_name : module.s3-bucket[0].bucket.id
		136 |   #   prefix  = var.application_name
		137 |   #   enabled = true
		138 |   # }
		139 | 
		140 |   tags = merge(
		141 |     var.tags,
		142 |     {
		143 |       Name = "${var.application_name}-lb"
		144 |     },
		145 |   )
		146 | }

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

CTFLint Scan Failed

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
3 issue(s) found:

Warning: data "aws_elb_service_account" "default" is declared but not used (terraform_unused_declarations)

  on github/workspace/main.tf line 119:
 119: data "aws_elb_service_account" "default" {}

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "account_number" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 1:
   1: variable "account_number" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

Warning: variable "region" is declared but not used (terraform_unused_declarations)

  on github/workspace/variables.tf line 55:
  55: variable "region" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.1/docs/rules/terraform_unused_declarations.md

tflint_exitcode=2

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             262.8µs
  parsing              639.929303ms
  adaptation           299.6µs
  checks               14.360414ms
  total                654.852117ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 12:38:19,139 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 28, Failed checks: 0, Skipped checks: 2

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
tflint_exitcode=0

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             318.501µs
  parsing              694.567328ms
  adaptation           351.801µs
  checks               20.644911ms
  total                715.882541ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 14:58:53,752 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 28, Failed checks: 0, Skipped checks: 2

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
tflint_exitcode=0

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             303.803µs
  parsing              1.304642909s
  adaptation           401.004µs
  checks               17.753866ms
  total                1.323101582s

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 15:08:28,172 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 28, Failed checks: 0, Skipped checks: 2

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
tflint_exitcode=0

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             239.496µs
  parsing              411.160598ms
  adaptation           318.497µs
  checks               10.651998ms
  total                422.370589ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 17:57:28,111 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 28, Failed checks: 0, Skipped checks: 2

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
tflint_exitcode=0

Copy link
Contributor

@ewastempel ewastempel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

TFSEC Scan Success

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

TFSEC will check the following folders:
.

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

Running TFSEC in .
Excluding the following checks: AWS089, AWS099, AWS009, AWS097, AWS018
  timings
  ──────────────────────────────────────────
  disk i/o             341.1µs
  parsing              393.943148ms
  adaptation           397.999µs
  checks               21.969508ms
  total                416.651755ms

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

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


No problems detected!

tfsec_exitcode=0

Checkov Scan Failed

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

Checkov will check the following folders:
.

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

Running Checkov in .
Excluding the following checks: CKV_GIT_1
2023-06-07 18:35:22,579 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v6.4.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 28, Failed checks: 0, Skipped checks: 2

github_actions scan results:

Passed checks: 175, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Generate Terraform README docs)
	File: /.github/workflows/documentation.yml:0-1

checkov_exitcode=1

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 .
WARNING: "tflint FILE/DIR" is deprecated and will error in a future version. Use --chdir or --filter instead.
tflint_exitcode=0

@ewastempel ewastempel merged commit efb8529 into main Jun 8, 2023
@ewastempel ewastempel deleted the add-optional-target-group branch June 8, 2023 07:45
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