Skip to content

Commit

Permalink
Try to deprecate variable policy_path correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Jan 8, 2025
1 parent 40c75c5 commit 393f260
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.1
rev: v1.96.3
hooks:
- id: terraform_fmt
- id: terraform_wrapper_module_for_each
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ No modules.
| <a name="input_policy_json"></a> [policy\_json](#input\_policy\_json) | An additional policy document as JSON to attach to the Lambda Function role | `string` | `null` | no |
| <a name="input_policy_jsons"></a> [policy\_jsons](#input\_policy\_jsons) | List of additional policy documents as JSON to attach to Lambda Function role | `list(string)` | `[]` | no |
| <a name="input_policy_name"></a> [policy\_name](#input\_policy\_name) | IAM policy name. It override the default value, which is the same as role\_name | `string` | `null` | no |
| <a name="input_policy_path"></a> [policy\_path](#input\_policy\_path) | Path of policies to that should be added to IAM role for Lambda Function | `string` | `null` | no |
| <a name="input_policy_statements"></a> [policy\_statements](#input\_policy\_statements) | Map of dynamic policy statements to attach to Lambda Function role | `any` | `{}` | no |
| <a name="input_provisioned_concurrent_executions"></a> [provisioned\_concurrent\_executions](#input\_provisioned\_concurrent\_executions) | Amount of capacity to allocate. Set to 1 or greater to enable, or set to 0 to disable provisioned concurrency. | `number` | `-1` | no |
| <a name="input_publish"></a> [publish](#input\_publish) | Whether to publish creation/change as new Lambda Function Version. | `bool` | `false` | no |
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,14 @@ variable "attach_policies" {
default = false
}

# TODO: DEPRECATED: Remove this variable in the next major version
# tflint-ignore: all
variable "policy_path" {
description = "Path of policies to that should be added to IAM role for Lambda Function"
type = string
default = null
}

variable "number_of_policy_jsons" {
description = "Number of policies JSON to attach to IAM role for Lambda Function"
type = number
Expand Down
1 change: 1 addition & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module "wrapper" {
policy_json = try(each.value.policy_json, var.defaults.policy_json, null)
policy_jsons = try(each.value.policy_jsons, var.defaults.policy_jsons, [])
policy_name = try(each.value.policy_name, var.defaults.policy_name, null)
policy_path = try(each.value.policy_path, var.defaults.policy_path, null)
policy_statements = try(each.value.policy_statements, var.defaults.policy_statements, {})
provisioned_concurrent_executions = try(each.value.provisioned_concurrent_executions, var.defaults.provisioned_concurrent_executions, -1)
publish = try(each.value.publish, var.defaults.publish, false)
Expand Down

0 comments on commit 393f260

Please sign in to comment.