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

Fix "Invalid index" error when VPC baseline is disabled #197

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

wheerd
Copy link
Contributor

@wheerd wheerd commented Jun 29, 2021

Currently, we have the VPC baseline disabled in one of our AWS accounts. When trying to update to the latest version of the module, we get several errors like this:

Error: Invalid index

  on .terraform/modules/master_secure_baseline/vpc_baselines.tf line 395, in module "vpc_baseline_us-west-2":
 395:   flow_logs_iam_role_arn      = local.is_cw_logs ? aws_iam_role.flow_logs_publisher[0].arn : null
    ├────────────────
    aws_iam_role.flow_logs_publisher is empty tuple

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

Th condition for those modules is not using var.vpc_enable properly. This PR aims to fix that and simplify the conditions as well.

@nozaq nozaq added the bug Something isn't working label Jul 3, 2021
@nozaq
Copy link
Owner

nozaq commented Jul 3, 2021

@wheerd Thank you, LGTM!

@nozaq nozaq merged commit 09e5d75 into nozaq:master Jul 3, 2021
@wheerd wheerd deleted the fix/vpc-disabled-cw-logging branch November 6, 2021 18:20
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants