Skip to content

Comments

fix(query): allow for string interpolation in lambda_iam_invokefunction_miscongifured regex#7335

Open
owenjonesuob wants to merge 2 commits intoCheckmarx:masterfrom
owenjonesuob:hotfix/lambda-iam-invokefunction-regex
Open

fix(query): allow for string interpolation in lambda_iam_invokefunction_miscongifured regex#7335
owenjonesuob wants to merge 2 commits intoCheckmarx:masterfrom
owenjonesuob:hotfix/lambda-iam-invokefunction-regex

Conversation

@owenjonesuob
Copy link

The current regex implies that we should have something like:

data "aws_iam_policy_document" "example" {
  statement {
    actions = ["lambda:InvokeFunction"]
    resources = [
      aws_lambda_function.example.arn,
      aws_lambda_function.example.arn:*   # <-- this is not legal syntax
    ]
  }
}

In fact we would need something like this instead, using Terraform's string interpolation syntax:

data "aws_iam_policy_document" "example" {
  statement {
    actions = ["lambda:InvokeFunction"]
    resources = [
      aws_lambda_function.example.arn,
      "${aws_lambda_function.example.arn}:*"
    ]
  }
}

I've amended the regex to match the corrected example.


I submit this contribution under the Apache-2.0 license.

@owenjonesuob owenjonesuob requested a review from a team as a code owner February 12, 2025 17:40
@github-actions github-actions bot added community Community contribution terraform Terraform query aws PR related with AWS Cloud labels Feb 12, 2025
@owenjonesuob owenjonesuob changed the title Allow for string interpolation in lambda_iam_invokefunction_miscongifured regex fix(query): allow for string interpolation in lambda_iam_invokefunction_miscongifured regex Feb 12, 2025
@github-actions github-actions bot added the query New query feature label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws PR related with AWS Cloud community Community contribution query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant