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

"ebs_csi" policy documents will fail when "ebs_csi_kms_cmk_ids" is set #211

Closed
ghost opened this issue Mar 23, 2022 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Mar 23, 2022

Description

Please provide a clear and concise description of the issue you are encountering, your current setup, and what steps led up to the issue. If you can provide a reproduction, that will help tremendously.

in aws_iam_policy_document.ebs_csi dynamic block, for_each expression is defined as below
for_each = length(var.ebs_csi_kms_cmk_ids) > 0 ? [1] : []
and resources which should be a set of strings is defined as
resources = statement.value
which cause the module to fail with Incorrect attribute value type error if ebs_csi_kms_cmk_ids input is set

 Error: Incorrect attribute value type
 
   on .terraform/modules/ebs_csi_irsa/modules/iam-role-for-service-accounts-eks/policies.tf line 259, in data "aws_iam_policy_document" "ebs_csi":
  259:       resources = statement.value
 
 Inappropriate value for attribute "resources": set of string required.


 Error: Incorrect attribute value type
 
   on .terraform/modules/ebs_csi_irsa/modules/iam-role-for-service-accounts-eks/policies.tf line 280, in data "aws_iam_policy_document" "ebs_csi":
  280:       resources = statement.value
 
 Inappropriate value for attribute "resources": set of string required.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Terraform: 1.1.7
  • Provider(s):
    kubectl v1.13.1
    aws v4.5.0
    cloudinit v2.2.0
    helm v2.4.1
    kubernetes v2.8.0
    local v2.2.2
    null v3.1.1
    random v3.1.2
    template v2.2.0
    tls v3.1.0
    http v2.4.1
  • Module:
    iam-role-for-service-accounts-eks

Reproduction

Steps to reproduce the behavior:
set "ebs_csi_kms_cmk_ids" and execute the module

Code Snippet to Reproduce

Expected behavior

for_each expression should take the kms key as input and resources element should be a set of string

Actual behavior

Terminal Output Screenshot(s)

Additional context

@bryantbiggs
Copy link
Member

I believe this would be resolved with #203

@bryantbiggs
Copy link
Member

resolved in #203

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant