Skip to content

Commit

Permalink
feat: Added policy path variable to lambda module IAM role policy (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
onymbuk committed Dec 10, 2021
1 parent e647784 commit b3179a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ To run the tests:
| <a name="input_cloudwatch_log_group_tags"></a> [cloudwatch\_log\_group\_tags](#input\_cloudwatch\_log\_group\_tags) | Additional tags for the Cloudwatch log group | `map(string)` | `{}` | no |
| <a name="input_create"></a> [create](#input\_create) | Whether to create all resources | `bool` | `true` | no |
| <a name="input_create_sns_topic"></a> [create\_sns\_topic](#input\_create\_sns\_topic) | Whether to create new SNS topic | `bool` | `true` | no |
| <a name="input_iam_policy_path"></a> [iam\_policy\_path](#input\_iam\_policy\_path) | Path of policies to that should be added to IAM role for Lambda Function | `string` | `null` | no |
| <a name="input_iam_role_boundary_policy_arn"></a> [iam\_role\_boundary\_policy\_arn](#input\_iam\_role\_boundary\_policy\_arn) | The ARN of the policy that is used to set the permissions boundary for the role | `string` | `null` | no |
| <a name="input_iam_role_name_prefix"></a> [iam\_role\_name\_prefix](#input\_iam\_role\_name\_prefix) | A unique role name beginning with the specified prefix | `string` | `"lambda"` | no |
| <a name="input_iam_role_path"></a> [iam\_role\_path](#input\_iam\_role\_path) | Path of IAM role to use for Lambda Function | `string` | `null` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ module "lambda" {
role_permissions_boundary = var.iam_role_boundary_policy_arn
role_tags = var.iam_role_tags
role_path = var.iam_role_path
policy_path = var.iam_policy_path

# Do not use Lambda's policy for cloudwatch logs, because we have to add a policy
# for KMS conditionally. This way attach_policy_json is always true independenty of
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ variable "iam_role_path" {
default = null
}

variable "iam_policy_path" {
description = "Path of policies to that should be added to IAM role for Lambda Function"
type = string
default = null
}

variable "lambda_function_tags" {
description = "Additional tags for the Lambda function"
type = map(string)
Expand Down

0 comments on commit b3179a9

Please sign in to comment.