cloudposse / cloudposse/terraform-aws-lambda-function

Churn with `aws_iam_role.this`

Open
#62 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
HCL
Stars
36
Forks
44
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

There is a permanent name change with `aws_iam_role.this` which is causing the resource to be recreated on every apply.

This is causing further issues with KMS permissions in the lambda function being revoked, including permissions to the default KMS key.

See https://github.com/serverless/examples/issues/279 for context regarding KMS key

### Expected Behavior

IAM role should not be constantly recreated.

### Steps to Reproduce

Apply module, apply again.

### Screenshots

_No response_

### Environment

_No response_

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by applying the module twice and inspecting the aws_iam_role.this resource between runs; the issue identifies the permanent name change as the entry point. Done means the second apply no longer recreates the IAM role and the Lambda function retains its KMS permissions.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, terraform
Domain
cloud, infrastructure, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.