Skip to content

PLT-1482: Add Necessary KMS Keys to WAF Sync Lambda Permissions#353

Merged
gfreeman-navapbc merged 2 commits into
mainfrom
gfreeman/PLT-1482
Dec 12, 2025
Merged

PLT-1482: Add Necessary KMS Keys to WAF Sync Lambda Permissions#353
gfreeman-navapbc merged 2 commits into
mainfrom
gfreeman/PLT-1482

Conversation

@gfreeman-navapbc

Copy link
Copy Markdown
Contributor

🎫 Ticket

https://jira.cms.gov/browse/PLT-1482

🛠 Changes

Adds environment and app config keys to lambda permissions passed through to function module.

ℹ️ Context

The DPC WAF sync lambdas have been very error heavy and the source is invalid key configuration in the terraform service. This change aims to add the necessary permissions to stop the lambdas from erroring out.

🧪 Validation

Tofu Plan Output (DPC/DEV)
OpenTofu will perform the following actions:

  # module.api_waf_sync_function.aws_iam_role_policy.default_function will be updated in-place
  ~ resource "aws_iam_role_policy" "default_function" {
        id     = "dpc-dev-api-waf-sync-function:default-function"
        name   = "default-function"
      ~ policy = jsonencode(
          ~ {
              ~ Statement = [
                    {
                        Action   = [
                            "ssm:GetParameters",
                            "ssm:GetParameter",
                            "sqs:ReceiveMessage",
                            "sqs:GetQueueAttributes",
                            "sqs:DeleteMessage",
                            "logs:PutLogEvents",
                            "logs:CreateLogStream",
                            "logs:CreateLogGroup",
                            "ec2:DescribeNetworkInterfaces",
                            "ec2:DescribeAccountAttributes",
                            "ec2:DeleteNetworkInterface",
                            "ec2:CreateNetworkInterface",
                        ]
                        Effect   = "Allow"
                        Resource = "*"
                    },
                  ~ {
                      ~ Resource = [
                          + "arn:aws:kms:us-east-1::key/69fc1eca-71e6-43e6-acd1-53f0b80a7ef6",
                            "arn:aws:kms:us-east-1::key/601028a8-2ef7-4bec-9e39-af26d91e07b9",
                            # (1 unchanged element hidden)
                        ]
                        # (2 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

@gfreeman-navapbc gfreeman-navapbc self-assigned this Dec 11, 2025
@gfreeman-navapbc gfreeman-navapbc requested a review from a team as a code owner December 11, 2025 18:18
@gfreeman-navapbc gfreeman-navapbc requested a review from a team December 11, 2025 18:19

@jdettmannnava jdettmannnava left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lukey-luke lukey-luke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resource matches error from cloudwatch HERE. Thanks for updating!

@gfreeman-navapbc gfreeman-navapbc merged commit 7c0c1f4 into main Dec 12, 2025
15 checks passed
@gfreeman-navapbc gfreeman-navapbc deleted the gfreeman/PLT-1482 branch December 12, 2025 16:50
juliareynolds-nava pushed a commit that referenced this pull request Jan 6, 2026
## 🎫 Ticket

https://jira.cms.gov/browse/PLT-1482

## 🛠 Changes

Adds environment and app config keys to lambda permissions passed
through to function module.

## ℹ️ Context

The DPC WAF sync lambdas have been very error heavy and the source is
invalid key configuration in the terraform service. This change aims to
add the necessary permissions to stop the lambdas from erroring out.

## 🧪 Validation

<details>
<summary>Tofu Plan Output (DPC/DEV)</summary>

```
OpenTofu will perform the following actions:

  # module.api_waf_sync_function.aws_iam_role_policy.default_function will be updated in-place
  ~ resource "aws_iam_role_policy" "default_function" {
        id     = "dpc-dev-api-waf-sync-function:default-function"
        name   = "default-function"
      ~ policy = jsonencode(
          ~ {
              ~ Statement = [
                    {
                        Action   = [
                            "ssm:GetParameters",
                            "ssm:GetParameter",
                            "sqs:ReceiveMessage",
                            "sqs:GetQueueAttributes",
                            "sqs:DeleteMessage",
                            "logs:PutLogEvents",
                            "logs:CreateLogStream",
                            "logs:CreateLogGroup",
                            "ec2:DescribeNetworkInterfaces",
                            "ec2:DescribeAccountAttributes",
                            "ec2:DeleteNetworkInterface",
                            "ec2:CreateNetworkInterface",
                        ]
                        Effect   = "Allow"
                        Resource = "*"
                    },
                  ~ {
                      ~ Resource = [
                          + "arn:aws:kms:us-east-1::key/69fc1eca-71e6-43e6-acd1-53f0b80a7ef6",
                            "arn:aws:kms:us-east-1::key/601028a8-2ef7-4bec-9e39-af26d91e07b9",
                            # (1 unchanged element hidden)
                        ]
                        # (2 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
```
</details>
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.

4 participants